On Feb 18, 2008 7:57 AM, Adrian Klaver <[EMAIL PROTECTED]> wrote: > On Sunday 17 February 2008 8:12 pm, Ed Leafe wrote: > > On Feb 17, 2008, at 8:34 PM, Adrian Klaver wrote: > > >> OK, I've done some tests, and it doesn't look good. It seems that if > > >> I set those values to None, when the record is saved it creates SQL > > >> like: > > >> > > >> insert into mytable (foo, bar, baz) values (None, None, None) > > >> > > >> ...and if those fields do not accept null values, it will return an > > >> error. The only way to get the database defaults is to not include > > >> those fields in the insert statement, but that will take a much more > > >> extensive re-working of the code. > > >> > > >> -- Ed Leafe > > > > > > I should have thought of that. Well I can set defaults in the bizobj. > > > > Before you do that, try the version of dCursorMixin I just committed. > > It should respect database-supplied default values if you set the > > bizobj's DefaultValues to None. > > > > -- Ed Leafe > > The new dCursorMixin does fill the fields with None values. The problem it > also fills the link field. I tested entering a new record in a dGrid that > holds a child bizobj. The link field was set to None(<None>) and I could not > change it manually to the correct value. I could not go any further. One > question is what the presence of None(NULL) values will do to fields with a > constraint of NOT NULL and a default value? I will be away from the computer > for most of the day so I will not be able to do any testing until this > afternoon/evening(PST).
You shouldn't need to set the link field...If the bizobj is a child of another bizobj, calling save on the parent bizobj should save the parent bizobj, fill in the link fields on the child bizobjs, and then save all the child bizobjs. Cheers, Nate L. _______________________________________________ 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/dabo-users/[EMAIL PROTECTED]
