logo       

Thoughts on many-to-many relationship: msg#02266

DjangoUsers

Subject: Thoughts on many-to-many relationship


Hi All,

When I try to create a Group (django.contrib.auth.models.Group)
dynamically, I get the below error.

'Group' instance needs to have a primary key value before a many-to-
many relationship can be used.

This is because I am trying to add permissions to the group object and
trying to save every thing in one shot. As a work around to this
problem, I am doing an intermediate save and reload of Group object,
which seems to work fine.

Is there a logical reason behind this error? Is this something
fixable?

Regards,
Prabhu
P.S: Exact source code here -
http://github.com/prabhu/invoicy/blob/3f32fff86b806bc0b769de6de7dbe049788f0b24/invoicy/common/utils/decorators.py

--~--~---------~--~----~------------~-------~--~----~
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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
django-users+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise