Show timetables list
This commit is contained in:
parent
8dad3df4bf
commit
12a339cd1b
|
|
@ -77,3 +77,9 @@ class ScheduleCreateSerializer(ScheduleRUDSerializer):
|
||||||
schedule_qs.delete()
|
schedule_qs.delete()
|
||||||
establishment.schedule.add(instance)
|
establishment.schedule.add(instance)
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
class TimetableSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Timetable
|
||||||
|
fields = '__all__'
|
||||||
|
|
|
||||||
0
apps/timetable/urls/__init__.py
Normal file
0
apps/timetable/urls/__init__.py
Normal file
6
apps/timetable/urls/mobile.py
Normal file
6
apps/timetable/urls/mobile.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
from timetable.urls.common import urlpatterns as common_urlpatterns
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = []
|
||||||
|
|
||||||
|
urlpatterns.extend(common_urlpatterns)
|
||||||
6
apps/timetable/urls/web.py
Normal file
6
apps/timetable/urls/web.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
from timetable.urls.common import urlpatterns as common_urlpatterns
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = []
|
||||||
|
|
||||||
|
urlpatterns.extend(common_urlpatterns)
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from rest_framework import generics
|
from rest_framework import generics, permissions
|
||||||
from timetable import serialziers, models
|
from timetable import serialziers, models
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,3 +6,4 @@ class TimetableListView(generics.ListAPIView):
|
||||||
"""Method to get timetables"""
|
"""Method to get timetables"""
|
||||||
serializer_class = serialziers.TimetableSerializer
|
serializer_class = serialziers.TimetableSerializer
|
||||||
queryset = models.Timetable.objects.all()
|
queryset = models.Timetable.objects.all()
|
||||||
|
permission_classes = (permissions.AllowAny, )
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ app_name = 'mobile'
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('establishments/', include('establishment.urls.mobile')),
|
path('establishments/', include('establishment.urls.mobile')),
|
||||||
path('tags/', include('tag.urls.mobile')),
|
path('tags/', include('tag.urls.mobile')),
|
||||||
|
path('timetables/', include('timetable.urls.mobile')),
|
||||||
# path('account/', include('account.urls.web')),
|
# path('account/', include('account.urls.web')),
|
||||||
# path('advertisement/', include('advertisement.urls.web')),
|
# path('advertisement/', include('advertisement.urls.web')),
|
||||||
# path('collection/', include('collection.urls.web')),
|
# path('collection/', include('collection.urls.web')),
|
||||||
|
|
|
||||||
|
|
@ -34,4 +34,5 @@ urlpatterns = [
|
||||||
path('translation/', include('translation.urls')),
|
path('translation/', include('translation.urls')),
|
||||||
path('comments/', include('comment.urls.web')),
|
path('comments/', include('comment.urls.web')),
|
||||||
path('favorites/', include('favorites.urls')),
|
path('favorites/', include('favorites.urls')),
|
||||||
|
path('timetables/', include('timetable.urls.web')),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user