File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 10
10
from django .db .models import Manager
11
11
from django .db .models .query import QuerySet
12
12
from django .utils import six
13
- from django .utils .encoding import smart_text
13
+ from django .utils .encoding import python_2_unicode_compatible , smart_text
14
14
from django .utils .six .moves .urllib import parse as urlparse
15
15
from django .utils .translation import ugettext_lazy as _
16
16
@@ -47,6 +47,7 @@ def __getnewargs__(self):
47
47
is_hyperlink = True
48
48
49
49
50
+ @python_2_unicode_compatible
50
51
class PKOnlyObject (object ):
51
52
"""
52
53
This is a mock object, used for when we only need the pk of the object
@@ -56,6 +57,9 @@ class PKOnlyObject(object):
56
57
def __init__ (self , pk ):
57
58
self .pk = pk
58
59
60
+ def __str__ (self ):
61
+ return "%s" % self .pk
62
+
59
63
60
64
# We assume that 'validators' are intended for the child serializer,
61
65
# rather than the parent serializer.
You can’t perform that action at this time.
0 commit comments