11"""
22Community URL configuration.
33"""
4-
4+ from django .conf .urls import url
5+ from django .urls import include
56from django_distill import distill_url
67from django .conf .urls .static import static
78from django .conf import settings
1516from gamification .views import GamificationResults
1617from meta_review .views import ContributorsMetaReview
1718from 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- )
3919from unassigned_issues .unassigned_issues_scraper import (
4020 unassigned_issues_activity_json ,
4121)
@@ -47,31 +27,6 @@ def get_index():
4727 return None
4828
4929
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-
7530urlpatterns = [
7631 distill_url (
7732 r'^$' , HomePageView .as_view (),
@@ -127,78 +82,6 @@ def get_organization():
12782 distill_func = get_index ,
12883 distill_file = 'static/inactive-issues.json' ,
12984 ),
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- ),
20285 distill_url (
20386 r'static/unassigned-issues.json' , unassigned_issues_activity_json ,
20487 name = 'unassigned_issues_activity_json' ,
@@ -211,4 +94,5 @@ def get_organization():
21194 distill_func = get_index ,
21295 distill_file = 'gamification/index.html' ,
21396 ),
97+ url (r'openhub/' , include ('openhub.urls' ))
21498] + static (settings .MEDIA_URL , document_root = settings .MEDIA_ROOT )
0 commit comments