>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
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
2 matches
Mail list logo