mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +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:
@@ -12,18 +12,18 @@ Throughout this reference, we'll refer to the following Poll application::
|
||||
|
||||
class Poll(meta.Model):
|
||||
fields = (
|
||||
meta.SlugField('slug', 'slug', unique_for_month='pub_date'),
|
||||
meta.CharField('question', 'question', maxlength=255),
|
||||
meta.DateTimeField('pub_date', 'date published'),
|
||||
meta.DateTimeField('expire_date', 'expiration date'),
|
||||
meta.SlugField('slug', unique_for_month='pub_date'),
|
||||
meta.CharField('question', maxlength=255),
|
||||
meta.DateTimeField('pub_date'),
|
||||
meta.DateTimeField('expire_date'),
|
||||
)
|
||||
|
||||
class Choice(meta.Model):
|
||||
fields = (
|
||||
meta.ForeignKey(Poll, edit_inline=True, edit_inline_type=meta.TABULAR,
|
||||
num_in_admin=10, min_num_in_admin=5),
|
||||
meta.CharField('choice', 'choice', maxlength=255, core=True),
|
||||
meta.IntegerField('votes', 'votes', editable=False, default=0),
|
||||
meta.CharField('choice', maxlength=255, core=True),
|
||||
meta.IntegerField('votes', editable=False, default=0),
|
||||
)
|
||||
|
||||
Basic lookup functions
|
||||
@@ -351,6 +351,4 @@ the relation (``poll_id`` in this case).
|
||||
Deleting objects
|
||||
================
|
||||
|
||||
Just cause we're crazy like that, the delete method is named ``delete()``.
|
||||
Yeah, you never know what we're going to do next.
|
||||
|
||||
The delete method, conveniently, is named ``delete()``.
|
||||
|
||||
Reference in New Issue
Block a user