Monday, September 15, 2014

Re: django 1.7 Groups

Hi,

changing the base Group model is not very easy.

My suggestion is to create a ManyToMany relation on your Company model.

class Company(models.Model):
    ....
    groups = models.ManyToManyField("auth.Group")

The design allows in theory many companies to have the same group, but this you can check on code side.

Cheers

Am Freitag, 12. September 2014 20:49:40 UTC+2 schrieb John Rodkey:
How can I modify the auto generated auth groups to include a foreign key?  We wish to add a foreign key to show group ownership to a company table.

For example, Company A could create a librarians group and assign users.

Company B could create a brokers group and assign users

--
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/f8cb50aa-18a7-40a7-9941-4cb1c402c2f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment