Browse Source

first steps towards an csv export view

master
Benni Baermann 4 years ago
parent
commit
89bd3b0de6
2 changed files with 7 additions and 1 deletions
  1. +2
    -1
      input/urls.py
  2. +5
    -0
      input/views.py

+ 2
- 1
input/urls.py View File

@ -1,11 +1,12 @@
from django.urls import path from django.urls import path
from .views import ExternView, done, authorize, deny, InternView
from .views import ExternView, done, authorize, deny, InternView, export
urlpatterns = [ urlpatterns = [
path('', ExternView.as_view(), name='extern'), path('', ExternView.as_view(), name='extern'),
path('intern', InternView.as_view(), name='intern'), path('intern', InternView.as_view(), name='intern'),
path('saved', done, name='done'), path('saved', done, name='done'),
path('export', export, name='export'),
path('authorize/<str:choice>/<int:pk>', authorize, name='authorize'), path('authorize/<str:choice>/<int:pk>', authorize, name='authorize'),
path('deny/<str:choice>/<int:pk>', deny, name='deny') path('deny/<str:choice>/<int:pk>', deny, name='deny')
] ]

+ 5
- 0
input/views.py View File

@ -30,6 +30,11 @@ def auth_deny(choice,pk,auth):
return HttpResponse(f'ERROR! UNKNWON CHOICE TYPE! {choice}') return HttpResponse(f'ERROR! UNKNWON CHOICE TYPE! {choice}')
return False return False
@login_required
def export(request):
'''export the project database to a csv'''
return HttpResponse('WE WANT CSV!')
@login_required @login_required
def authorize(request, choice, pk): def authorize(request, choice, pk):
'''If IF grant a support they click a link in a mail which leads here. '''If IF grant a support they click a link in a mail which leads here.

Loading…
Cancel
Save