class CategorieNameViewSet(ModelViewSet): def __init__(self): super().__init__() self._searchImages = SearchImages() self._databse = "PhotoExplorer" self._collection = "categorieName" def list(self, request): links = self._searchImages.FindMany(self._databse, self._collection) return Response({"response": links}, status=status.HTTP_201_CREATED)
class ProductsSpecialsViewset(ModelViewSet): def __init__(self): super().__init__() self._searchImages = SearchImages() self._database = "PhotoExplorer" self._collection = "productSpecial" def listing(self, request): listingProduct = self._searchImages.FindMany(self._database, self._collection) return Response({"response": listingProduct}, status=status.HTTP_201_CREATED)
class SlideViewset(ModelViewSet): def __init__(self): super().__init__() self._searchImages = SearchImages() self._database = "PhotoExplorer" self._collection = "Slide" def list(self, request): links = self._searchImages.FindMany(self._database, self._collection) return Response({'response': links}, status = status.HTTP_200_OK)