Package suds :: Package xsd :: Module sxbase :: Class SchemaObject
[hide private]
[frames] | no frames]

Class SchemaObject

source code

object --+
         |
        SchemaObject
Known Subclasses:

A schema object is an extension to object object with with schema awareness.

Instance Methods [hide private]
 
__getitem__(self, index) source code
 
__init__(self, schema, root)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__iter__(self) source code
 
__len__(self) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
__unicode__(self) source code
boolean
all(self)
Get whether this is an <xs:all/>
source code
boolean
any(self)
Get whether this is an <xs:any/>
source code
[(SchemaObject, [SchemaObject,..]),..]
attributes(self, filter=Filter())
Get only the attribute content.
source code
list
autoqualified(self)
The list of auto qualified attribute values.
source code
boolean
builtin(self)
Get whether this is a schema-instance (xs) type.
source code
[(SchemaObject, [SchemaObject,..]),..]
children(self, filter=Filter())
Get only the direct or non-attribute content.
source code
[str,...]
childtags(self)
Get a list of valid child tag names.
source code
boolean
choice(self)
Get whether this is n <xs:choice/>
source code
list
content(self, collection=None, filter=Filter(), history=None)
Get a flattened list of this nodes contents.
source code
 
default_namespace(self) source code
(int, [SchemaObject,...])
dependencies(self)
Get a list of dependancies for dereferencing.
source code
[str,...]
description(self)
Get the names used for str() and repr() description.
source code
boolean
enum(self)
Get whether this is a simple-type containing an enumeration.
source code
boolean
extension(self)
Get whether the object is an extension of another type.
source code
SchemaObject
find(self, qref, classes=())
Find a referenced type in self or children.
source code
(SchemaObject, [SchemaObject,..])
get_attribute(self, name)
Get (find) a non-attribute attribute by name.
source code
(SchemaObject, [SchemaObject,..])
get_child(self, name)
Get (find) a non-attribute child by name.
source code
boolean
isattr(self)
Get whether the object is a schema attribute definition.
source code
 
merge(self, other)
Merge another object as needed.
source code
 
mixed(self)
Get whether this mixed content.
source code
(prefix,URI)
namespace(self, prefix=None)
Get this properties namespace
source code
boolean
optional(self)
Get whether this type is optional.
source code
 
qualify(self)
Convert attribute values, that are references to other objects, into qref.
source code
boolean
required(self)
Get whether this type is required.
source code
SchemaObject
resolve(self, nobuiltin=False)
Resolve and return the nodes true self.
source code
boolean
restriction(self)
Get whether the object is an restriction of another type.
source code
boolean
sequence(self)
Get whether this is an <xs:sequence/>
source code
str
str(self, indent=0, history=None)
Get a string representation of this object.
source code
 
translate(self, value, topython=True)
Translate a value (type) to/from a python type.
source code
boolean
unbounded(self)
Get whether this node is unbounded (a collection)
source code
boolean
xslist(self)
Get whether this is an <xs:list/>
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
append(cls, d, s, filter=Filter())
Append schema object's from source list to the destination list while applying the filter.
source code
 
prepend(cls, d, s, filter=Filter())
Prepend schema object's from source list to the destination list while applying the filter.
source code
Instance Variables [hide private]
object default
The default value.
boolean form_qualified
A flag that inidcates that @elementFormDefault has a value of qualified.
boolean nillable
A flag that inidcates that @nillable has a value of true.
[SchemaObject,...] rawchildren
A list raw of all children.
Element root
The XML root element.
schema.Schema schema
The schema containing this object.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, schema, root)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

all(self)

source code 

Get whether this is an <xs:all/>

Returns: boolean
True if any, else False

any(self)

source code 

Get whether this is an <xs:any/>

Returns: boolean
True if any, else False

append(cls, d, s, filter=Filter())
Class Method

source code 

Append schema object's from source list to the destination list while applying the filter.

Parameters:
  • d (list) - The destination list.
  • s (list) - The source list.
  • filter (Filter) - A filter that allows items to be appended.

attributes(self, filter=Filter())

source code 

Get only the attribute content.

Parameters:
  • filter (Filter) - A filter to constrain the result.
Returns: [(SchemaObject, [SchemaObject,..]),..]
A list of tuples (attr, ancestry)

