#23413 closed Bug (invalid)
django.contrib.contenttypes.fields has been remove
Reported by: | neoblackcap | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
Severity: | Normal | Keywords: | contenttypes |
Cc: | neo.blackcap@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the document The contenttypes framework, section Generic relations
the example show
from django.db import models from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType
However, GenericForeignKey
only can be import from django.contrib.contenttypes.generic
Change History (3)
comment:1 by , 10 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:3 by , 10 years ago
Resolution: | worksforme → invalid |
---|
Yup, contenttypes.fields
was _added_ in 1.7
Note:
See TracTickets
for help on using tickets.
Hi,
It seems that you're using Django 1.6 but you're referring to the documentaiton for 1.7.
Make sure you're using the right version (you can switch version on any page of the documentation by using the little widget at the bottom right hand corner of the page).
For reference, https://docs.djangoproject.com/en/1.6/ref/contrib/contenttypes/#id1 does use
from django.contrib.contenttypes import generic
.Thanks.