Django

Code

Changeset 3125

Show
Ignore:
Timestamp:
06/13/06 22:31:34 (2 years ago)
Author:
mtredinnick
Message:

Fixed #2143 -- Changed a few places where the pre-magic-removal-merge syntax
was still being used in the docs. Thanks to mssnlayam@yahoo.com for the patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/db-api.txt

    r3096 r3125  
    560560        hometown = models.ForeignKey(City) 
    561561 
    562     class Book(meta.Model): 
     562    class Book(models.Model): 
    563563        # ... 
    564564        author = models.ForeignKey(Person) 
  • django/trunk/docs/forms.txt

    r2809 r3125  
    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:: 
     17 
     18    from django.db import models 
    1719 
    1820    PLACE_TYPES = ( 
     
    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: 
  • django/trunk/docs/i18n.txt

    r3091 r3125  
    134134    from django.utils.translation import gettext_lazy 
    135135 
    136     class MyThing(meta.Model): 
    137         name = meta.CharField(help_text=gettext_lazy('This is the help text')) 
     136    class MyThing(models.Model): 
     137        name = models.CharField(help_text=gettext_lazy('This is the help text')) 
    138138 
    139139In this example, ``gettext_lazy()`` stores a lazy reference to the string -- 
     
    146146    from django.utils.translation import gettext_lazy as _ 
    147147 
    148     class MyThing(meta.Model): 
    149         name = meta.CharField(help_text=_('This is the help text')) 
     148    class MyThing(models.Model): 
     149        name = models.CharField(help_text=_('This is the help text')) 
    150150 
    151151Always use lazy translations in `Django models`_. And it's a good idea to add 
     
    156156    from django.utils.translation import gettext_lazy as _ 
    157157 
    158     class MyThing(meta.Model): 
    159         name = meta.CharField(_('name'), help_text=_('This is the help text')) 
     158    class MyThing(models.Model): 
     159        name = models.CharField(_('name'), help_text=_('This is the help text')) 
    160160        class Meta: 
    161161            verbose_name = _('my thing')