Merge branch 'Kerl/deprec' into 'master'

Réécrit les urls

En accord avec
https://docs.djangoproject.com/en/1.9/releases/1.8/#passing-a-string-as-view-to-url

See merge request !66
This commit is contained in:
Martin Pepin 2016-07-30 00:29:12 +02:00
commit 7be3306a80
4 changed files with 62 additions and 60 deletions

View file

@ -4,32 +4,32 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.conf.urls import url, patterns
from django.conf.urls import url
from bda.views import SpectacleListView
from bda import views
urlpatterns = patterns(
'',
urlpatterns = [
url(r'^inscription/(?P<tirage_id>\d+)$',
'bda.views.inscription',
views.inscription,
name='bda-tirage-inscription'),
url(r'^places/(?P<tirage_id>\d+)$',
'bda.views.places',
views.places,
name="bda-places-attribuees"),
url(r'^revente/(?P<tirage_id>\d+)$',
'bda.views.revente',
views.revente,
name='bda-revente'),
url(r'^etat-places/(?P<tirage_id>\d+)$',
'bda.views.etat_places',
views.etat_places,
name='bda-etat-places'),
url(r'^tirage/(?P<tirage_id>\d+)$', 'bda.views.tirage'),
url(r'^tirage/(?P<tirage_id>\d+)$', views.tirage),
url(r'^spectacles/(?P<tirage_id>\d+)$',
SpectacleListView.as_view(),
name="bda-liste-spectacles"),
url(r'^spectacles/(?P<tirage_id>\d+)/(?P<spectacle_id>\d+)$',
"bda.views.spectacle",
views.spectacle,
name="bda-spectacle"),
url(r'^spectacles/unpaid/(?P<tirage_id>\d+)$',
"bda.views.unpaid",
views.unpaid,
name="bda-unpaid"),
url(r'^mails-rappel/(?P<spectacle_id>\d+)$', "bda.views.send_rappel"),
)
url(r'^mails-rappel/(?P<spectacle_id>\d+)$', views.send_rappel),
]

View file

@ -5,23 +5,27 @@ from __future__ import print_function
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic.base import TemplateView
import autocomplete_light
from django.contrib.auth import views as django_views
from django_cas_ng import views as django_cas_views
from gestioncof import views as gestioncof_views, csv_views
from gestioncof.urls import export_patterns, petitcours_patterns, \
surveys_patterns, events_patterns, calendar_patterns
from gestioncof.autocomplete import autocomplete
autocomplete_light.autodiscover()
admin.autodiscover()
urlpatterns = patterns(
'',
urlpatterns = [
# Page d'accueil
url(r'^$', 'gestioncof.views.home', name='home'),
url(r'^$', gestioncof_views.home, name='home'),
# Le BdA
url(r'^bda/', include('bda.urls')),
# Les exports
@ -37,47 +41,44 @@ urlpatterns = patterns(
# Authentification
url(r'^cof/denied$', TemplateView.as_view(template_name='cof-denied.html'),
name="cof-denied"),
url(r'^cas/login$', 'django_cas_ng.views.login', name="cas_login_view"),
url(r'^cas/logout$', 'django_cas_ng.views.logout'),
url(r'^outsider/login$', 'gestioncof.views.login_ext'),
url(r'^outsider/logout$', 'django.contrib.auth.views.logout',
{'next_page': 'home'}),
url(r'^login$', 'gestioncof.views.login'),
url(r'^logout$', 'gestioncof.views.logout'),
url(r'^cas/login$', django_cas_views.login, name="cas_login_view"),
url(r'^cas/logout$', django_cas_views.logout),
url(r'^outsider/login$', gestioncof_views.login_ext),
url(r'^outsider/logout$', django_views.logout, {'next_page': 'home'}),
url(r'^login$', gestioncof_views.login),
url(r'^logout$', gestioncof_views.logout),
# Infos persos
url(r'^profile$', 'gestioncof.views.profile'),
url(r'^outsider/password-change$',
'django.contrib.auth.views.password_change'),
url(r'^profile$', gestioncof_views.profile),
url(r'^outsider/password-change$', django_views.password_change),
url(r'^outsider/password-change-done$',
'django.contrib.auth.views.password_change_done',
django_views.password_change_done,
name='password_change_done'),
# Inscription d'un nouveau membre
url(r'^registration$', 'gestioncof.views.registration'),
url(r'^registration$', gestioncof_views.registration),
url(r'^registration/clipper/(?P<login_clipper>[\w-]+)$',
'gestioncof.views.registration_form2', name="clipper-registration"),
gestioncof_views.registration_form2, name="clipper-registration"),
url(r'^registration/user/(?P<username>.+)$',
'gestioncof.views.registration_form2', name="user-registration"),
url(r'^registration/empty$', 'gestioncof.views.registration_form2',
gestioncof_views.registration_form2, name="user-registration"),
url(r'^registration/empty$', gestioncof_views.registration_form2,
name="empty-registration"),
# Autocompletion
url(r'^autocomplete/registration$',
'gestioncof.autocomplete.autocomplete'),
url(r'^autocomplete/registration$', autocomplete),
url(r'^autocomplete/', include('autocomplete_light.urls')),
# Interface admin
url(r'^admin/logout/', 'gestioncof.views.logout'),
url(r'^admin/logout/', gestioncof_views.logout),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/(?P<app_label>[\d\w]+)/(?P<model_name>[\d\w]+)/csv/',
'gestioncof.csv_views.admin_list_export',
csv_views.admin_list_export,
{'fields': ['username', ]}),
url(r'^admin/', include(admin.site.urls)),
url(r'^grappelli/', include('grappelli.urls')),
# Liens utiles du COF et du BdA
url(r'^utile_cof$', 'gestioncof.views.utile_cof'),
url(r'^utile_bda$', 'gestioncof.views.utile_bda'),
url(r'^utile_bda/bda_diff$', 'gestioncof.views.liste_bdadiff'),
url(r'^utile_cof/diff_cof$', 'gestioncof.views.liste_diffcof'),
url(r'^utile_bda/bda_revente$', 'gestioncof.views.liste_bdarevente'),
) + \
url(r'^utile_cof$', gestioncof_views.utile_cof),
url(r'^utile_bda$', gestioncof_views.utile_bda),
url(r'^utile_bda/bda_diff$', gestioncof_views.liste_bdadiff),
url(r'^utile_cof/diff_cof$', gestioncof_views.liste_diffcof),
url(r'^utile_bda/bda_revente$', gestioncof_views.liste_bdarevente),
] + \
(static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if settings.DEBUG
else [])

