Misc urlconf files

This commit is contained in:
Ludovic Stephan 2019-04-12 17:07:03 +02:00
parent 271732f40d
commit 8fc6f96324
3 changed files with 32 additions and 44 deletions

View file

@ -37,11 +37,6 @@ def export(qs, fields=None):
def admin_list_export(
request, model_name, app_label, queryset=None, fields=None, list_display=True
):
"""
Put the following line in your urls.py BEFORE your admin include
(r'^admin/(?P<app_label>[\d\w]+)/(?P<model_name>[\d\w]+)/csv/',
'util.csv_view.admin_list_export'),
"""
if not request.user.is_staff:
return HttpResponseForbidden()
if not queryset:

View file

@ -1,51 +1,44 @@
from django.conf.urls import url
from django.urls import path
from gestioncof import views
from gestioncof.decorators import buro_required
export_patterns = [
url(r"^members$", views.export_members, name="cof.membres_export"),
url(
r"^mega/avecremarques$",
path("members", views.export_members, name="cof.membres_export"),
path(
"mega/avecremarques",
views.export_mega_remarksonly,
name="cof.mega_export_remarks",
),
url(
r"^mega/participants$",
path(
"mega/participants",
views.export_mega_participants,
name="cof.mega_export_participants",
),
url(r"^mega/orgas$", views.export_mega_orgas, name="cof.mega_export_orgas"),
# url(r'^mega/(?P<type>.+)$', views.export_mega_bytype),
url(r"^mega$", views.export_mega, name="cof.mega_export"),
path("mega/orgas", views.export_mega_orgas, name="cof.mega_export_orgas"),
# path(r'^mega/(?P<type>.+)$', views.export_mega_bytype),
path("mega", views.export_mega, name="cof.mega_export"),
]
surveys_patterns = [
url(
r"^(?P<survey_id>\d+)/status$",
views.survey_status,
name="survey.details.status",
),
url(r"^(?P<survey_id>\d+)$", views.survey, name="survey.details"),
path("<int:survey_id>/status", views.survey_status, name="survey.details.status"),
path("<int:survey_id>", views.survey, name="survey.details"),
]
events_patterns = [
url(r"^(?P<event_id>\d+)$", views.event, name="event.details"),
url(r"^(?P<event_id>\d+)/status$", views.event_status, name="event.details.status"),
path("<int:event_id>", views.event, name="event.details"),
path("<int:event_id>/status", views.event_status, name="event.details.status"),
]
calendar_patterns = [
url(r"^subscription$", views.calendar, name="calendar"),
url(
r"^(?P<token>[a-z0-9-]+)/calendar.ics$", views.calendar_ics, name="calendar.ics"
),
path("subscription", views.calendar, name="calendar"),
path("<slug:token>/calendar.ics", views.calendar_ics, name="calendar.ics"),
]
clubs_patterns = [
url(r"^membres/(?P<name>\w+)", views.membres_club, name="membres-club"),
url(r"^liste", views.liste_clubs, name="liste-clubs"),
url(
r"^change_respo/(?P<club_name>\w+)/(?P<user_id>\d+)",
path("membres/<slug:name>", views.membres_club, name="membres-club"),
path("liste", views.liste_clubs, name="liste-clubs"),
path(
"change_respo/<slug:club_name>/<int:user_id>",
views.change_respo,
name="change-respo",
),

View file

@ -1,35 +1,35 @@
from django.conf.urls import url
from django.urls import path
from gestioncof.decorators import buro_required
from petitscours import views
from petitscours.views import DemandeDetailView, DemandeListView
urlpatterns = [
url(r"^inscription$", views.inscription, name="petits-cours-inscription"),
url(r"^demande$", views.demande, name="petits-cours-demande"),
url(
r"^demande-raw$",
path("inscription", views.inscription, name="petits-cours-inscription"),
path("demande", views.demande, name="petits-cours-demande"),
path(
"demande-raw",
views.demande,
kwargs={"raw": True},
name="petits-cours-demande-raw",
),
url(
r"^demandes$",
path(
"demandes",
buro_required(DemandeListView.as_view()),
name="petits-cours-demandes-list",
),
url(
r"^demandes/(?P<pk>\d+)$",
path(
"demandes/<int:pk>",
buro_required(DemandeDetailView.as_view()),
name="petits-cours-demande-details",
),
url(
r"^demandes/(?P<demande_id>\d+)/traitement$",
path(
"demandes/<int:demande_id>/traitement",
views.traitement,
name="petits-cours-demande-traitement",
),
url(
r"^demandes/(?P<demande_id>\d+)/retraitement$",
path(
"demandes/<int:demande_id>/retraitement",
views.traitement,
kwargs={"redo": True},
name="petits-cours-demande-retraitement",