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
1415from gamification .views import GamificationResults
1516from meta_review .views import ContributorsMetaReview
1617from 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- )
3818from unassigned_issues .unassigned_issues_scraper import (
3919 unassigned_issues_activity_json ,
4020)
@@ -46,31 +26,6 @@ def get_index():
4626 return None
4727
4828
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-
7429urlpatterns = [
7530 distill_url (
7631 r'^$' , HomePageView .as_view (),
@@ -120,78 +75,6 @@ def get_organization():
12075 distill_func = get_index ,
12176 distill_file = 'static/inactive-issues.json' ,
12277 ),
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- ),
19578 distill_url (
19679 r'static/unassigned-issues.json' , unassigned_issues_activity_json ,
19780 name = 'unassigned_issues_activity_json' ,
@@ -204,4 +87,5 @@ def get_organization():
20487 distill_func = get_index ,
20588 distill_file = 'gamification/index.html' ,
20689 ),
90+ url (r'openhub/' , include ('openhub.urls' ))
20791] + static (settings .MEDIA_URL , document_root = settings .MEDIA_ROOT )
0 commit comments