mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #22313 -- Removed 'u' prefixes from documentation
This commit is contained in:
@@ -449,7 +449,7 @@ For example::
|
||||
last_name = models.CharField(max_length=50)
|
||||
|
||||
def __unicode__(self):
|
||||
return u'%s %s' % (self.first_name, self.last_name)
|
||||
return '%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
|
||||
@@ -724,9 +724,9 @@ For example::
|
||||
|
||||
class Person(models.Model):
|
||||
SHIRT_SIZES = (
|
||||
(u'S', u'Small'),
|
||||
(u'M', u'Medium'),
|
||||
(u'L', u'Large'),
|
||||
('S', 'Small'),
|
||||
('M', 'Medium'),
|
||||
('L', 'Large'),
|
||||
)
|
||||
name = models.CharField(max_length=60)
|
||||
shirt_size = models.CharField(max_length=2, choices=SHIRT_SIZES)
|
||||
@@ -736,9 +736,9 @@ For example::
|
||||
>>> p = Person(name="Fred Flintstone", shirt_size="L")
|
||||
>>> p.save()
|
||||
>>> p.shirt_size
|
||||
u'L'
|
||||
'L'
|
||||
>>> p.get_shirt_size_display()
|
||||
u'Large'
|
||||
'Large'
|
||||
|
||||
.. method:: Model.get_next_by_FOO(\**kwargs)
|
||||
.. method:: Model.get_previous_by_FOO(\**kwargs)
|
||||
|
||||
@@ -484,7 +484,7 @@ A few subtleties that are worth mentioning:
|
||||
For example::
|
||||
|
||||
>>> Entry.objects.values()
|
||||
[{'blog_id': 1, 'headline': u'First Entry', ...}, ...]
|
||||
[{'blog_id': 1, 'headline': 'First Entry', ...}, ...]
|
||||
|
||||
>>> Entry.objects.values('blog')
|
||||
[{'blog': 1}, ...]
|
||||
@@ -554,7 +554,7 @@ respective field passed into the ``values_list()`` call — so the first item is
|
||||
the first field, etc. For example::
|
||||
|
||||
>>> Entry.objects.values_list('id', 'headline')
|
||||
[(1, u'First entry'), ...]
|
||||
[(1, 'First entry'), ...]
|
||||
|
||||
If you only pass in a single field, you can also pass in the ``flat``
|
||||
parameter. If ``True``, this will mean the returned results are single values,
|
||||
|
||||
Reference in New Issue
Block a user