diff --git a/gestioncof/csv_views.py b/gestioncof/csv_views.py index 2b66d495..3c163091 100644 --- a/gestioncof/csv_views.py +++ b/gestioncof/csv_views.py @@ -37,6 +37,15 @@ 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: + + path( + "admin///csv/", + csv_views.admin_list_export, + {"fields": ["username"]}, + ), + """ if not request.user.is_staff: return HttpResponseForbidden() if not queryset: diff --git a/gestioncof/urls.py b/gestioncof/urls.py index e35f9c32..6a07eac9 100644 --- a/gestioncof/urls.py +++ b/gestioncof/urls.py @@ -15,7 +15,6 @@ export_patterns = [ name="cof.mega_export_participants", ), path("mega/orgas", views.export_mega_orgas, name="cof.mega_export_orgas"), - # path(r'^mega/(?P.+)$', views.export_mega_bytype), path("mega", views.export_mega, name="cof.mega_export"), ] diff --git a/kfet/converters.py b/kfet/converters.py index 4b0842fe..94400587 100644 --- a/kfet/converters.py +++ b/kfet/converters.py @@ -1,3 +1,10 @@ +""" +Les converters sont la méthode "clean" de faire les regex custom dans des URLs django. +Plus d'info dans la doc : +https://docs.djangoproject.com/en/2.2/topics/http/urls/#registering-custom-path-converters +""" + + class TrigrammeConverter: regex = ".{3}"