Package pyxb :: Package binding :: Module facets :: Class CF_enumeration |
[hide private]
[frames] | no frames]

# type CF_enumeration

source code

        object --+
                 |
           cscRoot --+
                     |
                 Facet --+
                         |
         ConstrainingFacet --+
                             |
            object --+       |
                     |       |
               cscRoot --+   |
                         |   |
    _CollectionFacet_mixin --+
                             |
            object --+       |
                     |       |
               cscRoot --+   |
                         |   |
       _LateDatatype_mixin --+
                             |
                            CF_enumeration

Capture a constraint that restricts valid values to a fixed set.

A STD that has an enumeration restriction should mix-in pyxb.binding.basis.enumeration_mixin, and should have a class variable titled `_CF_enumeration` that is an instance of this class.

"unicode" refers to the Unicode string by which the value is represented in XML.

"tag" refers to the Python member reference associated with the enumeration. The value is derived from the unicode value of the enumeration element and an optional prefix that identifies the owning simple type when the tag is promoted to module-level visibility.

"value" refers to the Python value held in the tag

See http://www.w3.org/TR/xmlschema-2/#rf-enumeration

Nested Classes | [hide private]
_CollectionFacet_itemType This class represents individual values that appear within a CF_enumeration collection.

Instance Methods | [hide private]
__init__(self, **kw) Create a facet instance, initializing it from the keyword parameters. | source code
enumPrefix(self) | source code
elements(self) | source code
values(self) Return a list of enumeration values. | source code
itervalues(self) Generate the enumeration values. | source code
addEnumeration(self, **kw) | source code
elementForValue(self, value) Return the _EnumerationElement instance that has the given value. | source code
valueForUnicode(self, ustr) Return the enumeration value corresponding to the given unicode string. | source code
_validateConstraint_vx(self, value) | source code
Inherited from `ConstrainingFacet`: `validateConstraint` Inherited from `ConstrainingFacet` (private): `_setFromKeywords_vb` Inherited from `Facet`: `__str__`, `annotation`, `baseTypeDefinition`, `ownerTypeDefinition`, `setFromKeywords`, `value`, `valueDatatype` Inherited from `Facet` (private): `_value`, `_valueString` Inherited from `_CollectionFacet_mixin`: `items`, `iteritems` Inherited from `_CollectionFacet_mixin` (private): `_items` Inherited from `_LateDatatype_mixin`: `bindValueDatatype`

Class Methods | [hide private]
Inherited from `Facet`: `ClassForFacet`, `Name` Inherited from `_LateDatatype_mixin`: `BindingValueDatatype`, `LateDatatypeBindsSuperclass`

Class Variables | [hide private]
| _Name = ``'``enumeration``'``
| _LateDatatypeBindsSuperclass = `False` The class variable that indicates that the Subclasses must override this variable with a value of `True` or `False`.
| __tagToElement = `None`
| __valueToElement = `None`
| __unicodeToElement = `None`
| __enumPrefix = `None`
Inherited from `ConstrainingFacet`: `Facets` Inherited from `ConstrainingFacet` (private): `_FacetPrefix` Inherited from `Facet` (private): `_ValueDatatype` Inherited from `_CollectionFacet_mixin` (private): `_CollectionFacet_mixin__items`

Method Details | [hide private]

### __init__(self, **kw) (Constructor) | source code
Create a facet instance, initializing it from the keyword parameters. Overrides: cscRoot.__init__

### elements(self) | source code
Deprecated: Use items or iteritems instead.

### elementForValue(self, value) | source code
Return the _EnumerationElement instance that has the given value. Raises: `KeyError` - the value is not valid for the enumeration.

### valueForUnicode(self, ustr) | source code
Return the enumeration value corresponding to the given unicode string. If ustr is not a valid option for this enumeration, return None.

### _validateConstraint_vx(self, value) | source code
Overrides: ConstrainingFacet._validateConstraint_vx