Example #1
0
class InsertMainProducts(ModelViewSet):
    def __init__(self):
        super().__init__()
        self._insertImage = InsertImages()
        self._database = "PhotoExplorer"
        self._collection = "latestProduct"

    def create(self, request):
        datas = request.data['mainProducts']
        self._insertImage.insert(self._database, self._collection, datas)
        return Response({"status": 201}, status=status.HTTP_201_CREATED)
Example #2
0
class InsertProdutcSpecialsViewset(ModelViewSet):

    serializer_class = ProductSpecialSerializer

    def __init__(self):
        super().__init__()
        self._insertImage = InsertImages()
        self._database = "PhotoExplorer"
        self._collection = "productSpecial"

    def create(self, request):
        datas = request.data
        self._insertImage.insert(self._database, self._collection, datas)
        return Response({"status": 201}, status=status.HTTP_201_CREATED)
Example #3
0
class InsertCategorieNameViewSet(ModelViewSet):

    serializer_class = CategorieNameSerializer

    def __init__(self):
        super().__init__()
        self._insertImages = InsertImages()
        self._database = "PhotoExplorer"
        self._collection = "categorieName"

    def create(self, request):
        self._insertImages.insert(self._database, self._collection,
                                  request.data)
        return Response({"status": 201}, status=status.HTTP_200_OK)
Example #4
0
class CreateImages(ModelViewSet):

    serializer_class = SlidesSerializer

    def __init__(self):
        super().__init__()
        self._insert = InsertImages()
        self._database = "PhotoExplorer"
        self._collection = "Slide"

    def create(self, request):
        slides = request.data['slides']
        self._insert.insert(self._database, self._collection, datas=slides)
        return Response({"response": "created"},
                        status=status.HTTP_201_CREATED)
Example #5
0
 def __init__(self):
     super().__init__()
     self._insertImage = InsertImages()
     self._database = "PhotoExplorer"
     self._collection = "latestProduct"
Example #6
0
 def __init__(self):
     super().__init__()
     self._insertImages = InsertImages()
     self._database = "PhotoExplorer"
     self._collection = "categorieName"
Example #7
0
 def __init__(self):
     super().__init__()
     self._insert = InsertImages()
     self._database = "PhotoExplorer"
     self._collection = "Slide"