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

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

2019-06-04 Thread Chetan Ganji
the user type after perform_update() was called. And return a different response by checking 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

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

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2017-06-18 Thread Victor Hooi
t; > > > > class Student(models.Model): > > user = models.OneToOneField(User, on_delete=models.CASCADE) > > > > class Teacher(models.Model): > > user = models.OneToOneField(User, on_delete=models.CASCADE) > > > > class Parent

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2017-06-14 Thread Victor Hooi
filled in while Student >> must have "date_enrolled". Similarly, you can use group membership to >> determine what information to show. >> Splitting them out in different profiles is a matter of preference and >> optimization, not of design. >> >> > The

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-13 Thread Vineet Kothari
determine what information to show. > Splitting them out in different profiles is a matter of preference and > optimization, not of design. > > > The docs mention using a django.db.models.signals.post_save > > <https://docs.djangoproject.com/en/1.10/ref/signals/#django.db.mo

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-09 Thread Melvyn Sopacua
ect.com/en/1.10/ref/signals/#django.db.models. > signals.post_save> signal on User, but I'm guessing that won't work > here if you have multiple types of users. When you have multiple *profiles* this will work just fine. It's also not a big problem to solve, because user

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-08 Thread Mike Dewhirst
t; signal on User, but I'm guessing that won't work here if you have multiple types of users. Or are you better off subclassing django.contrib.auth.models.AbstractUser? (I get the impression using profile models is less invasive). Regards, Victor -- You received this message because you

Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-08 Thread Victor Hooi
dels.signals.post_save <https://docs.djangoproject.com/en/1.10/ref/signals/#django.db.models.signals.post_save> signal on User, but I'm guessing that won't work here if you have multiple types of users. Or are you better off subclassing django.contrib.auth.models.AbstractUser? (I get the im

Re: Creating a system with multiple types of users

2008-10-28 Thread itsnotvalid
Any reply yet? I also looked at the profile functionality from auth. Seems that I can only define a single profile for each user. What if I need to have different profiles for different users? On Oct 25, 1:25 am, itsnotvalid <[EMAIL PROTECTED]> wrote: > Is there any posts related to the permissio

Re: Creating a system with multiple types of users

2008-10-24 Thread itsnotvalid
Is there any posts related to the permission system? I didn't looked into that part yet, but seems interesting. Of course groups also seems to solve the problem as well. However I also saw @user_passes_test in the doc. What is the difference or use cases from @user_passes_test and @permission_req

Re: Creating a system with multiple types of users

2008-10-22 Thread felix
perhaps when you create-save the models (Providers, Customers etc.) it adds that User to the appropriate group. but I'm not sure I would use groups. That would make the most sense if there were people with overlapping roles. somebody who is Agent + Provider you could use the permissions system.

Re: Creating a system with multiple types of users

2008-10-21 Thread Mozey
Well, django user auth has groups implemented. "It handles user accounts, groups, permissions and cookie-based user sessions." (http://docs.djangoproject.com/en/dev/topics/auth/? from=olddocs) How can you effectively separate their views. Separate your apps based on their nature, not based on wh

Creating a system with multiple types of users

2008-10-21 Thread itsnotvalid
I am going to help some people making a website that has a few admins, a crowd of service providers (individuals) and customers. There could be agents who invites people to become service providers or customers as well. Looking at the user system provided by django, and as a new programmer to dja

Re: Multiple types of users More options

2007-03-30 Thread Kenneth Gonsalves
On 30-Mar-07, at 8:45 PM, johncock wrote: > We need multiple types of users. Different profiles and different > permission. this has been repeatedly discussed. The auth.user model gives the bare essentials. extending this is up to the individual developer. O course, until model inher

Multiple types of users More options

2007-03-30 Thread johncock
Hi there, I'm evaluating Django for a project and the framework fits in many ways. However on one issue it would be nice with some help to hand-sew the glove: We need multiple types of users. Different profiles and different permission. To be more specific: it is a event site where diff

Re: Multiple types of users

2007-03-26 Thread Russell Keith-Magee
On 3/26/07, Anton Stonor <[EMAIL PROTECTED]> wrote: > > It would be nice if I could model these use types as different user > models, but a hack could of cause be to have one large profile and hide > different fields according to the user type. > > Ideas are welcome. Hi Anton, James Bennett has

Multiple types of users

2007-03-26 Thread Anton Stonor
Hi there, I'm evaluating Django for a project and the framework fits in many ways. However on one issue it would be nice with some help to hand-sew the glove: We need multiple types of users. Different profiles and different permission. To be more specific: it is a event site where diff