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/topics/forms/formsets.txt | 16 ++++++++-------- docs/topics/forms/media.txt | 16 ++++++++-------- docs/topics/forms/modelforms.txt | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'docs/topics/forms') diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index b524c24ad2..ac45c50aa8 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -24,7 +24,7 @@ would with a regular form:: >>> formset = ArticleFormSet() >>> for form in formset: - ... print form.as_table() + ... print(form.as_table()) @@ -42,7 +42,7 @@ the formset you iterated over the ``forms`` attribute:: >>> formset = ArticleFormSet() >>> for form in formset.forms: - ... print form.as_table() + ... print(form.as_table()) Iterating over ``formset.forms`` will render the forms in the order they were created. The default formset iterator also renders the forms @@ -71,7 +71,7 @@ example:: ... ]) >>> for form in formset: - ... print form.as_table() + ... print(form.as_table()) @@ -98,7 +98,7 @@ limit the maximum number of empty forms the formset will display:: >>> ArticleFormSet = formset_factory(ArticleForm, extra=2, max_num=1) >>> formset = ArticleFormset() >>> for form in formset: - ... print form.as_table() + ... print(form.as_table()) @@ -283,7 +283,7 @@ Lets you create a formset with the ability to order:: ... {'title': u'Article #2', 'pub_date': datetime.date(2008, 5, 11)}, ... ]) >>> for form in formset: - ... print form.as_table() + ... print(form.as_table()) @@ -321,7 +321,7 @@ happen when the user changes these values:: >>> formset.is_valid() True >>> for form in formset.ordered_forms: - ... print form.cleaned_data + ... print(form.cleaned_data) {'pub_date': datetime.date(2008, 5, 1), 'ORDER': 0, 'title': u'Article #3'} {'pub_date': datetime.date(2008, 5, 11), 'ORDER': 1, 'title': u'Article #2'} {'pub_date': datetime.date(2008, 5, 10), 'ORDER': 2, 'title': u'Article #1'} @@ -339,7 +339,7 @@ Lets you create a formset with the ability to delete:: ... {'title': u'Article #2', 'pub_date': datetime.date(2008, 5, 11)}, ... ]) >>> for form in formset: - .... print form.as_table() + .... print(form.as_table()) @@ -393,7 +393,7 @@ default fields/attributes of the order and deletion fields:: >>> ArticleFormSet = formset_factory(ArticleForm, formset=BaseArticleFormSet) >>> formset = ArticleFormSet() >>> for form in formset: - ... print form.as_table() + ... print(form.as_table()) diff --git a/docs/topics/forms/media.txt b/docs/topics/forms/media.txt index 0eb3e91b3a..4399e7572c 100644 --- a/docs/topics/forms/media.txt +++ b/docs/topics/forms/media.txt @@ -64,7 +64,7 @@ named ``media``. The media for a CalendarWidget instance can be retrieved through this property:: >>> w = CalendarWidget() - >>> print w.media + >>> print(w.media) @@ -139,7 +139,7 @@ basic Calendar widget from the example above:: ... js = ('whizbang.js',) >>> w = FancyCalendarWidget() - >>> print w.media + >>> print(w.media) @@ -159,7 +159,7 @@ declaration to the media declaration:: ... js = ('whizbang.js',) >>> w = FancyCalendarWidget() - >>> print w.media + >>> print(w.media) @@ -221,7 +221,7 @@ was ``None``:: ... js = ('animations.js', 'http://othersite.com/actions.js') >>> w = CalendarWidget() - >>> print w.media + >>> print(w.media) @@ -229,7 +229,7 @@ was ``None``:: But if :setting:`STATIC_URL` is ``'http://static.example.com/'``:: >>> w = CalendarWidget() - >>> print w.media + >>> print(w.media) @@ -252,12 +252,12 @@ If you only want media of a particular type, you can use the subscript operator to filter out a medium of interest. For example:: >>> w = CalendarWidget() - >>> print w.media + >>> print(w.media) - >>> print w.media['css'] + >>> print(w.media)['css'] When you use the subscript operator, the value that is returned is a new @@ -282,7 +282,7 @@ the resulting Media object contains the union of the media from both files:: >>> w1 = CalendarWidget() >>> w2 = OtherWidget() - >>> print w1.media + w2.media + >>> print(w1.media + w2.media) diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index 6eadf217cc..df76b8094f 100644 --- a/docs/topics/forms/modelforms.txt +++ b/docs/topics/forms/modelforms.txt @@ -556,7 +556,7 @@ This will create a formset that is capable of working with the data associated with the ``Author`` model. It works just like a regular formset:: >>> formset = AuthorFormSet() - >>> print formset + >>> print(formset) -- cgit v1.3