Ticket #2143: doc_api_fix.diff

File doc_api_fix.diff, 1.2 KB (added by mssnlayam@…, 9 years ago)

Fixes the documentation to use the new API

  • docs/forms.txt

     
    1515because much of the time you won't need to use the lower-level APIs. Throughout
    1616this document, we'll be working with the following model, a "place" object::
    1717
     18    from django.db import models
     19
    1820    PLACE_TYPES = (
    1921        (1, 'Bar'),
    2022        (2, 'Restaurant'),
     
    2224        (4, 'Secret Hideout'),
    2325    )
    2426
    25     class Place(meta.Model):
    26         name = meta.CharField(maxlength=100)
    27         address = meta.CharField(maxlength=100, blank=True)
    28         city = meta.CharField(maxlength=50, blank=True)
    29         state = meta.USStateField()
    30         zip_code = meta.CharField(maxlength=5, blank=True)
    31         place_type = meta.IntegerField(choices=PLACE_TYPES)
     27    class Place(models.Model):
     28        name = models.CharField(maxlength=100)
     29        address = models.CharField(maxlength=100, blank=True)
     30        city = models.CharField(maxlength=50, blank=True)
     31        state = models.USStateField()
     32        zip_code = models.CharField(maxlength=5, blank=True)
     33        place_type = models.IntegerField(choices=PLACE_TYPES)
    3234
    3335        class Admin:
    3436            pass
Back to Top