# Path: backend/api/serializers/photo.py
# class PhotoSerializer(HyperlinkedModelSerializer):
#     image = MyImageField()
# 
#     class Meta:
#         model = Photo
#         fields = ('name', 'slug', 'image')


from ..serializers import PhotoSerializer
from rest_framework.viewsets import ModelViewSet
from photos.models import Photo


class PhotoViewSet(ModelViewSet):
    serializer_class = PhotoSerializer
    queryset = Photo.objects.filter(is_enabled=True)

# Path: backend/api/serializers/photo.py
# class PhotoSerializer(HyperlinkedModelSerializer):
#     image = MyImageField()
# 
#     class Meta:
#         model = Photo
#         fields = ('name', 'slug', 'image')


# Path: backend/api/viewsets/photo.py
from ..serializers import PhotoSerializer
from rest_framework.viewsets import ModelViewSet
from photos.models import Photo



class PhotoViewSet(ModelViewSet):
    serializer_class = PhotoSerializer
    queryset = Photo.objects.filter(is_enabled=True)

    lookup_field = 'slug'