1
1
"""
2
2
Community URL configuration.
3
3
"""
4
-
4
+ from django .conf .urls import url
5
+ from django .urls import include
5
6
from django_distill import distill_url
6
7
from django .conf .urls .static import static
7
8
from django .conf import settings
15
16
from gamification .views import GamificationResults
16
17
from meta_review .views import ContributorsMetaReview
17
18
from inactive_issues .inactive_issues_scraper import inactive_issues_json
18
- from openhub .views import index as openhub_index
19
- from model .views import index as model_index
20
- from openhub .models import (
21
- PortfolioProject ,
22
- OutsideCommitter ,
23
- AffiliatedCommitter ,
24
- OutsideProject ,
25
- Organization ,
26
- )
27
- from model .views import (
28
- PortfolioProjectListView ,
29
- PortfolioProjectDetailView ,
30
- AffiliatedCommitterListView ,
31
- AffiliatedCommitterDetailView ,
32
- OrganizationListView ,
33
- OrganizationDetailView ,
34
- OutsideProjectListView ,
35
- OutsideProjectDetailView ,
36
- OutsideCommitterListView ,
37
- OutsideCommitterDetailView ,
38
- )
39
19
from unassigned_issues .unassigned_issues_scraper import (
40
20
unassigned_issues_activity_json ,
41
21
)
@@ -47,31 +27,6 @@ def get_index():
47
27
return None
48
28
49
29
50
- def get_all_portfolioprojects ():
51
- for portfolioproject in PortfolioProject .objects .all ():
52
- yield {'pk' : portfolioproject .id }
53
-
54
-
55
- def get_all_outsidecommitters ():
56
- for outsidecommitter in OutsideCommitter .objects .all ():
57
- yield {'pk' : outsidecommitter .id }
58
-
59
-
60
- def get_all_outsideprojects ():
61
- for outsideproject in OutsideProject .objects .all ():
62
- yield {'pk' : outsideproject .id }
63
-
64
-
65
- def get_all_affiliatedcommitters ():
66
- for affiliatedcommitter in AffiliatedCommitter .objects .all ():
67
- yield {'pk' : affiliatedcommitter .id }
68
-
69
-
70
- def get_organization ():
71
- for organization in Organization .objects .all ():
72
- yield {'pk' : organization .id }
73
-
74
-
75
30
urlpatterns = [
76
31
distill_url (
77
32
r'^$' , HomePageView .as_view (),
@@ -127,78 +82,6 @@ def get_organization():
127
82
distill_func = get_index ,
128
83
distill_file = 'static/inactive-issues.json' ,
129
84
),
130
- distill_url (
131
- r'openhub/$' , openhub_index ,
132
- name = 'community-openhub' ,
133
- distill_func = get_index ,
134
- distill_file = 'openhub/index.html' ,
135
- ),
136
- distill_url (
137
- r'model/$' , model_index ,
138
- name = 'community-model' ,
139
- distill_func = get_index ,
140
- distill_file = 'model/index.html' ,
141
- ),
142
- distill_url (
143
- r'model/openhub/outside_committers/$' ,
144
- OutsideCommitterListView .as_view (),
145
- name = 'outsidecommitters' ,
146
- distill_func = get_index ,
147
- ),
148
- distill_url (
149
- r'model/openhub/outside_committer/(?P<pk>\d+)/$' ,
150
- OutsideCommitterDetailView .as_view (),
151
- name = 'outsidecommitter-detail' ,
152
- distill_func = get_all_outsidecommitters ,
153
- ),
154
- distill_url (
155
- r'model/openhub/outside_projects/$' ,
156
- OutsideProjectListView .as_view (),
157
- name = 'outsideprojects' ,
158
- distill_func = get_index ,
159
- ),
160
- distill_url (
161
- r'model/openhub/outside_project/(?P<pk>\d+)/$' ,
162
- OutsideProjectDetailView .as_view (),
163
- name = 'outsideproject-detail' ,
164
- distill_func = get_all_outsideprojects ,
165
- ),
166
- distill_url (
167
- r'model/openhub/affiliated_committers/$' ,
168
- AffiliatedCommitterListView .as_view (),
169
- name = 'affiliatedcommitters' ,
170
- distill_func = get_index ,
171
- ),
172
- distill_url (
173
- r'model/openhub/affiliated_committer/(?P<pk>\d+)/$' ,
174
- AffiliatedCommitterDetailView .as_view (),
175
- name = 'affiliatedcommitter-detail' ,
176
- distill_func = get_all_affiliatedcommitters ,
177
- ),
178
- distill_url (
179
- r'model/openhub/portfolio_projects/$' ,
180
- PortfolioProjectListView .as_view (),
181
- name = 'portfolioprojects' ,
182
- distill_func = get_index ,
183
- ),
184
- distill_url (
185
- r'model/openhub/portfolio_project/(?P<pk>\d+)/$' ,
186
- PortfolioProjectDetailView .as_view (),
187
- name = 'portfolioproject-detail' ,
188
- distill_func = get_all_portfolioprojects ,
189
- ),
190
- distill_url (
191
- r'model/openhub/organization/$' ,
192
- OrganizationListView .as_view (),
193
- name = 'organization' ,
194
- distill_func = get_index ,
195
- ),
196
- distill_url (
197
- r'model/openhub/org/(?P<pk>\d+)/$' ,
198
- OrganizationDetailView .as_view (),
199
- name = 'org-detail' ,
200
- distill_func = get_organization ,
201
- ),
202
85
distill_url (
203
86
r'static/unassigned-issues.json' , unassigned_issues_activity_json ,
204
87
name = 'unassigned_issues_activity_json' ,
@@ -211,4 +94,5 @@ def get_organization():
211
94
distill_func = get_index ,
212
95
distill_file = 'gamification/index.html' ,
213
96
),
97
+ url (r'openhub/' , include ('openhub.urls' ))
214
98
] + static (settings .MEDIA_URL , document_root = settings .MEDIA_ROOT )
0 commit comments