Author: Alex
Date: 2010-11-17 10:08:28 -0600 (Wed, 17 Nov 2010)
New Revision: 14598
Modified:
django/trunk/docs/topics/forms/media.txt
django/trunk/docs/topics/i18n/internationalization.txt
Log:
Corrected some syntax issues in the docs.
Modified: django/trunk/docs/topics/forms/media.txt
===================================================================
--- django/trunk/docs/topics/forms/media.txt 2010-11-17 15:46:11 UTC (rev
14597)
+++ django/trunk/docs/topics/forms/media.txt 2010-11-17 16:08:28 UTC (rev
14598)
@@ -132,11 +132,11 @@
basic Calendar widget from the example above::
>>> class FancyCalendarWidget(CalendarWidget):
- class Media:
- css = {
- 'all': ('fancy.css',)
- }
- js = ('whizbang.js',)
+ ... class Media:
+ ... css = {
+ ... 'all': ('fancy.css',)
+ ... }
+ ... js = ('whizbang.js',)
>>> w = FancyCalendarWidget()
>>> print w.media
@@ -151,12 +151,12 @@
declaration to the media declaration::
>>> class FancyCalendarWidget(CalendarWidget):
- class Media:
- extend = False
- css = {
- 'all': ('fancy.css',)
- }
- js = ('whizbang.js',)
+ ... class Media:
+ ... extend = False
+ ... css = {
+ ... 'all': ('fancy.css',)
+ ... }
+ ... js = ('whizbang.js',)
>>> w = FancyCalendarWidget()
>>> print w.media
@@ -214,11 +214,11 @@
was ``None``::
>>> class CalendarWidget(forms.TextInput):
- class Media:
- css = {
- 'all': ('/css/pretty.css',),
- }
- js = ('animations.js', 'http://othersite.com/actions.js')
+ ... class Media:
+ ... css = {
+ ... 'all': ('/css/pretty.css',),
+ ... }
+ ... js = ('animations.js', 'http://othersite.com/actions.js')
>>> w = CalendarWidget()
>>> print w.media
@@ -270,15 +270,15 @@
the resulting Media object contains the union of the media from both files::
>>> class CalendarWidget(forms.TextInput):
- class Media:
- css = {
- 'all': ('pretty.css',)
- }
- js = ('animations.js', 'actions.js')
+ ... class Media:
+ ... css = {
+ ... 'all': ('pretty.css',)
+ ... }
+ ... js = ('animations.js', 'actions.js')
>>> class OtherWidget(forms.TextInput):
- class Media:
- js = ('whizbang.js',)
+ ... class Media:
+ ... js = ('whizbang.js',)
>>> w1 = CalendarWidget()
>>> w2 = OtherWidget()
@@ -301,8 +301,8 @@
of adding the media definitions for all widgets that are part of the form::
>>> class ContactForm(forms.Form):
- date = DateField(widget=CalendarWidget)
- name = CharField(max_length=40, widget=OtherWidget)
+ ... date = DateField(widget=CalendarWidget)
+ ... name = CharField(max_length=40, widget=OtherWidget)
>>> f = ContactForm()
>>> f.media
@@ -315,14 +315,14 @@
layout -- simply add a media declaration to the form::
>>> class ContactForm(forms.Form):
- date = DateField(widget=CalendarWidget)
- name = CharField(max_length=40, widget=OtherWidget)
+ ... date = DateField(widget=CalendarWidget)
+ ... name = CharField(max_length=40, widget=OtherWidget)
+ ...
+ ... class Media:
+ ... css = {
+ ... 'all': ('layout.css',)
+ ... }
- class Media:
- css = {
- 'all': ('layout.css',)
- }
-
>>> f = ContactForm()
>>> f.media
<link href="http://media.example.com/pretty.css" type="text/css"
media="all" rel="stylesheet" />
Modified: django/trunk/docs/topics/i18n/internationalization.txt
===================================================================
--- django/trunk/docs/topics/i18n/internationalization.txt 2010-11-17
15:46:11 UTC (rev 14597)
+++ django/trunk/docs/topics/i18n/internationalization.txt 2010-11-17
16:08:28 UTC (rev 14598)
@@ -117,7 +117,7 @@
This also works in templates with the :ttag:`comment` tag:
-.. code-block:: django+html
+.. code-block:: html+django
{% comment %}Translators: This is a text of the base template {%
endcomment %}
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.