diff options
| author | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-08-05 05:14:46 +0000 |
|---|---|---|
| committer | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-08-05 05:14:46 +0000 |
| commit | 212ee65be782240554749f25bbd3772240d56fff (patch) | |
| tree | 81ac3c9ae0c49d6ee1854b54fbc79a18069edc5f /docs/db-api.txt | |
| parent | 973f44aa4c953baf6bf56b8e5c474f5306452809 (diff) | |
Fixed #2101 -- Renamed `maxlength` argument to `max_length` for oldforms `FormField`s and db model `Field`s. This is fully backwards compatible at the moment since the legacy `maxlength` argument is still supported. Using `maxlength` will, however, issue a `PendingDeprecationWarning` when used.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/db-api.txt')
| -rw-r--r-- | docs/db-api.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt index 080ab0de16..766a6ae519 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -12,14 +12,14 @@ Throughout this reference, we'll refer to the following models, which comprise a weblog application:: class Blog(models.Model): - name = models.CharField(maxlength=100) + name = models.CharField(max_length=100) tagline = models.TextField() def __unicode__(self): return self.name class Author(models.Model): - name = models.CharField(maxlength=50) + name = models.CharField(max_length=50) email = models.EmailField() def __unicode__(self): @@ -27,7 +27,7 @@ a weblog application:: class Entry(models.Model): blog = models.ForeignKey(Blog) - headline = models.CharField(maxlength=255) + headline = models.CharField(max_length=255) body_text = models.TextField() pub_date = models.DateTimeField() authors = models.ManyToManyField(Author) @@ -1806,8 +1806,8 @@ following model:: ('F', 'Female'), ) class Person(models.Model): - name = models.CharField(maxlength=20) - gender = models.CharField(maxlength=1, choices=GENDER_CHOICES) + name = models.CharField(max_length=20) + gender = models.CharField(max_length=1, choices=GENDER_CHOICES) ...each ``Person`` instance will have a ``get_gender_display()`` method. Example:: |
