mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #67 -- Human-readable name is now optional in model fields. If a second positional argument isn't given, Django will use the first argument, converting underscores to spaces. This change is fully backwards-compatible.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e243d82874
commit
df66763406
5 changed files with 59 additions and 49 deletions
|
@ -22,7 +22,7 @@ solving two years' worth of database-schema problems. Here's a quick example::
|
|||
|
||||
class Reporter(meta.Model):
|
||||
fields = (
|
||||
meta.CharField('full_name', "reporter's full name", maxlength=70),
|
||||
meta.CharField('full_name', maxlength=70),
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -30,9 +30,9 @@ solving two years' worth of database-schema problems. Here's a quick example::
|
|||
|
||||
class Article(meta.Model):
|
||||
fields = (
|
||||
meta.DateTimeField('pub_date', 'publication date'),
|
||||
meta.CharField('headline', 'headline', maxlength=200),
|
||||
meta.TextField('article', 'article'),
|
||||
meta.DateTimeField('pub_date'),
|
||||
meta.CharField('headline', maxlength=200),
|
||||
meta.TextField('article'),
|
||||
meta.ForeignKey(Reporter),
|
||||
)
|
||||
|
||||
|
@ -133,9 +133,9 @@ classes::
|
|||
|
||||
class Article(meta.Model):
|
||||
fields = (
|
||||
meta.DateTimeField('pub_date', 'publication date'),
|
||||
meta.CharField('headline', 'headline', maxlength=200),
|
||||
meta.TextField('article', 'article'),
|
||||
meta.DateTimeField('pub_date'),
|
||||
meta.CharField('headline', maxlength=200),
|
||||
meta.TextField('article'),
|
||||
meta.ForeignKey(Reporter),
|
||||
)
|
||||
admin = meta.Admin(
|
||||
|
@ -302,7 +302,11 @@ features:
|
|||
* An RSS framework that makes creating RSS feeds as easy as writing a
|
||||
small Python class.
|
||||
* More sexy automatically-generated admin features -- this overview barely
|
||||
scratched the surface
|
||||
scratched the surface.
|
||||
|
||||
The next obvious steps are for you to download Django, read the documentation
|
||||
and join the community. Thanks for your interest!
|
||||
The next obvious steps are for you to `download Django`_, read `the tutorial`_
|
||||
and join `the community`_. Thanks for your interest!
|
||||
|
||||
.. _download Django: http://www.djangoproject.com/documentation/
|
||||
.. _the tutorial: http://www.djangoproject.com/documentation/tutorial1/
|
||||
.. _the community: http://www.djangoproject.com/community/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue