Section » fieldset

fieldset(name) → Fieldset or None
fieldset(name, options) → Fieldset or None

Retrieve a fieldset from the section, optionally supplying an options.

enocolor ratings:
red = 5
green = 7
blue = 3
python>>> document = enopy.parse(input)

>>> document.fieldset('color ratings')
<class Fieldset name="color ratings" entries=3>
>>> document.fieldset('temperature ratings')
ValidationError: ...
>>> document.fieldset('temperature ratings', required=False)
None
>>> document.fieldset('temperature ratings', enforce_element=True)
ValidationError: ...

Parameters

name

A string representing the name of the field to return.

options

enforce_element

A boolean stating whether the fieldset must exist in the document. (defaults to False)

required

Alias for enforce_element (this exists on many methods and depending on context refers to either element or value)

Return value

An Fieldset, or None.