The FieldFactory class provides a means of creating the appropiate object to handle a given field type. More...
Public Member Functions | |
| def | create |
| This function creates a new instance of the appropiate class for the given field type. | |
Static Public Attributes | |
| dictionary | types |
| The types property holds the class that will be called whenever a new object has to be created for a given field type. | |
The FieldFactory class provides a means of creating the appropiate object to handle a given field type.
By default some classes exist for many file types but if you create new types or want to replace current implementations you can do it too.
Definition at line 417 of file Field.py.
| def Koo::Model::Field::FieldFactory::create | ( | type, | ||
| parent, | ||||
| attributes | ||||
| ) |
dictionary Koo::Model::Field::FieldFactory::types [static] |
{
'char' : StringField,
'binary' : BinaryField,
'binary-size': BinarySizeField,
'image' : BinaryField,
'float_time': FloatField,
'integer' : IntegerField,
'float' : FloatField,
'many2one' : ManyToOneField,
'many2many' : ManyToManyField,
'one2many' : OneToManyField,
'reference' : ReferenceField,
'selection': SelectionField,
'boolean': IntegerField,
}
The types property holds the class that will be called whenever a new object has to be created for a given field type.
By default there's a number of field types but new ones can be easily created or existing ones replaced.