Esempio n. 1
0
class SisMsg(ComplexModel):
    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)
Esempio n. 2
0
class SisMsg(ComplexModel):
    """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)
Esempio n. 3
0
def _get_spyne_type(v):
    """This function maps sqlalchemy types to spyne types."""

    rpc_type = None

    if isinstance(v.type, sqlalchemy.Enum):
        if v.type.convert_unicode:
            rpc_type = Unicode(values=v.type.enums)
        else:
            rpc_type = Enum(*v.type.enums, **{'type_name': v.type.name})

    elif isinstance(v.type, sqlalchemy.Unicode):
        rpc_type = Unicode(v.type.length)

    elif isinstance(v.type, sqlalchemy.UnicodeText):
        rpc_type = Unicode

    elif isinstance(v.type, sqlalchemy.Text):
        rpc_type = String

    elif isinstance(v.type, sqlalchemy.String):
        rpc_type = String(v.type.length)

    elif isinstance(v.type, (sqlalchemy.Numeric)):
        rpc_type = Decimal(v.type.precision, v.type.scale)

    elif isinstance(v.type, PGXml):
        rpc_type = AnyXml

    elif isinstance(v.type, PGHtml):
        rpc_type = AnyHtml

    elif type(v.type) in _sq2sp_type_map:
        rpc_type = _sq2sp_type_map[type(v.type)]

    elif isinstance(v.type, (PGObjectJson, PGObjectXml)):
        rpc_type = v.type.cls

    elif isinstance(v.type, PGFileJson):
        rpc_type = v.FileData

    else:
        raise Exception("Spyne type was not found. Probably _sq2sp_type_map "
                        "needs a new entry. %r" % v)

    return rpc_type
Esempio n. 4
0
 class ResponseHeader(ComplexModel):
     _type_info = {
         'Set-Cookie': String(max_occurs='unbounded'),
         'Expires': DateTime
     }
Esempio n. 5
0
 class CM(ComplexModel):
     _type_info = [
         ("i", Integer),
         ("s", String(default='default')),
     ]
Esempio n. 6
0
 class SomeService(ServiceBase):
     @srpc(String(max_occurs='unbounded'), _returns=String)
     def some_call(s):
         return '\n'.join(s)