Package Gnumed :: Package wxpython :: Module gmDemographicsWidgets :: Class cFormDTD
[frames] | no frames]

Class cFormDTD

source code

Simple Data Transfer Dictionary class to make easy the trasfer of data between the form (view) and the business logic.

Maybe later consider turning this into a standard dict by {}.fromkeys([key, key, ...], default) when it becomes clear that we really don't need the added potential of a full-fledged class.

Instance Methods
 
__init__(self, fields)
Initialize the DTD with the supplied field names.
source code
 
__getitem__(self, attribute)
Retrieve the value of the given attribute (key) @param attribute The attribute (key) to retrieve its value for.
source code
 
__setitem__(self, attribute, value)
Set the value of a given attribute (key).
source code
 
__str__(self)
Print string representation of the DTD object.
source code
Method Details

__init__(self, fields)
(Constructor)

source code 

Initialize the DTD with the supplied field names. @param fields The names of the fields. @type fields A TupleType instance.

__getitem__(self, attribute)
(Indexing operator)

source code 

Retrieve the value of the given attribute (key) @param attribute The attribute (key) to retrieve its value for. @type attribute a StringType instance.

__setitem__(self, attribute, value)
(Index assignment operator)

source code 

Set the value of a given attribute (key). @param attribute The attribute (key) to set its value for. @type attribute a StringType instance. @param avaluee The value to set. @rtpe attribute a StringType instance.