Re: ManyToManyField and get_or_create

2013-05-09 Thread Mick T.
I have the same problem, looks like it's a bug: https://code.djangoproject.com/ticket/18896 On Friday, 31 August 2012 18:55:39 UTC-4, Matt Long wrote: > > Bump? > > Almost exactly 4 years later, I've ran into this exact same issue in > Django 1.4. Attempting to use get_or_create through a ManyTo

Re: ManyToManyField and get_or_create

2012-08-31 Thread Matt Long
Bump? Almost exactly 4 years later, I've ran into this exact same issue in Django 1.4. Attempting to use get_or_create through a ManyToMany field results in an integrity error if the object already exists but is not yet associated with the parent object. To use the OP's example, if a Tag with n

ManyToManyField and get_or_create

2008-09-01 Thread Cap
I'm having problems using get_or_create with a ManyToManyField and I'm not sure whether the problem is me or Django. I have two models: class Tag(models.Model): name = models.CharField(max_length=256, unique=True) class Thing(models.Model): name = models.CharField(max_length=256) ta