Re: GenericRelations reverse accessors

2008-02-23 Thread Michael Elsdörfer
> It's a bug (#5937). Thanks Malcolm. I was doing a search, but had trouble with the terminology. Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send emai

Re: GenericRelations reverse accessors

2008-02-22 Thread Malcolm Tredinnick
On Sat, 2008-02-23 at 05:14 +0100, Michael Elsdörfer wrote: [...] > i.e. both the ``Person`` and ``Review`` objects are returned, even > though the query only requests reviews. Because it doesn't consider content_type in the query, only object_id. > I just realized that the docs (at > http://ww

GenericRelations reverse accessors

2008-02-22 Thread Michael Elsdörfer
class Feature(models.Model): content_object = generic.GenericForeignKey() class Review(models.Model): features = GenericRelation(Feature) class Person(models.Model): features = GenericRelation(Feature) >> Person.objects.create() # id = 1 >> Review.objects.create() # id = 1 >> Fea