summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorEric Davis <ed@npri.org>2012-11-04 09:52:37 -0800
committerEric Davis <ed@npri.org>2012-11-04 10:29:10 -0800
commitd94dc2d1fa190d202d19a351f00a6b42e670fecb (patch)
treef835391ed47239d47959558459f614b523ccd94f /docs
parent4285571c5a9bf6ca3cb7c4d774942b9ae5b537e4 (diff)
Fixed formatting of get_FOO_display example
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/instances.txt32
1 files changed, 16 insertions, 16 deletions
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index 1ba41148b0..b4872e3e5c 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -616,25 +616,25 @@ the field. This method returns the "human-readable" value of the field.
For example::
- from django.db import models
+ from django.db import models
- class Person(models.Model):
- SHIRT_SIZES = (
- (u'S', u'Small'),
- (u'M', u'Medium'),
- (u'L', u'Large'),
- )
- name = models.CharField(max_length=60)
- shirt_size = models.CharField(max_length=2, choices=SHIRT_SIZES)
+ class Person(models.Model):
+ SHIRT_SIZES = (
+ (u'S', u'Small'),
+ (u'M', u'Medium'),
+ (u'L', u'Large'),
+ )
+ name = models.CharField(max_length=60)
+ shirt_size = models.CharField(max_length=2, choices=SHIRT_SIZES)
- ::
+::
- >>> p = Person(name="Fred Flintstone", shirt_size="L")
- >>> p.save()
- >>> p.shirt_size
- u'L'
- >>> p.get_shirt_size_display()
- u'Large'
+ >>> p = Person(name="Fred Flintstone", shirt_size="L")
+ >>> p.save()
+ >>> p.shirt_size
+ u'L'
+ >>> p.get_shirt_size_display()
+ u'Large'
.. method:: Model.get_next_by_FOO(\**kwargs)
.. method:: Model.get_previous_by_FOO(\**kwargs)