Package gavo :: Package base :: Module structure
[frames] | no frames]

Module structure

source code

Representation of structured data deserializable from XML.

We want all the managed attribute stuff since the main user input comes from resource descriptors, and we want relatively strong input validation here. Also, lots of fancy copying and crazy cross-referencing is going on in our resource definitions, so we want a certain amount of rigorous structure. Finally, a monolithic parser for that stuff becomes *really* huge and tedious, so I want to keep the XML parsing information in the constructed objects themselves.

Classes
  StructType
is a metaclass for the representation of structured data.
  DataContent
A magic attribute that allows character content to be added to a structure.
  StructureBase
is a base class for all structures.
  ParseableStructure
is a base class for Structures parseable from EventProcessors (and thus XML).
  Structure
is the base class for user-defined structures.
  RestrictionMixin
A mixin for structure classes not allowed in untrusted RDs.
Functions
 
sortAttrs(attrSeq)
evaluates the before attributes on the AttributeDefs in attrsSeq and returns a sequence satisfying them.
source code
 
makeStruct(structClass, **kwargs)
creates a parentless instance of structClass with ``**kwargs``.
source code
Variables
  __package__ = 'gavo.base'
Function Details

sortAttrs(attrSeq)

source code 

evaluates the before attributes on the AttributeDefs in attrsSeq and returns a sequence satisfying them.

It returns a reference to attrSeq for convenience.

makeStruct(structClass, **kwargs)

source code 

creates a parentless instance of structClass with ``**kwargs``.

You can pass in a ``parent_`` kwarg to force a parent.

This is the preferred way to create struct instances in DaCHS, as it will cause the sequence of completers and validators run. Use it like this:

       MS(rscdef.Column, name="ra", type="double precision)