Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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 Baptiste Mispelon, 10 years ago

Resolution: worksforme
Status: newclosed

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.

comment:2 by neoblackcap, 10 years ago

Oh,my mistake. I just think the 1.7 version document is same as 1.6.

comment:3 by Collin Anderson, 10 years ago

Resolution: worksformeinvalid

Yup, contenttypes.fields was _added_ in 1.7

Note: See TracTickets for help on using tickets.
Back to Top