File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ A manager for retrieving tags used by a particular model.
202
202
203
203
Defines the following methods:
204
204
205
- * ``get_query_set ()`` -- as this method is redefined, any ``QuerySets``
205
+ * ``get_queryset ()`` -- as this method is redefined, any ``QuerySets``
206
206
created by this model will be initially restricted to contain the
207
207
distinct tags used by all the model's instances.
208
208
Original file line number Diff line number Diff line change 2
2
Custom managers for Django models registered with the tagging
3
3
application.
4
4
"""
5
+
6
+ import django
5
7
from django .contrib .contenttypes .models import ContentType
6
8
from django .db import models
7
9
@@ -12,11 +14,15 @@ class ModelTagManager(models.Manager):
12
14
"""
13
15
A manager for retrieving tags for a particular model.
14
16
"""
15
- def get_query_set (self ):
17
+ def get_queryset (self ):
16
18
ctype = ContentType .objects .get_for_model (self .model )
17
19
return Tag .objects .filter (
18
20
items__content_type__pk = ctype .pk ).distinct ()
19
21
22
+ # TODO: drop this
23
+ if django .VERSION < (1 , 6 ):
24
+ get_query_set = get_queryset
25
+
20
26
def cloud (self , * args , ** kwargs ):
21
27
return Tag .objects .cloud_for_model (self .model , * args , ** kwargs )
22
28
You can’t perform that action at this time.
0 commit comments