mirror of
https://github.com/MarcZierle/photo-log-backend.git
synced 2025-01-04 05:37:58 +00:00
39 lines
1.1 KiB
Python
Executable File
39 lines
1.1 KiB
Python
Executable File
from rest_framework import serializers
|
|
from photo_log.models import PhotoGroup, Photo, PhotoLog
|
|
|
|
|
|
class PhotoGroupSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = PhotoGroup
|
|
fields = ('id', 'name', 'date')
|
|
|
|
|
|
class PhotosSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Photo
|
|
fields = ('id', 'legacy_id', 'group')
|
|
|
|
|
|
class PhotoSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Photo
|
|
fields = ('id', 'legacy_id', 'group', 'bbox_coords', 'rotate', 'intersections', 'original_image', 'cropped_image', 'ocr_text')
|
|
|
|
|
|
class PhotoUpdateSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Photo
|
|
fields = ('id', 'legacy_id', 'group', 'bbox_coords', 'rotate', 'ocr_text')
|
|
|
|
|
|
class PhotoLogSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = PhotoLog
|
|
fields = ('id', 'title', 'date', 'render_date', 'start_slide_image', 'slides', 'pdf')
|
|
|
|
|
|
class PhotoLogsSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = PhotoLog
|
|
fields = ('id', 'title', 'date', 'pdf')
|