diff options
| author | Simon Charette <charette.s@gmail.com> | 2014-01-22 01:43:33 -0500 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2014-01-26 14:42:30 -0500 |
| commit | 10e3faf191d8f230dde8534d1c8fad8c8717816e (patch) | |
| tree | 26d597787a0a22f0f11b1d1e0daf0c3b1feb5805 /tests/aggregation_regress | |
| parent | c3881944e8651ad98e29561154186e87928ca319 (diff) | |
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.
Diffstat (limited to 'tests/aggregation_regress')
| -rw-r--r-- | tests/aggregation_regress/models.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/aggregation_regress/models.py b/tests/aggregation_regress/models.py index 275e37c036..4d495b4a75 100644 --- a/tests/aggregation_regress/models.py +++ b/tests/aggregation_regress/models.py @@ -1,5 +1,7 @@ # coding: utf-8 -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 from django.utils.encoding import python_2_unicode_compatible @@ -28,7 +30,7 @@ class ItemTag(models.Model): tag = models.CharField(max_length=100) content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') + content_object = GenericForeignKey('content_type', 'object_id') @python_2_unicode_compatible @@ -42,7 +44,7 @@ class Book(models.Model): contact = models.ForeignKey(Author, related_name='book_contact_set') publisher = models.ForeignKey(Publisher) pubdate = models.DateField() - tags = generic.GenericRelation(ItemTag) + tags = GenericRelation(ItemTag) class Meta: ordering = ('name',) |
