فهرست منبع

Unicode method on model should return unicode

The example of a __unicode__ model method should return a unicode value
instead of a string.
Ryan Nowakowski 10 سال پیش
والد
کامیت
f39b8867a1
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      docs/ref/models/instances.txt

+ 1 - 1
docs/ref/models/instances.txt

@@ -444,7 +444,7 @@ For example::
         last_name = models.CharField(max_length=50)
 
         def __unicode__(self):
-            return '%s %s' % (self.first_name, self.last_name)
+            return u'%s %s' % (self.first_name, self.last_name)
 
 If you define a ``__unicode__()`` method on your model and not a
 :meth:`~Model.__str__()` method, Django will automatically provide you with a