summaryrefslogtreecommitdiff
path: root/tests/modeltests/model_forms
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-01-28 22:36:34 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-01-28 22:36:34 +0000
commit5d6745301e02aba86dfa4f6e61ada4eb3f44fe1d (patch)
treedd18ce4baa04f1dda948b065af97e94eaeb3fb0b /tests/modeltests/model_forms
parent8b837ba33dcaa6497ed9a7ffe7466dddb3af0e73 (diff)
newforms-admin: Merged to [4442]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4443 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/model_forms')
-rw-r--r--tests/modeltests/model_forms/models.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py
index 81a7ec2abf..657d506b33 100644
--- a/tests/modeltests/model_forms/models.py
+++ b/tests/modeltests/model_forms/models.py
@@ -32,7 +32,7 @@ class Category(models.Model):
return self.name
class Writer(models.Model):
- name = models.CharField(maxlength=50)
+ name = models.CharField(maxlength=50, help_text='Use both first and last names.')
def __str__(self):
return self.name
@@ -150,7 +150,7 @@ represented by a ChoiceField.
<option value="1">Entertainment</option>
<option value="2">It&#39;s a test</option>
<option value="3">Third test</option>
-</select></td></tr>
+</select><br /> Hold down "Control", or "Command" on a Mac, to select more than one.</td></tr>
You can pass a custom Form class to form_for_model. Make sure it's a
subclass of BaseForm, not Form.
@@ -169,7 +169,7 @@ current values are inserted as 'initial' data in each Field.
>>> RoykoForm = form_for_instance(w)
>>> f = RoykoForm(auto_id=False)
>>> print f
-<tr><th>Name:</th><td><input type="text" name="name" value="Mike Royko" maxlength="50" /></td></tr>
+<tr><th>Name:</th><td><input type="text" name="name" value="Mike Royko" maxlength="50" /><br />Use both first and last names.</td></tr>
>>> art = Article(headline='Test article', pub_date=datetime.date(1988, 1, 4), writer=w, article='Hello.')
>>> art.save()
@@ -190,7 +190,7 @@ current values are inserted as 'initial' data in each Field.
<option value="1">Entertainment</option>
<option value="2">It&#39;s a test</option>
<option value="3">Third test</option>
-</select></li>
+</select> Hold down "Control", or "Command" on a Mac, to select more than one.</li>
>>> f = TestArticleForm({'headline': u'New headline', 'pub_date': u'1988-01-04', 'writer': u'1', 'article': 'Hello.'})
>>> f.is_valid()
True
@@ -222,7 +222,7 @@ Add some categories and test the many-to-many form output.
<option value="1" selected="selected">Entertainment</option>
<option value="2">It&#39;s a test</option>
<option value="3">Third test</option>
-</select></li>
+</select> Hold down "Control", or "Command" on a Mac, to select more than one.</li>
>>> f = TestArticleForm({'headline': u'New headline', 'pub_date': u'1988-01-04',
... 'writer': u'1', 'article': u'Hello.', 'categories': [u'1', u'2']})