Re: Dajgo Validation error

2020-01-09 Thread Suraj Thapa FC
Use try catch and send whatever response you want to send On Wed, 8 Jan 2020, 10:36 pm Soumen Khatua, wrote: > > *seriazlizers.py* > > > > > > > *email = > serializers.EmailField(required=True,validators=[UniqueValidator(queryset=User.objects.all())]) > phone_number = serializers.CharFiel

Re: Dajgo Validation error

2020-01-08 Thread Soumen Khatua
*seriazlizers.py* *email = serializers.EmailField(required=True,validators=[UniqueValidator(queryset=User.objects.all())]) phone_number = serializers.CharField(required = True,validators=[UniqueValidator(queryset=User.objects.all())])password = serializers.CharField(write_only=True,

Re: Dajgo Validation error

2020-01-08 Thread Suraj Thapa FC
For email you can set email field in model as unique=True and the password should be stored in hash.. On Wed, 8 Jan 2020, 9:37 pm Soumen Khatua, wrote: > Hi Folk, > > What is the process to validate fields in django rest framework? > like email and phone number should be unique and password sho

Dajgo Validation error

2020-01-08 Thread Soumen Khatua
Hi Folk, What is the process to validate fields in django rest framework? like email and phone number should be unique and password should be alphanumeric character only. Where i need to write the logic inside serializers or views part and how i can do that? Thank you in advance Regards, Soumen