Re: Single place for validation

2019-06-03 Thread Harsh Gundecha
yes i did the same, and got it working Thank you On Tuesday, May 28, 2019 at 1:56:06 AM UTC+5:30, Alexis wrote: > > 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

Re: Single place for validation

2019-05-27 Thread Alexis Roda
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 del dia dl., 27 de maig 2019 a les 16:20: > hello, > i am currently learni

Re: Single place for validation

2019-05-27 Thread Chetan Ganji
If you have customized the forms for the user facing website, you have to specify the same forms in the class extended by admin.ModelAdmin. Below answer is what you are looking for. https://stackoverflow.com/questions/6321916/different-fields-for-add-and-change-pages-in-admin Regards, Chetan Gan

Single place for validation

2019-05-27 Thread Harsh Gundecha
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 a