On 10/2/06, Seemant Kulleen <[EMAIL PROTECTED]> wrote: > Dear All, > > I've attached two files: people/models.py and services/models.py. I > have two many-to-many relationships defined: one is between people and > roles (each person can fill many roles, and each role can be filled by > many people); and one is between each activity in the service (banner > bearer, crucifer, and so on) and people (each activity can be performed > by many people in a specific role and each person can perform many > activities). Chris Long and tomaw helped me come up with appropriate > "limit_choices_to" constructs in the services/models.py to restrict each > activity to specific roles -- so that in the admin etc, only specific > people are presented as choices for each activity. Now, when I run > python manage.py syncdb (with sqlite3 and postgresql both), I get the > following error:
Your models did not include the limit_choices_to parameters, so it's hard to say. However, you should probably have something like this: limit_choices_to = dict(role__name="Priest"), # or whatever limit_choices_to = {'role__name': "Priest"}, # if you prefer dict literals Since your error was complaining about "people_role" not existing, I suspect you had one underscore separating "role" and "name" and not two, which indicates a join. I've done something very similar to the about with Groups. -- This message has been scanned for memes and dangerous content by MindScanner, and is believed to be unclean. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---