Browse Source

Move api do aplikace api

middleware_test
Jonas Havelka 3 years ago
parent
commit
4215e32954
  1. 3
      api/__init__.py
  2. 5
      api/apps.py
  3. 0
      api/migrations/__init__.py
  4. 1
      api/tests/__init__.py
  5. 0
      api/tests/test_skola_autocomplete.py
  6. 19
      api/urls.py
  7. 2
      api/views/__init__.py
  8. 0
      api/views/autocomplete.py
  9. 0
      api/views/exports.py
  10. 3
      api/views/helpers.py
  11. 1
      mamweb/settings_common.py
  12. 3
      mamweb/urls.py
  13. 13
      seminar/urls.py
  14. 3
      seminar/views/__init__.py

3
api/__init__.py

@ -0,0 +1,3 @@
"""
Obsahuje api = autocomplete + export škol.
"""

5
api/apps.py

@ -0,0 +1,5 @@
from django.apps import AppConfig
class ApiConfig(AppConfig):
name = 'api'

0
api/migrations/__init__.py

1
api/tests/__init__.py

@ -0,0 +1 @@
from .test_skola_autocomplete import *

0
seminar/test_skola_autocomplete.py → api/tests/test_skola_autocomplete.py

19
api/urls.py

@ -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

@ -0,0 +1,2 @@
from .autocomplete import *
from .exports import *

0
seminar/views/autocomplete.py → api/views/autocomplete.py

0
seminar/views/exports.py → api/views/exports.py

3
seminar/views/helpers.py → api/views/helpers.py

@ -1,4 +1,5 @@
from dal import autocomplete
from django.http import JsonResponse
class LoginRequiredAjaxMixin(object):
def dispatch(self, request, *args, **kwargs):

1
mamweb/settings_common.py

@ -136,6 +136,7 @@ INSTALLED_APPS = (
'header_fotky',
'various',
'various.autentizace',
'api',
# Admin upravy:

3
mamweb/urls.py

@ -26,6 +26,9 @@ urlpatterns = [
# Autentizační aplikace (ma vlastni podadresare)
path('', include('various.autentizace.urls')),
# Api (ma vlastni podadresare) (autocomplete apod.)
path('', include('api.urls')),
# Comments (interni i verejne)
path('comments_dj/', include('django_comments.urls')),
path('comments_fl/', include('fluent_comments.urls')),

13
seminar/urls.py

@ -144,14 +144,6 @@ urlpatterns = [
# Obecný view na profil -- orgům dá rozcestník, řešitelům jejich stránku
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('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('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/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'),

3
seminar/views/__init__.py

@ -1,9 +1,6 @@
from .views_all import *
from .autocomplete import *
from .views_rest import *
from .odevzdavatko import *
from .exports import *
# Dočsasné views
from .docasne import *

Loading…
Cancel
Save