Example #1
0
class Address(ClassModel):
    street = String(min_occurs=1)
    city = String(min_occurs=1)
    zip = Integer(min_occurs=1)
    since = DateTime(min_occurs=1)
    lattitude = Float(min_occurs=1)
    longitude = Float(min_occurs=1)
Example #2
0
class SisMsg(ClassModel):
    """
    Container with metadata for Jiva integration messages
    carried in the MQ payload.
    """
    data_source = String(nillable=False,
                         min_occurs=1,
                         max_occurs=1,
                         max_len=50)
    direction = String(nillable=False, min_occurs=1, max_occurs=1, max_len=50)
    interface_name = String(nillable=False,
                            min_occurs=1,
                            max_occurs=1,
                            max_len=50)
    crt_dt = DateTime(nillable=False)
Example #3
0
    def test_string(self):
        s = String()
        element = etree.Element('test')
        String.to_parent_element('value', ns_test, element)
        element = element[0]

        self.assertEquals(element.text, 'value')
        value = String.from_xml(element)
        self.assertEquals(value, 'value')
Example #4
0
class NonNillableClass(ClassModel):
    __namespace__ = "hunk.sunk"

    nillable = False
    min_occurs = 1

    dt = DateTime(min_occurs=1, nillable=False)
    i = Integer(nillable=False)
    s = String(min_len=1, nillable=False)
Example #5
0
class SimpleModel(ClassModel):
    class Annotations(ClassModel.Annotations):
        doc = """Simple Model doc here:)"""

    __namespace__ = "SimpleModel"
    text = String(doc="Simple Model doc here:)")
class NillMinOccursModel(ClassModel):
    __namespace__ = "tns"

    nillable_only = String(nillable=True, min_occurs=1)
    nillabl_min_occ_zero = String(nillable=True, min_occurs=0)
    min_occ_int = Integer(nillable=True, min_occurs=1)