On Jan 20, 2010, at 8:58 AM, Jacek Kałucki wrote:

> Above code retrieve field values of new saved record from backend,
> in case they were set by backend.
> But it only works when self._nullDefaults equals True (default False).
> This attribute is set in setDefaults() method but method is never
> executed for non empty defaults.
> As you see in setDefaults() method code, _nullDefaults equals True
> only if DefaultValues bizobj property equals None,
> it's mean that all fields are initialized to None value.

        So am I correct that you want to have default values set in both the 
bizobj *and* in the database? If so, am I the only one who thinks that this is 
a very brittle design?

        The reason the check is there is to avoid unnecessary traffic to the 
database. IOW, if your bizobj has already handled the default values, there is 
no need to call the database for each new record a second time. But it sounds 
to me like you want the bizobj to only handle some of the logic, and let the 
database handle the rest?


-- Ed Leafe



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

Reply via email to