Dienstag, 21. Juni 2011

Design restructured for easier use with 3rd party systems

The generation of the domain for searching for changes has moved to the connection classes. With this its easy possible to replace the standard domain scheme with an specialized format such as simple WHERE statements in strings. Thats usefull when implementing a connection class for a 3rd party system maybe DBMSs.

A simple example for implementing a connection to a MySQL database is available at: http://hg.holtzberg.de/synchronize_koleso

Its quite easy to implement synching capabilities  with WHERE statements as domains and a mapper dict for field transformation.

When a default value is defined on a relation field, the recursive dependent model is not synched. To get the MySQL example work with an own database, some fields have to be set to default to prevent synching the recursive dependent models:

  • product.template.category => set to the id of the local desired product.category record.
  • product.template.cost_price_method => fixed
  • product.template.default_uom => 1 (should be the index of Unit by default)
  • product.template.type => stockable
With the default values set, the only models for which data will be fetched through the MySQL-Connection object will be product.product and product.template.

Keine Kommentare:

Kommentar veröffentlichen