1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-22 23:42:25 +00:00
This commit is contained in:
Yohann D'ANELLO 2020-03-27 00:40:35 +01:00
parent 841d56d5b3
commit 213e5a8369
4 changed files with 16 additions and 18 deletions

View File

@ -6,10 +6,11 @@ from django.urls import path
from . import views
app_name = 'activity'
urlpatterns = [
path('', views.ActivityListView.as_view(),name='activity_list'),
path('<int:pk>/', views.ActivityDetailView.as_view(),name='activity_detail'),
path('<int:pk>/entry/', views.ActivityEntryView.as_view(),name='activity_entry'),
path('<int:pk>/update/', views.ActivityUpdateView.as_view(),name='activity_update'),
path('new/', views.ActivityCreateView.as_view(),name='activity_create'),
path('', views.ActivityListView.as_view(), name='activity_list'),
path('<int:pk>/', views.ActivityDetailView.as_view(), name='activity_detail'),
path('<int:pk>/entry/', views.ActivityEntryView.as_view(), name='activity_entry'),
path('<int:pk>/update/', views.ActivityUpdateView.as_view(), name='activity_update'),
path('new/', views.ActivityCreateView.as_view(), name='activity_create'),
]

View File

@ -1,33 +1,31 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from dal import autocomplete
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.views.generic import CreateView, DetailView,\
ListView, UpdateView, TemplateView
from django.views.generic import CreateView, DetailView, UpdateView, TemplateView
from django_tables2.views import SingleTableView
from .models import Activity, ActivityType
from .models import Activity
class ActivityCreateView(CreateView):
model = Activity
template_name = 'activity_create.html'
class ActivityListView(SingleTableView):
model = Activity
template_name = 'activity_list.html'
class ActivityDetailView(DetailView):
model = Activity
template_name = 'activty_detail.html'
class ActivityUpdateView(UpdateView):
model = Activity
template_name = 'activity_update.html'
class ActivityEntryView(TemplateView):
pass

View File

@ -336,7 +336,7 @@ class ClubCreateView(LoginRequiredMixin, CreateView):
def form_valid(self, form):
return super().form_valid(form)
class ClubListView(LoginRequiredMixin, SingleTableView):
"""

View File

@ -23,7 +23,6 @@ urlpatterns = [
path('i18n/', include('django.conf.urls.i18n')),
path('admin/doc/', include('django.contrib.admindocs.urls')),
path('admin/', admin.site.urls),
path('accounts/', include('member.urls')),
path('accounts/login/', CustomLoginView.as_view()),
path('accounts/', include('django.contrib.auth.urls')),
path('api/', include('api.urls')),