On Sun, Oct 5, 2008 at 9:47 AM, Matrixer <[EMAIL PROTECTED]> wrote: > > hi, when I was trying to use the Meta option 'unique_together' in my > Membership model below, a NameError happened, I don't know what the > problem is, I am using django 1.0 and sqlite3 > > regards, > Matrixer > > ------------------------------------------------------- > class Membership(models.Model): > person = models.ForeignKey('Person') > group = models.ForeignKey('Group') > > class Meta: > unique_together('person', 'group') > > ------------------------------------------------------- > unique_together('person', 'group') > NameError: name 'unique_together' is not defined >
You've coded it as a method call and there is no such method. You want it to be an assignment: http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---