View file

@ -6,44 +6,45 @@ from __future__ import unicode_literals
from django.conf.urls import url
from gestioncof.petits_cours_views import DemandeListView
from gestioncof import views, petits_cours_views
export_patterns = [
url(r'^members$', 'gestioncof.views.export_members'),
url(r'^mega/avecremarques$', 'gestioncof.views.export_mega_remarksonly'),
url(r'^mega/participants$', 'gestioncof.views.export_mega_participants'),
url(r'^mega/orgas$', 'gestioncof.views.export_mega_orgas'),
url(r'^mega/(?P<type>.+)$', 'gestioncof.views.export_mega_bytype'),
url(r'^mega$', 'gestioncof.views.export_mega'),
url(r'^members$', views.export_members),
url(r'^mega/avecremarques$', views.export_mega_remarksonly),
url(r'^mega/participants$', views.export_mega_participants),
url(r'^mega/orgas$', views.export_mega_orgas),
url(r'^mega/(?P<type>.+)$', views.export_mega_bytype),
url(r'^mega$', views.export_mega),
]
petitcours_patterns = [
url(r'^inscription$', 'gestioncof.petits_cours_views.inscription',
url(r'^inscription$', petits_cours_views.inscription,
name='petits-cours-inscription'),
url(r'^demande$', 'gestioncof.petits_cours_views.demande',
url(r'^demande$', petits_cours_views.demande,
name='petits-cours-demande'),
url(r'^demande-raw$', 'gestioncof.petits_cours_views.demande_raw',
url(r'^demande-raw$', petits_cours_views.demande_raw,
name='petits-cours-demande-raw'),
url(r'^demandes$', DemandeListView.as_view(),
name='petits-cours-demandes-list'),
url(r'^demandes/(?P<demande_id>\d+)$',
'gestioncof.petits_cours_views.details',
petits_cours_views.details,
name='petits-cours-demande-details'),
url(r'^demandes/(?P<demande_id>\d+)/traitement$',
'gestioncof.petits_cours_views.traitement',
petits_cours_views.traitement,
name='petits-cours-demande-traitement'),
url(r'^demandes/(?P<demande_id>\d+)/retraitement$',
'gestioncof.petits_cours_views.retraitement',
petits_cours_views.retraitement,
name='petits-cours-demande-retraitement'),
]
surveys_patterns = [
url(r'^(?P<survey_id>\d+)/status$', 'gestioncof.views.survey_status'),
url(r'^(?P<survey_id>\d+)$', 'gestioncof.views.survey'),
url(r'^(?P<survey_id>\d+)/status$', views.survey_status),
url(r'^(?P<survey_id>\d+)$', views.survey),
]
events_patterns = [
url(r'^(?P<event_id>\d+)$', 'gestioncof.views.event'),
url(r'^(?P<event_id>\d+)/status$', 'gestioncof.views.event_status'),
url(r'^(?P<event_id>\d+)$', views.event),
url(r'^(?P<event_id>\d+)/status$', views.event_status),
]
calendar_patterns = [

View file

@ -1,12 +1,12 @@
configparser==3.5.0
Django==1.8.13
Django==1.8
django-autocomplete-light==2.3.3
django-autoslug==1.8.0
django-autoslug==1.9.3
django-cas-ng==3.5.4
django-grappelli==2.8.1
django-recaptcha==1.0.5
mysqlclient==1.3.7
Pillow==2.9.0
Pillow==3.3.0
simplejson==3.8.2
six==1.10.0
unicodecsv==0.14.1