autoqualified(self)

source code 

The list of auto qualified attribute values. Qualification means to convert values into qref.

Returns: list
A list of attibute names.

builtin(self)

source code 

Get whether this is a schema-instance (xs) type.

Returns: boolean
True if any, else False

children(self, filter=Filter())

source code 

Get only the direct or non-attribute content.

Parameters:
  • filter (Filter) - A filter to constrain the result.
Returns: [(SchemaObject, [SchemaObject,..]),..]
A list tuples: (child, ancestry)

childtags(self)

source code 

Get a list of valid child tag names.

Returns: [str,...]
A list of child tag names.

choice(self)

source code 

Get whether this is n <xs:choice/>

Returns: boolean
True if any, else False

content(self, collection=None, filter=Filter(), history=None)

source code 

Get a flattened list of this nodes contents.

Parameters:
  • collection (list) - A list to fill.
  • filter (Filter) - A filter used to constrain the result.
  • history (list) - The history list used to prevent cyclic dependency.
Returns: list
The filled list.

dependencies(self)

source code 

Get a list of dependancies for dereferencing.

Returns: (int, [SchemaObject,...])
A merge dependancy index and a list of dependancies.

description(self)

source code 

Get the names used for str() and repr() description.

Returns: [str,...]
A dictionary of relavent attributes.

enum(self)

source code 

Get whether this is a simple-type containing an enumeration.

Returns: boolean
True if any, else False

extension(self)

source code 

Get whether the object is an extension of another type.

Returns: boolean
True if an extension, else False.

find(self, qref, classes=())

source code 

Find a referenced type in self or children.

Parameters:
  • qref (qref) - A qualified reference.
  • classes ([class,...]) - A list of classes used to qualify the match.
Returns: SchemaObject
The referenced type.

See Also: qualify()

get_attribute(self, name)

source code 

Get (find) a non-attribute attribute by name.

Parameters:
  • name (str) - A attribute name.
Returns: (SchemaObject, [SchemaObject,..])
A tuple: the requested (attribute, ancestry).

get_child(self, name)

source code 

Get (find) a non-attribute child by name.

Parameters:
  • name (str) - A child name.
Returns: (SchemaObject, [SchemaObject,..])
A tuple: the requested (child, ancestry).

isattr(self)

source code 

Get whether the object is a schema attribute definition.

Returns: boolean
True if an attribute, else False.

namespace(self, prefix=None)

source code 

Get this properties namespace

Parameters:
  • prefix (str) - The default prefix.
Returns: (prefix,URI)
The schema's target namespace

optional(self)

source code 

Get whether this type is optional.

Returns: boolean
True if optional, else False

prepend(cls, d, s, filter=Filter())
Class Method

source code 

Prepend schema object's from source list to the destination list while applying the filter.

Parameters:
  • d (list) - The destination list.
  • s (list) - The source list.
  • filter (Filter) - A filter that allows items to be prepended.

qualify(self)

source code 

Convert attribute values, that are references to other objects, into qref. Qualfied using default document namespace. Since many wsdls are written improperly: when the document does not define a default namespace, the schema target namespace is used to qualify references.

required(self)

source code 

Get whether this type is required.

Returns: boolean
True if required, else False

resolve(self, nobuiltin=False)

source code 

Resolve and return the nodes true self.

Parameters:
  • nobuiltin - Flag indicates that resolution must not continue to include xsd builtins.
Returns: SchemaObject
The resolved (true) type.

restriction(self)

source code 

Get whether the object is an restriction of another type.

Returns: boolean
True if an restriction, else False.

sequence(self)

source code 

Get whether this is an <xs:sequence/>

Returns: boolean
True if <xs:sequence/>, else False

str(self, indent=0, history=None)

source code 

Get a string representation of this object.

Parameters:
  • indent (int) - The indent.
Returns: str
A string.

translate(self, value, topython=True)

source code 

Translate a value (type) to/from a python type.

Parameters:
  • value - A value to translate.
Returns:
The converted language type.

unbounded(self)

source code 

Get whether this node is unbounded (a collection)

Returns: boolean
True if unbounded, else False.

xslist(self)

source code 

Get whether this is an <xs:list/>

Returns: boolean
True if any, else False