Hi, an approach that comes to mind would be defining validation in the model and using model forms[1] for the user site.
HTH [1] https://docs.djangoproject.com/en/2.2/topics/forms/modelforms/ Missatge de Harsh Gundecha <[email protected]> del dia dl., 27 de maig 2019 a les 16:20: > hello, > i am currently learning django and i have query as following > is it that we have to put validators in both the model definition and > form validation to apply validation to both admin and user site ? > i tired on reusing a form class assuming that the validator there would > apply on both user and admin site but it didnt happen. > > > in short, > i would like to define validation at one place and get them applied on > both user and admin site > > Thank you > Regards, Harsh > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/8a5280cf-d52b-4a7d-8e21-0d18a741f02a%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/8a5280cf-d52b-4a7d-8e21-0d18a741f02a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMDYoXY3ae8SYD8PBfxNEnPLsAuPB90V%2BFA434p1iAR8Rx0r1Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

