Friday, February 25, 2022

Re: How to validate xl data

On Mon, Feb 14, 2022 at 12:04:13PM +0530, Prashanth Patelc wrote:
> i am working on xl sheets , when im uploading the xl sheet it is storing
> into the models but i need before storing into the models validate the data
>
> eg:
> username : ,must be str not int
> reference id : ,must be int not str
> email : ,contains @gmail.com , not strt not int
>
> i need to validate like above

You could use a Python library[1] to parse the Excel file and validate the
sheet values in a validator function[2].

[1] https://www.python-excel.org/
[2] https://docs.djangoproject.com/en/4.0/ref/validators/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20220225222113.GG11627%40fattuba.com.

No comments:

Post a Comment