Package gchecky :: Module gxml :: Class Complex
[hide private]
[frames] | no frames]

Class Complex

source code

object --+    
         |    
     Field --+
             |
            Complex

Represents a field which is not a simple POD but a complex data structure. An example - a price in USD:
   price = gxml.Complex('/unit-price', gxml.price_t)


Instance Methods [hide private]
 
__init__(self, path, clazz, **kwargs)
Initialize the Complex instance.
source code
 
validate(self, data)
Checks if the data is an instance of the clazz.
source code
 
save(self, node, data)
Store the data as a complex structure.
source code
 
load(self, node)
Load the complex data from an xml DOM node.
source code
 
__repr__(self)
Override Field.__repr__ for documentation purposes.
source code

Inherited from Field: create_node_for_path, data2str, get_any_node_for_path, get_initial_value, get_nodes_for_path, get_one_node_for_path, str2data

Inherited from Field (private): _traits

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Methods [hide private]

Inherited from Field: deconstruct_path, reconstruct_path

Class Variables [hide private]
  clazz = None
The class meta-Field instance describing this field data.
Instance Variables [hide private]

Inherited from Field: default, empty, path, required, save_node_and_xml, values

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, path, clazz, **kwargs)
(Constructor)

source code 
Initialize the Complex instance.
Parameters:
  • path - Field.path
  • clazz - a Node subclass descibing the field data values.
Overrides: Field.__init__

validate(self, data)

source code 
Checks if the data is an instance of the clazz.
Overrides: Field.validate

save(self, node, data)

source code 
Store the data as a complex structure.
Overrides: Field.save

load(self, node)

source code 
Load the complex data from an xml DOM node.
Overrides: Field.load

__repr__(self)
(Representation operator)

source code 
Override Field.__repr__ for documentation purposes.
Overrides: Field.__repr__