
from django.contrib.auth.models import User
from .models import *
from rest_framework import serializers 


class ExitSerializer(serializers.ModelSerializer):
    class Meta:
        model = Exit
        fields = '__all__'


class EntrySerializer(serializers.ModelSerializer):
    class Meta:
        model = Entry
        fields = '__all__'


class StoreSerializer(serializers.ModelSerializer):

    actual_people = serializers.ReadOnlyField()
    is_full = serializers.ReadOnlyField()

    class Meta:
        model = Store
        fields = '__all__'

class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ('email','username', 'password')
        extra_kwargs = {'password': {'write_only': True}}

    def create(self, validated_data):
        password = validated_data.pop('password')
        user = User(**validated_data)
        user.set_password(password)
        user.save()
        return user

93bf0404a56e223d2509227ee375d5a04bf00004
<mask token>


class UserSerializer(serializers.ModelSerializer):


    class Meta:
        model = User
        fields = 'email', 'username', 'password'
        extra_kwargs = {'password': {'write_only': True}}

    def create(self, validated_data):
        password = validated_data.pop('password')
        user = User(**validated_data)
        user.set_password(password)
        user.save()
        return user

<mask token>


class StoreSerializer(serializers.ModelSerializer):
    <mask token>
    <mask token>


    class Meta:
        model = Store
        fields = '__all__'


class UserSerializer(serializers.ModelSerializer):


    class Meta:
        model = User
        fields = 'email', 'username', 'password'
        extra_kwargs = {'password': {'write_only': True}}

    def create(self, validated_data):
        password = validated_data.pop('password')
        user = User(**validated_data)
        user.set_password(password)
        user.save()
        return user

<mask token>


class ExitSerializer(serializers.ModelSerializer):


    class Meta:
        model = Exit
        fields = '__all__'


class EntrySerializer(serializers.ModelSerializer):


    class Meta:
        model = Entry
        fields = '__all__'


class StoreSerializer(serializers.ModelSerializer):
    actual_people = serializers.ReadOnlyField()
    is_full = serializers.ReadOnlyField()


    class Meta:
        model = Store
        fields = '__all__'


class UserSerializer(serializers.ModelSerializer):


    class Meta:
        model = User
        fields = 'email', 'username', 'password'
        extra_kwargs = {'password': {'write_only': True}}

    def create(self, validated_data):
        password = validated_data.pop('password')
        user = User(**validated_data)
        user.set_password(password)
        user.save()
        return user

from django.contrib.auth.models import User
from .models import *
from rest_framework import serializers


class ExitSerializer(serializers.ModelSerializer):


    class Meta:
        model = Exit
        fields = '__all__'


class EntrySerializer(serializers.ModelSerializer):


    class Meta:
        model = Entry
        fields = '__all__'


class StoreSerializer(serializers.ModelSerializer):
    actual_people = serializers.ReadOnlyField()
    is_full = serializers.ReadOnlyField()


    class Meta:
        model = Store
        fields = '__all__'


class UserSerializer(serializers.ModelSerializer):


    class Meta:
        model = User
        fields = 'email', 'username', 'password'
        extra_kwargs = {'password': {'write_only': True}}

    def create(self, validated_data):
        password = validated_data.pop('password')
        user = User(**validated_data)
        user.set_password(password)
        user.save()
        return user


from django.contrib.auth.models import User
from .models import *
from rest_framework import serializers 


class ExitSerializer(serializers.ModelSerializer):
    class Meta:
        model = Exit
        fields = '__all__'


class EntrySerializer(serializers.ModelSerializer):
    class Meta:
        model = Entry
        fields = '__all__'


class StoreSerializer(serializers.ModelSerializer):

    actual_people = serializers.ReadOnlyField()
    is_full = serializers.ReadOnlyField()

    class Meta:
        model = Store
        fields = '__all__'

class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ('email','username', 'password')
        extra_kwargs = {'password': {'write_only': True}}

    def create(self, validated_data):
        password = validated_data.pop('password')
        user = User(**validated_data)
        user.set_password(password)
        user.save()
        return user
