pos client & quota limit organization blank
This commit is contained in:
46
apps/pos_device/web/api/v1/serilaizers/serializers.py
Normal file
46
apps/pos_device/web/api/v1/serilaizers/serializers.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from rest_framework.serializers import ModelSerializer
|
||||
from apps.pos_device import models as pos_models
|
||||
|
||||
|
||||
class ProviderCompanySerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = pos_models.ProviderCompany
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class DeviceSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = pos_models.Device
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class DeviceVersionSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = pos_models.DeviceVersion
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class SessionSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = pos_models.Sessions
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class POSClientSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = pos_models.POSClient
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class POSClientAttributeSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = pos_models.POSClientAttribute
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class POSClientAttributeValueSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = pos_models.POSClientAttributeValue
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from django.urls import path, include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
router = DefaultRouter()
|
||||
|
||||
urlpatterns = [
|
||||
path('v1/pos/', include(router.urls))
|
||||
]
|
||||
40
apps/pos_device/web/api/v1/viewsets/api.py
Normal file
40
apps/pos_device/web/api/v1/viewsets/api.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from apps.pos_device.web.api.v1.serilaizers import serializers as pos_serializer
|
||||
from apps.pos_device import models as pos_models
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.response import Response
|
||||
from rest_framework import status
|
||||
|
||||
|
||||
class ProviderCompanyViewSet(viewsets.ModelViewSet): # noqa
|
||||
queryset = pos_models.ProviderCompany.objects.all()
|
||||
serializer_class = pos_serializer.ProviderCompanySerializer
|
||||
|
||||
|
||||
class DeviceViewSet(viewsets.ModelViewSet):
|
||||
queryset = pos_models.Device.objects.all()
|
||||
serializer_class = pos_serializer.DeviceSerializer
|
||||
|
||||
|
||||
class DeviceVersionViewSet(viewsets.ModelViewSet):
|
||||
queryset = pos_models.DeviceVersion.objects.all()
|
||||
serializer_class = pos_serializer.DeviceVersionSerializer
|
||||
|
||||
|
||||
class SessionViewSet(viewsets.ModelViewSet): # noqa
|
||||
queryset = pos_models.Sessions.objects.all()
|
||||
serializer_class = pos_serializer.SessionSerializer
|
||||
|
||||
|
||||
class POSClientViewSet(viewsets.ModelViewSet):
|
||||
queryset = pos_models.POSClient.objects.all()
|
||||
serializer_class = pos_serializer.POSClientSerializer
|
||||
|
||||
|
||||
class POSClientAttributeViewSet(viewsets.ModelViewSet):
|
||||
queryset = pos_models.POSClientAttribute.objects.all()
|
||||
serializer_class = pos_serializer.POSClientAttributeSerializer
|
||||
|
||||
|
||||
class POSClientAttributeValueViewSet(viewsets.ModelViewSet):
|
||||
queryset = pos_models.POSClientAttributeValue.objects.all()
|
||||
serializer_class = pos_serializer.POSClientAttributeValueSerializer
|
||||
Reference in New Issue
Block a user