On Sunday 29 November 2009 07:52:42 am Jacek Kałucki wrote:
> Hi,
>
> I found dCursorMixin._getBlankRecord() makes me angry.
> The idea of setting a default field value is generally a good idea,
> with one exception. There could be a fields I don't want default
> value to be set.
> When for e.g. field value is set by backend, in SQL 'DEFAULT' clause,
> or when I want the filed has explicit NULL value set (see, my post
> about BLOB field default value).
> Of course, I can hook dBizObj.onNew() method, but I think it would be
> more elegant to exclude some fields from setting their default values,
> than setting values twice.
> For e.g. the NoDefaultValueFileds tuple property could be added to dBizobj
> class to achieve this.
> It would be a perfect solution to extend dBizobj.DataStructure property
> for field default value.

If I understand you correctly.  If the value is None (or Null) you want Dabo 
not to pass the field value to the DB otherwise pass the value.  You want this 
because you want the DB to set the default value in the case the field is not 
passed.  And can you can not use NonUpdateFields() because you want Dabo to 
pass a value if one is supplied.

My first question is how can you get this done via the dBizObj.onNew().  I can 
see where this might be valuable in the future.  But I don't see how to do it 
in onNew().

Normally when I setup a DB and need special handling I use triggers.  Maybe 
that could be a work around in your case.

Johnf





--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
_______________________________________________
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