mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
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
This commit is contained in:
parent
973f44aa4c
commit
212ee65be7
88 changed files with 647 additions and 407 deletions
|
@ -18,8 +18,8 @@ ManyToMany field. This has no effect on the API for querying the database.
|
|||
from django.db import models
|
||||
|
||||
class Author(models.Model):
|
||||
first_name = models.CharField(maxlength=30, db_column='firstname')
|
||||
last_name = models.CharField(maxlength=30, db_column='last')
|
||||
first_name = models.CharField(max_length=30, db_column='firstname')
|
||||
last_name = models.CharField(max_length=30, db_column='last')
|
||||
|
||||
def __unicode__(self):
|
||||
return u'%s %s' % (self.first_name, self.last_name)
|
||||
|
@ -29,7 +29,7 @@ class Author(models.Model):
|
|||
ordering = ('last_name','first_name')
|
||||
|
||||
class Article(models.Model):
|
||||
headline = models.CharField(maxlength=100)
|
||||
headline = models.CharField(max_length=100)
|
||||
authors = models.ManyToManyField(Author, db_table='my_m2m_table')
|
||||
|
||||
def __unicode__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue