Saturday, November 29, 2014

Re: Multiple levels of user in django application

You may need to re-think your model design or add a model that aggregates the others and use it to link to the group model?  There are many options but only you know the best one. 

On Sat, Nov 29, 2014 at 9:33 AM, Anju SB <anjusb712@gmail.com> wrote:
But the user's details are in different models , Groups may have different fields....



On Saturday, 29 November 2014 16:49:35 UTC+5:30, Timothy W. Cook wrote:


On Sat, Nov 29, 2014 at 6:49 AM, Anju SB <anju...@gmail.com> wrote:
Actually my application needs to store different information about  each group of users and needs to map these data with the auth_user table. 


​Yes.  You can create a model for that information and then use the group as a key.  ​
​There are similar examples you​ find with a search engine.  The mailing list and stackoverflow are good places to look. 



 

On Saturday, 29 November 2014 13:34:49 UTC+5:30, Timothy W. Cook wrote:


On Sat, Nov 29, 2014 at 3:51 AM, Anju SB <anju...@gmail.com> wrote:
Thank you Scot Hacker.   
     But my application needs more than one user from the same group. 


​You can have multiple users in a group. That is kind of the definition of a group.  :-)


HTH,
Tim




 




On Friday, 28 November 2014 23:24:34 UTC+5:30, Scot Hacker wrote:

On Friday, November 28, 2014 3:16:41 AM UTC-8, Anju SB wrote:
Dear Friends,

I want to develop a django based GIS web application.  In my application there are different levels of users namely station level user, circle level user etc.  Each user details are provided in different table,  How can I map/ relate the user with these tables.  Pleas help me to solve this issue.  

I think of situations like this as having two prongs:

1) Various groups have various permission levels in portions of the project
2) Group members may have additional data/fields associated with their profiles.

For #1, use Django's Groups system to assign group memberships and  permissions as needed. You can start using those permissions throughout your project immediately.

For #2, you can create additional profile sub-types, keyed to a base profile. e.g. maybe everyone gets a UserProfile, while instructors also get an InstructorProfile that's FK'd to UserProfile. You can use post-save signals or other mechanisms to make sure that everyone has the right additional profile fields. Now let's say a user is looking at their profile editor - you could say "If user in group Instructors, also let them edit their associated InstructorProfile."

There are many ways to skin this cat...

./s

--
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 django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5750f591-276b-49da-bfc5-61c4d0a51f07%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

============================================
Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

--
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 django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a5cb2cdb-3064-48ff-bebd-88ac90bce602%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

============================================
Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a47d856c-3fc4-4f14-b629-1c2287249545%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

============================================
Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3W1VKqF1bHhBQOiAWhXK_LYz70jT_9FphgxbJbbfF5C6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment