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_required? On Oct 23, 7:54 am, felix <[EMAIL PROTECTED]> wrote: > 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. again, also saving it to the User at > the time you create the Agent, Provider etc. > > I have a form that creates a Person and optionally creates a User account at > the same time linked to it. you can also create a User (an account) later > for some person who is in the contact database. so I do that action in the > Form. its the form's responsibility (it represents/encapsulates the action > that the admin is taking) > > I guess what you are asking is : how can you check on the template or in the > views what type of person the user is and show them certain things. > > you can make use of the template tags that check for perms. > > and some views are only accessible for certain types of peoples. for that, > using perms is good. > > @permission_required("app.provider.can_view") > def view_func(request): > > also this way you can give the staff or Agents perms that the plebs also > have. > > you could also set a cookie/session var on login for is_a > that would be less db hits > > -f;lix > > On Tue, Oct 21, 2008 at 10:39 PM, itsnotvalid <[EMAIL PROTECTED]> wrote: > > > 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 django, I am not sure how can I separate different kinds of user > > here. I actually want to make it look like that different people login > > in different location, and do not share the same view after they > > logged in. > > > So I am thinking a model schema like this: > > > Users (as usual) > > > Providers(link to a specific user, one-to-one) > > > Customers(link to a specific user, many-to-one, as one user may find > > services for more that one actual person) > > > Agents(link to a specific user, one-to-one) > > > But how effectively can I separate their views? By defining different > > apps? Any other suggestions? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---