Re: Generic ForeignKey in Database Queries

2010-12-06 Thread andy
>From the django doc "Due to the way GenericForeignKey is implemented, you cannot use such fields directly with filters (filter() and exclude(), for example) via the database API. They aren't normal field objects." http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#generic-relations O

Generic ForeignKey in Database Queries

2010-12-06 Thread Katrina
I have a model set up thusly: from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic Item(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() object = generic.GenericForeignKey() If