Opened 11 years ago

Closed 11 years ago

#21995 closed Uncategorized (invalid)

GenericForeignKey import wrong

Reported by: helberg.andre@… 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

On the page:
https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#django.contrib.contenttypes.generic.GenericForeignKey

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...

Change History (1)

comment:1 by Marc Tamlyn, 11 years ago

Resolution: invalid
Status: newclosed

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

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