MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / SchemaObject

Class SchemaObject

suds/xsd/sxbase.py:32–504  ·  view source on GitHub ↗

A schema object is an extension to object object with with schema awareness. @ivar root: The XML root element. @type root: L{Element} @ivar schema: The schema containing this object. @type schema: L{schema.Schema} @ivar form_qualified: A flag that inidcates that @element

Source from the content-addressed store, hash-verified

30
31
32class SchemaObject(object):
33 """
34 A schema object is an extension to object object with
35 with schema awareness.
36 @ivar root: The XML root element.
37 @type root: L{Element}
38 @ivar schema: The schema containing this object.
39 @type schema: L{schema.Schema}
40 @ivar form_qualified: A flag that inidcates that @elementFormDefault
41 has a value of I{qualified}.
42 @type form_qualified: boolean
43 @ivar nillable: A flag that inidcates that @nillable
44 has a value of I{true}.
45 @type nillable: boolean
46 @ivar default: The default value.
47 @type default: object
48 @ivar rawchildren: A list raw of all children.
49 @type rawchildren: [L{SchemaObject},...]
50 """
51
52 @classmethod
53 def prepend(cls, d, s, filter=Filter()):
54 """
55 Prepend schema object's from B{s}ource list to
56 the B{d}estination list while applying the filter.
57 @param d: The destination list.
58 @type d: list
59 @param s: The source list.
60 @type s: list
61 @param filter: A filter that allows items to be prepended.
62 @type filter: L{Filter}
63 """
64 i = 0
65 for x in s:
66 if x in filter:
67 d.insert(i, x)
68 i += 1
69
70 @classmethod
71 def append(cls, d, s, filter=Filter()):
72 """
73 Append schema object's from B{s}ource list to
74 the B{d}estination list while applying the filter.
75 @param d: The destination list.
76 @type d: list
77 @param s: The source list.
78 @type s: list
79 @param filter: A filter that allows items to be appended.
80 @type filter: L{Filter}
81 """
82 for item in s:
83 if item in filter:
84 d.append(item)
85
86 def __init__(self, schema, root):
87 """
88 @param schema: The containing schema.
89 @type schema: L{schema.Schema}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected