Fixed #19774 -- Deprecated the contenttypes.generic module.

It contained models, forms and admin objects causing undesirable
import side effects. Refs #16368.

Thanks to Ramiro, Carl and Loïc for the review.
This commit is contained in:
Simon Charette 2014-01-22 01:43:33 -05:00
parent c3881944e8
commit 10e3faf191
33 changed files with 1011 additions and 906 deletions

View file

@ -1,4 +1,6 @@
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
@ -7,7 +9,7 @@ class Award(models.Model):
name = models.CharField(max_length=25)
object_id = models.PositiveIntegerField()
content_type = models.ForeignKey(ContentType)
content_object = generic.GenericForeignKey()
content_object = GenericForeignKey()
class AwardNote(models.Model):
@ -17,7 +19,7 @@ class AwardNote(models.Model):
class Person(models.Model):
name = models.CharField(max_length=25)
awards = generic.GenericRelation(Award)
awards = GenericRelation(Award)
class Book(models.Model):