city & province list for pos device
This commit is contained in:
@@ -6,6 +6,7 @@ from apps.core.mixins.soft_delete_mixin import SoftDeleteMixin
|
||||
from apps.authentication.models import City, Province
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.permissions import AllowAny
|
||||
from rest_framework import status
|
||||
|
||||
|
||||
@@ -13,6 +14,7 @@ class CityViewSet(ModelViewSet, SoftDeleteMixin): # noqa
|
||||
""" Crud operations for city model """ #
|
||||
queryset = City.objects.all()
|
||||
serializer_class = CitySerializer
|
||||
permission_classes = [AllowAny]
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
""" return list of cities by province """
|
||||
@@ -29,3 +31,4 @@ class ProvinceViewSet(ModelViewSet, SoftDeleteMixin):
|
||||
""" Crud operations for province model """ #
|
||||
queryset = Province.objects.all()
|
||||
serializer_class = ProvinceSerializer
|
||||
permission_classes = [AllowAny]
|
||||
|
||||
Reference in New Issue
Block a user