[Erp5-dev] dynamic acquisition flags

Bartek Gorny bartek at redpoint.mn.pl
Wed Feb 22 21:27:13 CET 2006


Hi

I experimented a bit with dynamic acquisition, trying to set various
flags (code given below), and have a couple of questions:

I used three flags: acquisition_copy_value, acquisition_mask_value and
acquisition_sync_value.

1. Setting 'copy' flag to 1 makes the object set the acquired value as
local property at the first time, but if the property of the
referenced object changes, getter returns the new value despite having
the old one locally. What, then, is the practical difference between
having the 'copy' flag on and off?

2. Setting 'mask' flag makes the object save the value acquired
locally and then stop any acquisition at all, even changing the
relation (referencing another object) doesn't affect the value, and
the value can only be changed locally by editing the object. Is it
possible to get the following behavior: the value is acquired and
saved locally only when I update the relation (but every time I do
so), and then is editable only locally?

3. Setting 'sync' value has no effect - documentation says that if I
have a 'sync' flag on, editing the value locally should have an effect
on the property of the referenced object, but it doesn't. How, then,
to set up a relation that will 'sync' values both ways?

4. What is the 'override' flag supposed to do?

The Property Sheet I used looked like that:

class UrlEksperyment:
   """
       An absurd relation between Url and a Service (product) -
      we want to acquire a service price
   """

   _properties = (
       {   'id'          : 'service_price',
           'description' : 'Takie coś bez sensu',
           'type'        : 'float',
           'acquisition_base_category' : ('product',),
           'acquisition_portal_type'   : ('Service',),
           'acquisition_copy_value'    : 1,
           'acquisition_mask_value'    : 0,
           'acquisition_sync_value'    : 0,
           'acquisition_depends'       : None,
           'acquisition_accessor_id'   : 'getBasePrice',
           'mode'        : 'w' },
   )


Thx
Bartek


More information about the Erp5-dev mailing list