summaryrefslogtreecommitdiff
path: root/horizon/forms
diff options
context:
space:
mode:
authorDavid Lyle <david.lyle@intel.com>2015-08-18 17:13:29 -0600
committerDavid Lyle <david.lyle@intel.com>2015-08-18 17:14:22 -0600
commitefafd2ba9693aa27bf62561f39d98cc2361ce280 (patch)
tree482e9ab39bc55d6de8cb4aa440d085a44b938cea /horizon/forms
parent6fbb70ebf20aec04b5a21640d43f21eab8493119 (diff)
downloadhorizon-efafd2ba9693aa27bf62561f39d98cc2361ce280.tar.gz
Fixing docstring formatting errors and warnings
Correcting numerous errors and warnings for doc generation. Partial-Bug: #1486222 Change-Id: I6d6b20a433aa9965a1bafbd098e64b19886e5fca
Diffstat (limited to 'horizon/forms')
-rw-r--r--horizon/forms/fields.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/horizon/forms/fields.py b/horizon/forms/fields.py
index 3ded97b1e..fab6b1061 100644
--- a/horizon/forms/fields.py
+++ b/horizon/forms/fields.py
@@ -147,30 +147,31 @@ class SelectWidget(widgets.Select):
for the option object. It returns a dictionary
containing the html attributes and their values.
For example, to define a title attribute for the
- choices:
+ choices::
- helpText = { 'Apple': 'This is a fruit',
- 'Carrot': 'This is a vegetable' }
+ helpText = { 'Apple': 'This is a fruit',
+ 'Carrot': 'This is a vegetable' }
- def get_title(data):
- text = helpText.get(data, None)
- if text:
- return {'title': text}
- else:
- return {}
+ def get_title(data):
+ text = helpText.get(data, None)
+ if text:
+ return {'title': text}
+ else:
+ return {}
+
+ ....
+ ....
- ....
- ....
+ widget=forms.SelectWidget( attrs={'class': 'switchable',
+ 'data-slug': 'source'},
+ transform_html_attrs=get_title )
- widget=forms.SelectWidget( attrs={'class': 'switchable',
- 'data-slug': 'source'},
- transform_html_attrs=get_title )
+ self.fields[<field name>].choices =
+ ([
+ ('apple','Apple'),
+ ('carrot','Carrot')
+ ])
- self.fields[<field name>].choices =
- ([
- ('apple','Apple'),
- ('carrot','Carrot')
- ])
"""
def __init__(self, attrs=None, choices=(), data_attrs=(), transform=None,
transform_html_attrs=None):