Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3125 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 97fedcc03175f6ced6c46145be930aad4977c54f 1 parent 93974e0
Malcolm Tredinnick authored June 14, 2006
2  docs/db-api.txt
@@ -559,7 +559,7 @@ following models::
559 559
         # ...
560 560
         hometown = models.ForeignKey(City)
561 561
 
562  
-    class Book(meta.Model):
  562
+    class Book(models.Model):
563 563
         # ...
564 564
         author = models.ForeignKey(Person)
565 565
 
16  docs/forms.txt
@@ -15,6 +15,8 @@ We'll take a top-down approach to examining Django's form validation framework,
15 15
 because much of the time you won't need to use the lower-level APIs. Throughout
16 16
 this document, we'll be working with the following model, a "place" object::
17 17
 
  18
+    from django.db import models
  19
+
18 20
     PLACE_TYPES = (
19 21
         (1, 'Bar'),
20 22
         (2, 'Restaurant'),
@@ -22,13 +24,13 @@ this document, we'll be working with the following model, a "place" object::
22 24
         (4, 'Secret Hideout'),
23 25
     )
24 26
 
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)
32 34
 
33 35
         class Admin:
34 36
             pass
12  docs/i18n.txt
@@ -133,8 +133,8 @@ For example, to translate a model's ``help_text``, do the following::
133 133
 
134 134
     from django.utils.translation import gettext_lazy
135 135
 
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'))
138 138
 
139 139
 In this example, ``gettext_lazy()`` stores a lazy reference to the string --
140 140
 not the actual translation. The translation itself will be done when the string
@@ -145,8 +145,8 @@ If you don't like the verbose name ``gettext_lazy``, you can just alias it as
145 145
 
146 146
     from django.utils.translation import gettext_lazy as _
147 147
 
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'))
150 150
 
151 151
 Always use lazy translations in `Django models`_. And it's a good idea to add
152 152
 translations for the field names and table names, too. This means writing
@@ -155,8 +155,8 @@ class, though::
155 155
 
156 156
     from django.utils.translation import gettext_lazy as _
157 157
 
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'))
160 160
         class Meta:
161 161
             verbose_name = _('my thing')
162 162
             verbose_name_plural = _('mythings')

0 notes on commit 97fedcc

Please sign in to comment.
Something went wrong with that request. Please try again.