From 596cb9c7e287abbb98c64974fb4944d522cb6b5a Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 28 Apr 2012 18:02:01 +0200 Subject: Replaced print statement by print function (forward compatibility syntax). --- docs/ref/forms/fields.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/ref/forms/fields.txt') diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index fa5800692f..0da891ec4b 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -112,7 +112,7 @@ We've specified ``auto_id=False`` to simplify the output:: ... url = forms.URLField(label='Your Web site', required=False) ... comment = forms.CharField() >>> f = CommentForm(auto_id=False) - >>> print f + >>> print(f) Your name: Your Web site: Comment: @@ -135,7 +135,7 @@ field is initialized to a particular value. For example:: ... url = forms.URLField(initial='http://') ... comment = forms.CharField() >>> f = CommentForm(auto_id=False) - >>> print f + >>> print(f) Name: Url: Comment: @@ -150,7 +150,7 @@ and the HTML output will include any validation errors:: ... comment = forms.CharField() >>> default_data = {'name': 'Your name', 'url': 'http://'} >>> f = CommentForm(default_data, auto_id=False) - >>> print f + >>> print(f) Name: Url: Comment: @@ -179,7 +179,7 @@ Instead of a constant, you can also pass any callable:: >>> import datetime >>> class DateForm(forms.Form): ... day = forms.DateField(initial=datetime.date.today) - >>> print DateForm() + >>> print(DateForm()) Day: The callable will be evaluated only when the unbound form is displayed, not when it is defined. @@ -211,17 +211,17 @@ fields. We've specified ``auto_id=False`` to simplify the output:: ... sender = forms.EmailField(help_text='A valid email address, please.') ... cc_myself = forms.BooleanField(required=False) >>> f = HelpTextContactForm(auto_id=False) - >>> print f.as_table() + >>> print(f.as_table()) Subject:
100 characters max. Message: Sender:
A valid email address, please. Cc myself: - >>> print f.as_ul() + >>> print(f.as_ul()))
  • Subject: 100 characters max.
  • Message:
  • Sender: A valid email address, please.
  • Cc myself:
  • - >>> print f.as_p() + >>> print(f.as_p())

    Subject: 100 characters max.

    Message:

    Sender: A valid email address, please.

    -- cgit v1.3