Opened 11 years ago
Closed 11 years ago
#21995 closed Uncategorized (invalid)
GenericForeignKey import wrong
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Under Generic relations it says to use
from django.contrib.contenttypes.fields import GenericForeignKey
There is no "fields" in contenttypes, grepping through the source revealed it is:
from django.contrib.contenttypes import generic
and then it should read:
generic.GenericForeignKey...
Note:
See TracTickets
for help on using tickets.
This has changed in Django 1.7. Please make sure you are reading the docs for the correct version.
https://docs.djangoproject.com/en/1.6/ref/contrib/contenttypes/#django.contrib.contenttypes.generic.GenericForeignKey