Exemplo n.º 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)
Exemplo n.º 2
0
 def test_unicode(self):
     s = u'\x34\x55\x65\x34'
     self.assertEquals(4, len(s))
     element = etree.Element('test')
     String.to_parent_element(s, 'test_ns', element)
     element = element[0]
     value = String.from_xml(element)
     self.assertEquals(value, s)
Exemplo n.º 3
0
 def test_unicode(self):
     s = u'\x34\x55\x65\x34'
     self.assertEquals(4, len(s))
     element = etree.Element('test')
     String.to_parent_element(s, 'test_ns', element)
     element = element[0]
     value = String.from_xml(element)
     self.assertEquals(value, s)
Exemplo n.º 4
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')
Exemplo n.º 5
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')
Exemplo n.º 6
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)
Exemplo n.º 7
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)
Exemplo n.º 8
0
class SimpleModel(ClassModel):
    class Annotations(ClassModel.Annotations):
        doc = """Simple Model doc here:)"""

    __namespace__ = "SimpleModel"
    text = String(doc="Simple Model doc here:)")
Exemplo n.º 9
0
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)
Exemplo n.º 10
0
from soaplib.core.model.primitive import Integer
from soaplib.core.model.primitive import String
from soaplib.core.model.clazz import ClassModel
from soaplib.core.model.clazz import XMLAttribute
from soaplib.core.model.clazz import XMLAttributeRef

from wsrplib.namespaces import WSRP_TYPES_NAMESPACE

def _makeSeq(cls):
    return cls.customize(min_occurs=0, max_occurs="unbounded", nillable=False)

def _makeNotNillable(cls):
    return cls.customize(min_occurs=0, nillable=False)

StringSeq = _makeSeq(String)
StringSeqNotEmpty = String.customize(min_occurs=1, max_occurs="unbounded",
                                     nillable=False)
AnySeq = _makeSeq(Any)


class _WSRPSerializer(ClassModel):
    __namespace__ = WSRP_TYPES_NAMESPACE


class _WSRPString(String):
    __namespace__ = WSRP_TYPES_NAMESPACE
    __base_type__ = String


class _WSRPMandatoryString(String):
    __namespace__ = WSRP_TYPES_NAMESPACE
    __base_type__ = String