mirror of
https://github.com/django/django.git
synced 2025-11-11 16:23:59 +00:00
Merge pull request #2756 from tubaman/return_unicode
Unicode method on model should return unicode
This commit is contained in:
commit
593b3c32bd
1 changed files with 1 additions and 1 deletions
|
|
@ -444,7 +444,7 @@ For example::
|
||||||
last_name = models.CharField(max_length=50)
|
last_name = models.CharField(max_length=50)
|
||||||
|
|
||||||
def __unicode__(self):
|
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
|
If you define a ``__unicode__()`` method on your model and not a
|
||||||
:meth:`~Model.__str__()` method, Django will automatically provide you with a
|
:meth:`~Model.__str__()` method, Django will automatically provide you with a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue