Beispiel #1
0
class StockPrice(xsd.ComplexType):
    nillable = xsd.Element(xsd.Int, nillable=True)
    prices = xsd.ListElement(xsd.Decimal(fractionDigits=2),
                             tagname="price",
                             minOccurs=0,
                             maxOccurs=xsd.UNBOUNDED,
                             nillable=True)
Beispiel #2
0
 def test_can_restrict_acceptable_values_with_pattern(self):
     self.xsd_type = xsd.Decimal(pattern='1.')
     self.assert_can_set(12)
     self.assert_can_not_set(123)
Beispiel #3
0
 class Test(xsd.ComplexType):
     value = xsd.Element(xsd.Decimal(pattern=r'1+'))
Beispiel #4
0
 class Test(xsd.ComplexType):
     value = xsd.Element(xsd.Decimal(totalDigits=4))
Beispiel #5
0
 class Test(xsd.ComplexType):
     value = xsd.Element(xsd.Decimal(minExclusive=-100, maxExclusive=0))
Beispiel #6
0
 class Test(xsd.ComplexType):
     value = xsd.Element(xsd.Decimal(minInclusive=0, maxInclusive=100))
Beispiel #7
0
 class Test(xsd.ComplexType):
     float = xsd.Element(xsd.Decimal(fractionDigits=2))
Beispiel #8
0
 class Test(xsd.ComplexType):
     integer = xsd.Element(xsd.Decimal(enumeration=[1, 2, 3]))
Beispiel #9
0
 class Test(xsd.ComplexType):
     float = xsd.Element(xsd.Decimal())