Move api do aplikace api
This commit is contained in:
parent
dea0ef74e6
commit
4215e32954
14 changed files with 36 additions and 17 deletions
3
api/__init__.py
Normal file
3
api/__init__.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
"""
|
||||||
|
Obsahuje api = autocomplete + export škol.
|
||||||
|
"""
|
5
api/apps.py
Normal file
5
api/apps.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class ApiConfig(AppConfig):
|
||||||
|
name = 'api'
|
0
api/migrations/__init__.py
Normal file
0
api/migrations/__init__.py
Normal file
1
api/tests/__init__.py
Normal file
1
api/tests/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from .test_skola_autocomplete import *
|
19
api/urls.py
Normal file
19
api/urls.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
from django.urls import path
|
||||||
|
from . import views
|
||||||
|
from seminar.utils import org_required
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
# Export škol
|
||||||
|
path('api/export/skoly/', views.exportSkolView, name='export_skoly'),
|
||||||
|
|
||||||
|
|
||||||
|
# Autocomplete
|
||||||
|
path('api/autocomplete/skola/', views.SkolaAutocomplete.as_view(), name='autocomplete_skola'),
|
||||||
|
path('api/autocomplete/resitel/', org_required(views.ResitelAutocomplete.as_view()), name='autocomplete_resitel'),
|
||||||
|
path('api/autocomplete/problem/odevzdatelny', views.OdevzdatelnyProblemAutocomplete.as_view(), name='autocomplete_problem_odevzdatelny'),
|
||||||
|
|
||||||
|
# Ceka na autocomplete v3
|
||||||
|
# path('autocomplete/organizatori/',
|
||||||
|
# org_member_required(views.OrganizatorAutocomplete.as_view()),
|
||||||
|
# name='seminar_autocomplete_organizator')
|
||||||
|
]
|
2
api/views/__init__.py
Normal file
2
api/views/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
from .autocomplete import *
|
||||||
|
from .exports import *
|
|
@ -1,4 +1,5 @@
|
||||||
from dal import autocomplete
|
from django.http import JsonResponse
|
||||||
|
|
||||||
|
|
||||||
class LoginRequiredAjaxMixin(object):
|
class LoginRequiredAjaxMixin(object):
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
|
@ -136,6 +136,7 @@ INSTALLED_APPS = (
|
||||||
'header_fotky',
|
'header_fotky',
|
||||||
'various',
|
'various',
|
||||||
'various.autentizace',
|
'various.autentizace',
|
||||||
|
'api',
|
||||||
|
|
||||||
# Admin upravy:
|
# Admin upravy:
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@ urlpatterns = [
|
||||||
# Autentizační aplikace (ma vlastni podadresare)
|
# Autentizační aplikace (ma vlastni podadresare)
|
||||||
path('', include('various.autentizace.urls')),
|
path('', include('various.autentizace.urls')),
|
||||||
|
|
||||||
|
# Api (ma vlastni podadresare) (autocomplete apod.)
|
||||||
|
path('', include('api.urls')),
|
||||||
|
|
||||||
# Comments (interni i verejne)
|
# Comments (interni i verejne)
|
||||||
path('comments_dj/', include('django_comments.urls')),
|
path('comments_dj/', include('django_comments.urls')),
|
||||||
path('comments_fl/', include('fluent_comments.urls')),
|
path('comments_fl/', include('fluent_comments.urls')),
|
||||||
|
|
|
@ -144,14 +144,6 @@ urlpatterns = [
|
||||||
# Obecný view na profil -- orgům dá rozcestník, řešitelům jejich stránku
|
# Obecný view na profil -- orgům dá rozcestník, řešitelům jejich stránku
|
||||||
path('profil/', views.profilView, name='profil'),
|
path('profil/', views.profilView, name='profil'),
|
||||||
|
|
||||||
# Autocomplete
|
|
||||||
path('api/autocomplete/skola/',views.SkolaAutocomplete.as_view(), name='autocomplete_skola'),
|
|
||||||
path('api/autocomplete/resitel/', org_required(views.ResitelAutocomplete.as_view()), name='autocomplete_resitel'),
|
|
||||||
path('api/autocomplete/problem/odevzdatelny',views.OdevzdatelnyProblemAutocomplete.as_view(), name='autocomplete_problem_odevzdatelny'),
|
|
||||||
|
|
||||||
# Export škol
|
|
||||||
path('api/export/skoly/', views.exportSkolView, name='export_skoly'),
|
|
||||||
|
|
||||||
path('org/add_solution', org_required(views.AddSolutionView.as_view()), name='seminar_vloz_reseni'),
|
path('org/add_solution', org_required(views.AddSolutionView.as_view()), name='seminar_vloz_reseni'),
|
||||||
path('resitel/nahraj_reseni', resitel_required(views.NahrajReseniView.as_view()), name='seminar_nahraj_reseni'),
|
path('resitel/nahraj_reseni', resitel_required(views.NahrajReseniView.as_view()), name='seminar_nahraj_reseni'),
|
||||||
|
|
||||||
|
@ -161,11 +153,6 @@ urlpatterns = [
|
||||||
path('', views.TitulniStranaView.as_view(), name='titulni_strana'),
|
path('', views.TitulniStranaView.as_view(), name='titulni_strana'),
|
||||||
path('jak-resit/', views.JakResitView.as_view(), name='jak_resit'),
|
path('jak-resit/', views.JakResitView.as_view(), name='jak_resit'),
|
||||||
|
|
||||||
# Ceka na autocomplete v3
|
|
||||||
# path('autocomplete/organizatori/',
|
|
||||||
# org_member_required(views.OrganizatorAutocomplete.as_view()),
|
|
||||||
# name='seminar_autocomplete_organizator')
|
|
||||||
|
|
||||||
path('org/reseni/', org_required(views.TabulkaOdevzdanychReseniView.as_view()), name='odevzdavatko_tabulka'),
|
path('org/reseni/', org_required(views.TabulkaOdevzdanychReseniView.as_view()), name='odevzdavatko_tabulka'),
|
||||||
path('org/reseni/rocnik/<int:rocnik>/', org_required(views.TabulkaOdevzdanychReseniView.as_view()), name='odevzdavatko_tabulka'),
|
path('org/reseni/rocnik/<int:rocnik>/', org_required(views.TabulkaOdevzdanychReseniView.as_view()), name='odevzdavatko_tabulka'),
|
||||||
path('org/reseni/<int:problem>/<int:resitel>/', org_required(views.ReseniProblemuView.as_view()), name='odevzdavatko_reseni_resitele_k_problemu'),
|
path('org/reseni/<int:problem>/<int:resitel>/', org_required(views.ReseniProblemuView.as_view()), name='odevzdavatko_reseni_resitele_k_problemu'),
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
from .views_all import *
|
from .views_all import *
|
||||||
from .autocomplete import *
|
|
||||||
from .views_rest import *
|
from .views_rest import *
|
||||||
from .odevzdavatko import *
|
from .odevzdavatko import *
|
||||||
|
|
||||||
from .exports import *
|
|
||||||
|
|
||||||
# Dočsasné views
|
# Dočsasné views
|
||||||
from .docasne import *
|
from .docasne import *
|
||||||
|
|
Loading…
Reference in a new issue