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