X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ff382f6c37063c0c4c5d21c2834a8759e25c5d02..55e6abd52da631d0a36ed13e12f5e1dfb2af0d92:/src/api/serializers.py diff --git a/src/api/serializers.py b/src/api/serializers.py index f2c22d4d4..dae587c84 100644 --- a/src/api/serializers.py +++ b/src/api/serializers.py @@ -1,12 +1,10 @@ -# -*- coding: utf-8 -*- -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.contrib.auth.models import User from rest_framework import serializers -from .fields import UserPremiumField, AbsoluteURLField, ThumbnailField +from .fields import UserPremiumField from .models import BookUserData -from migdal.models import Entry, Photo class PlainSerializer(serializers.ModelSerializer): @@ -29,22 +27,6 @@ class BookUserDataSerializer(serializers.ModelSerializer): fields = ['state'] -class BlogGalleryUrlSerializer(PlainSerializer): - class Meta: - model = Photo - fields = ['image'] - - -class BlogSerializer(serializers.ModelSerializer): - url = AbsoluteURLField() - image_url = serializers.FileField(source='image') - image_thumb = ThumbnailField('193x193', source='image') - key = serializers.DateTimeField(source='first_published_at') - gallery_urls = BlogGalleryUrlSerializer(many=True, source='photo_set') - body = serializers.CharField() - lead = serializers.CharField() - - class Meta: - model = Entry - fields = ['title', 'lead', 'body', 'place', 'time', 'image_url', 'image_thumb', - 'gallery_urls', 'type', 'key', 'url'] +class LoginSerializer(serializers.Serializer): + username = serializers.CharField() + password = serializers.CharField(style={'input_type': 'password'})