On May 20, 2008, at 7:29 AM, Dabo Trac wrote:

> If you need to initialize values for
> columns other than an autopopulated PK, you need to write that code  
> in the
> bizobj's onNew() method, or set it in the DefaultValues property.

        BTW, the DefaultValue for any column can be either a fixed value, or  
it can be a callable. If parameters are needed for the callable, you  
can include them, making the DefaultValue a tuple. E.g.:

self.DefaultValues = {"myfield": (self.calculateNextVal, "myfield")}

In this example, when a new record is created, the bizobj's method  
'calculateNextVal' will be called, and 'myfield' will be passed to it.  
The result of that call will then be assigned to the 'myfield' column  
in the new record.

-- Ed Leafe





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to