Package pyxb :: Package binding :: Module datatypes :: Class duration
[hide private]
[frames] | no frames]

Class duration

source code

                    object --+                
                             |                
                       cscRoot --+            
                                 |            
     utils.utility.Locatable_mixin --+        
                                     |        
              basis._TypeBinding_mixin --+    
                                         |    
                            object --+   |    
                                     |   |    
utils.utility._DeconflictSymbols_mixin --+    
                                         |    
                        object --+       |    
                                 |       |    
                           cscRoot --+   |    
                                     |   |    
            basis._DynamicCreate_mixin --+    
                                         |    
                basis.simpleTypeDefinition --+
                                             |
                                object --+   |
                                         |   |
                        datetime.timedelta --+
                                             |
                                            duration

XMLSchema datatype duration.

This class uses the Python datetime.timedelta class as its underlying representation. This works fine as long as no months or years are involved, and no negative durations are involved. Because the XML Schema value space is so much larger, it is kept distinct from the Python value space, which reduces to integral days, seconds, and microseconds.

In other words, the implementation of this type is a little shakey.

Nested Classes [hide private]
  _XsdBaseType
XMLSchema datatype anySimpleType.
Instance Methods [hide private]
 
negativeDuration(self) source code
 
durationData(self) source code

Inherited from basis.simpleTypeDefinition: __init__, pythonLiteral, xsdConstraintsOK, xsdLiteral, xsdValueLength

Inherited from basis._TypeBinding_mixin: __setattr__, toDOM, toxml, validateBinding

Inherited from datetime.timedelta: __abs__, __add__, __div__, __eq__, __floordiv__, __ge__, __getattribute__, __gt__, __hash__, __le__, __lt__, __mul__, __ne__, __neg__, __nonzero__, __pos__, __radd__, __rdiv__, __reduce__, __repr__, __rfloordiv__, __rmul__, __rsub__, __str__, __sub__, total_seconds

Inherited from object: __delattr__, __format__, __reduce_ex__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
XsdLiteral(cls, value)
Convert from a python value to a string usable in an XML document.
source code

Inherited from basis.simpleTypeDefinition: PythonLiteral, SimpleTypeDefinition, XsdConstraintsOK, XsdSuperType, XsdValueLength

Inherited from basis._TypeBinding_mixin: Factory

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, *args, **kw) source code
Class Variables [hide private]
  _ExpandedName = pyxb.namespace.XMLSchema.createExpandedName('d...
The expanded name of the component.
  __Lexical_re = re.compile(r'^(?P<neg>-?)P((?P<years>\d+)Y)?((?...
  __XSDFields = ('years', 'months', 'days', 'hours', 'minutes', ...
  __PythonFields = ('days', 'seconds', 'microseconds', 'minutes'...
  __negativeDuration = None
hash(x)
  __durationData = None
hash(x)
  _CF_enumeration = <pyxb.binding.facets.CF_enumeration object a...
  _CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object...
  _CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object...
  _CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object...
  _CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object...
  _CF_pattern = <pyxb.binding.facets.CF_pattern object at 0x1374...
  _CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object at ...
  __SimpleTypeDefinition = <pyxb.xmlschema.structures.SimpleType...
  _httpwww_w3_org2001XMLSchema_duration_FacetMap = {<class 'pyxb...

Inherited from basis.simpleTypeDefinition (private): _ReservedSymbols

Inherited from datetime.timedelta: max, min, resolution

Properties [hide private]

Inherited from datetime.timedelta: days, microseconds, seconds

Inherited from object: __class__

Method Details [hide private]

__new__(cls, *args, **kw)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

XsdLiteral(cls, value)
Class Method

source code 

Convert from a python value to a string usable in an XML document.

This should be implemented in the subclass.

Overrides: basis.simpleTypeDefinition.XsdLiteral
(inherited documentation)

Class Variable Details [hide private]

_ExpandedName

The expanded name of the component.

Value:
pyxb.namespace.XMLSchema.createExpandedName('duration')

__Lexical_re

Value:
re.compile(r'^(?P<neg>-?)P((?P<years>\d+)Y)?((?P<months>\d+)M)?((?P<da\
ys>\d+)D)?(?P<Time>T((?P<hours>\d+)H)?((?P<minutes>\d+)M)?(((?P<second\
s>\d+)(?P<fracsec>\.\d+)?)S)?)?$')

__XSDFields

Value:
('years', 'months', 'days', 'hours', 'minutes', 'seconds')

__PythonFields

Value:
('days', 'seconds', 'microseconds', 'minutes', 'hours')

_CF_enumeration

Value:
<pyxb.binding.facets.CF_enumeration object at 0x1374e10>

_CF_maxExclusive

Value:
<pyxb.binding.facets.CF_maxExclusive object at 0x1374f10>

_CF_maxInclusive

Value:
<pyxb.binding.facets.CF_maxInclusive object at 0x1374f50>

_CF_minExclusive

Value:
<pyxb.binding.facets.CF_minExclusive object at 0x1374e50>

_CF_minInclusive

Value:
<pyxb.binding.facets.CF_minInclusive object at 0x1374ed0>

_CF_pattern

Value:
<pyxb.binding.facets.CF_pattern object at 0x1374dd0>

_CF_whiteSpace

Value:
<pyxb.binding.facets.CF_whiteSpace object at 0x1374e90>

__SimpleTypeDefinition

Value:
<pyxb.xmlschema.structures.SimpleTypeDefinition object at 0x1afd490>

_httpwww_w3_org2001XMLSchema_duration_FacetMap

Value:
{<class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_\
whiteSpace object at 0x1374e90>,
 <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.C\
F_minInclusive object at 0x1374ed0>,
 <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.C\
F_maxInclusive object at 0x1374f50>,
 <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.C\
F_minExclusive object at 0x1374e50>,
...