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)
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)
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')
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)
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)