Hi,

Is there a way to create an inlineformset for two models with
manytomany relationship. I have created:

class Person(models.Model):
      name = models.CharField
      phone= models.ManyToMany(Phone)

class Phone(models.Model):
     PHONE_CHOICES(('H','Home'),('W",'Work'),('M','Mobile'))
     phone= models.CharField(max_length=10)
     phoneType = models.CharField(max_length=1,
choices=PHONE_CHOICES)

In my view I have
     PhoneFormSet = inlineformset_factory(Person, Phone)

but when I access the view I get the following error
     <class Phone> has no foreignkey to <class Person>

Is there something I have missed or do I need to setup my models
differently?

Thanks
Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to