Re: using single view function or class for multiple types of users

2019-06-06 Thread Harsh Gundecha
the user type. It will work. > > I hope it helps :) > > Cheers! > > > On Monday, June 3, 2019 at 4:04:53 PM UTC+5:30, Harsh Gundecha wrote: >> >> what is recommended practice for serving same object to multiple types of >> users with slight change in output

using single view function or class for multiple types of users

2019-06-03 Thread Harsh Gundecha
what is recommended practice for serving same object to multiple types of users with slight change in output for e.g book object or issued book object to lets say staff and students, is it a good idea to use same URL for both and serve by checking user type PS: its a JSON based rest API in rest f

Re: Single place for validation

2019-06-03 Thread Harsh Gundecha
//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 learning django and i have query as following >> is it that we have to put validators in both the mod

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