Thursday, March 17, 2011

Model with several ManyToManyFields - related_name problem

I have a model with more than one (3 in fact) ManyToManyFields which
point to the same other model.

As long as I specify distinct related_names for each, all is well.

But the documentation [1] suggests that if I don't need the backwards
relation, then specifying '+' as the related_name should work. But I
don't seem to be able to specify '+' for more than one of the fields:
I get a 'reverse query clashes' error.

Is this expected? It feels like a bug (i.e. I'd expect all fields
with related_name="+" to be ignored for this check).

TIA

George


[1: http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.related_name
]

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate