Module bazaar.config
Module contains basic classes for Bazaar ORM layer configuration.
Bazaar ORM layer is configurable. It is possible to specify several
parameters in configuration file such as DB-API module, database
connection string, cache classes, relations, etc.
All parameters are presented in table below:
+-----------------------------------------------------------------------------+
|Group | Section | Parameter | Default value |
+-----------------------------------------------------------------------------+
| basic | bazaar | module | --- |
| | | dsn | --- |
| | | seqpattern | select nextval for %s |
+-----------------------------------------------------------------------------+
| classes | bazaar.cls | <cls>.relation | application class name |
| | | <cls>.sequencer | <cls>.relation + '_seq' |
| | | <cls>.cache | bazaar.cache.FullObject |
+-----------------------------------------------------------------------------+
| associations | bazaar.asc | <attr>.cache | bazaar.cache.FullAssociation |
+-----------------------------------------------------------------------------+
Sample configuration file using bazaar.config.CPConfig
class:
[bazaar]
dsn: dbname = ord port = 5433
module: psycopg
seqpattern: select nextval('%s');
[bazaar.cls]
app.Article.sequencer: article_seq
app.Article.relation: article
app.Article.cache: bazaar.cache.FullObject
app.OrderItem.cache: bazaar.cache.LazyObject
[bazaar.asc]
app.Department.boss.cache: bazaar.cache.FullAssociation
app.Order.items.cache: bazaar.cache.LazyAssociation
It is possible to implement different configuration classes. This
module contains abstract config class bazaar.config.Config
. Class bazaar.config.CPConfig
loads Bazaar ORM
configuration with ConfigParser
class (ini files). Every
configuration class method returns an option or None
if
specified parameter is not found in config source.
Of course, it is possible to implement other configuration classes,
i.e. for GConf
configuration system.
Classes |
Config |
Basic, abstract configuration class. |
CPConfig |
Bazaar ORM configuration using ConfigParser module. |
Variable Summary |
Log |
log = <bazaar.Log object at 0x3018c270>
|
log
-
- Type:
-
Log
- Value:
<bazaar.Log object at 0x3018c270>
|
|