Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed formatting of get_FOO_display example

  • Loading branch information...
commit d94dc2d1fa190d202d19a351f00a6b42e670fecb 1 parent 4285571
Eric Davis edavis authored
Showing with 19 additions and 19 deletions.
  1. +19 −19 docs/ref/models/instances.txt
38 docs/ref/models/instances.txt
View
@@ -616,25 +616,25 @@ the field. This method returns the "human-readable" value of the field.
For example::
- 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)
-
- ::
-
- >>> p = Person(name="Fred Flintstone", shirt_size="L")
- >>> p.save()
- >>> p.shirt_size
- u'L'
- >>> p.get_shirt_size_display()
- u'Large'
+ 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)
+
+::
+
+ >>> 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)
Please sign in to comment.
Something went wrong with that request. Please try again.