Extracted at 2014-06-26.
pike.ida.liu.se
[Top]
Fins
Fins.FinsModel

Class Fins.FinsModel

Description

configures any models defined in the application's configuration file. this method is automatically called by the constructor.

an application normally contains a default model, which is specified in the "model" section of the application's configuration file. additional model definitions can be specified in the configuration file by adding sections whose name is in the form of "model_x" where x is some unique identifier.

valid configuration values for a model definition include "id", "datasource", "definition_module" and "debug". The "datasource" attribute is mandatory for all model definitions; "definition_module" and "id" are mandatory for all definitions other than the default, and all other attributes are optional for all model definitions.

when each model is loaded, a database connection will be made and all registered data types will be configured, either manually or automatically using database reflection. Additionally the default context for each model definition will be registered in Fins.DataSources using the value of its "id" attribute as the key.

in addition to being available from Fins.Model, the default model is also available from Fins.Datasources by its "id" attribute, or if no "id" is specified, using the key Fins.Model.DEFAULT_MODEL , or "_default".

Example

// get a context for the default model Fins.Model.DataModelContext ctx = Fins.DataSources._default; // get a context for the model whose configuration specifies an "id" of "my_additional_model" Fins.Model.DataModelContext ctx2 = Fins.DataSources.my_additional_model; // alternately, you can use get_context(): Fins.Model.DataModelContext ctx2 = Fins.Model.get_context("my_additional_model");



Inherit FinsBase

inherit FinsBase : FinsBase


Variable lower_case_link_names

int Fins.FinsModel.lower_case_link_names

Description

normally, fields that represent references between objects will be created using the referenced type's proper object name using mixed case (such as "User"). If this field is set to true, the reference will be created using lower case (such as "user").