Hi guys, I have two models (A and B) that I want to intermix into a QuerySet. I know this is not yet possible in Django, so I decided to work around the problem using a third model C as a generic "wrapper" that posesses a GenericForeignKey to either A or B.
Now, I'd also like to filter records within A and B by various means, so I've been attempting something like this within a view: ------------- content_A = ContentType.objects.get_for_model(A) content_B = ContentType.objects.get_for_model(B) clist = C.objects.filter(content_type=content_A) clist = clist | C.objects.filter(content_type=content_B) ------------- That all works fine, but as soon as I try and filter the "clist" with something like this: ----------- clist = C.objects.filter(content_type=content_A, content_object__property_on_A=some_property) ----------- It throws an exception: "Cannot resolve keyword 'content_object' into field. Choices are: content_type, id, object_id, ***** " Having hunted around a bit I saw another post on here regarding ticket #6805: http://code.djangoproject.com/ticket/6805 Am I to understand that I cannot actually use the content_object field as a filter parameter because it is dynamically generated? If so, is there a way around this somehow that isn't going to involve a rather nasty set of looped hits on the database? Thanks for reading! If you need me to clarify a little more, then I certainly will. Mike. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---