Skip to content

Commit

Permalink
Improve documentation in interface docstring and doctest.
Browse files Browse the repository at this point in the history
  • Loading branch information
alga committed Nov 28, 2013
1 parent 8041229 commit d45c010
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/z3c/form/browser/radio.txt
Expand Up @@ -151,6 +151,8 @@ And independently:
<input id="widget-id-0" name="widget.name" value="true"
class="hidden-widget" type="hidden" />

The unchecked values do not need a hidden field, hence they are empty:

>>> print(widget.renderForValue('false'))


Expand Down Expand Up @@ -182,6 +184,8 @@ And independently:
>>> print(widget.renderForValue('true'))
<span id="widget-id" class="radio-widget"><span class="selected-option">yes</span></span>

Again, unchecked values are not displayed:

>>> print(widget.renderForValue('false'))


Expand Down
5 changes: 4 additions & 1 deletion src/z3c/form/interfaces.py
Expand Up @@ -580,8 +580,11 @@ class IRadioWidget(ISequenceWidget):
"""Radio widget."""

def renderForValue(value):
"""Render a single radio button element for a given value"""
"""Render a single radio button element for a given value.
Here the word ``value`` is used in the HTML sense, in other
words it is a term token.
"""

class ISubmitWidget(IWidget):
"""Submit widget."""
Expand Down

0 comments on commit d45c010

Please sign in to comment.