|
@@ -1,11 +1,28 @@
|
|
|
# Create your views here.
|
|
|
from rest_framework.viewsets import ModelViewSet
|
|
|
-from background.serializers import ProductInfoSerializer
|
|
|
-from background.models import ProductInfo
|
|
|
-from rest_framework import filters
|
|
|
+from background.serializers import ProductInfoSerializer, VideoInSerializer, QuickStartInfoSerializer, \
|
|
|
+ UpgradeFirmwareInfoSerializer
|
|
|
+from background.models import ProductInfo, VideoInfo, QuickStartInfo, UpgradeFirmwareInfo
|
|
|
|
|
|
|
|
|
class ProductInfoSet(ModelViewSet):
|
|
|
queryset = ProductInfo.objects.all()
|
|
|
serializer_class = ProductInfoSerializer
|
|
|
- filterset_fields = ['id', 'product_name', 'icon_url']
|
|
|
+
|
|
|
+
|
|
|
+class VideoInfoSet(ModelViewSet):
|
|
|
+ queryset = VideoInfo.objects.all()
|
|
|
+ serializer_class = VideoInSerializer
|
|
|
+ filterset_fields = ['id', 'product_info_id', 'title']
|
|
|
+
|
|
|
+
|
|
|
+class QuickStartInfoSet(ModelViewSet):
|
|
|
+ queryset = QuickStartInfo.objects.all()
|
|
|
+ serializer_class = QuickStartInfoSerializer
|
|
|
+ filterset_fields = ['id', 'product_info_id', 'title']
|
|
|
+
|
|
|
+
|
|
|
+class UpgradeFirmwareInfoSet(ModelViewSet):
|
|
|
+ queryset = UpgradeFirmwareInfo.objects.all()
|
|
|
+ serializer_class = UpgradeFirmwareInfoSerializer
|
|
|
+ filterset_fields = ['id', 'product_info_id', 'title']
|