File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 5
5
from django .db import connection
6
6
from django .utils .encoding import smart_text
7
7
from django .utils .encoding import python_2_unicode_compatible
8
- from django .contrib .contenttypes import generic
9
- from django .contrib .contenttypes .models import ContentType
10
8
from django .utils .translation import ugettext_lazy as _
9
+ from django .contrib .contenttypes .models import ContentType
10
+ try :
11
+ from django .contrib .contenttypes .fields import GenericForeignKey
12
+ except ImportError :
13
+ from django .contrib .contenttypes .generic import GenericForeignKey
11
14
12
15
from . import settings
13
16
from .utils import LOGARITHMIC
@@ -484,7 +487,7 @@ class TaggedItem(models.Model):
484
487
tag = models .ForeignKey (Tag , verbose_name = _ ('tag' ), related_name = 'items' )
485
488
content_type = models .ForeignKey (ContentType , verbose_name = _ ('content type' ))
486
489
object_id = models .PositiveIntegerField (_ ('object id' ), db_index = True )
487
- object = generic . GenericForeignKey ('content_type' , 'object_id' )
490
+ object = GenericForeignKey ('content_type' , 'object_id' )
488
491
489
492
objects = TaggedItemManager ()
490
493
You can’t perform that action at this time.
0 commit comments