Re: [SQLObject] Default Behaviour when notNull == False
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2003-04-30 20:53:20
|
On Wed, 2003-04-30 at 10:29, Nick wrote: > On Wed, 2003-04-30 at 08:55, Brad Bollenbach wrote: > > Can we change the behaviour of this to "feel" more like an SQL insert, > > so that if a column's allowed to be null, I don't have to specify it > > in the new()? > > This patch should do what you want. Note that I've changed notNull to > default to True instead of False, because it seems to make more sense to > do so. If you *don't' specify a keyword argument to new, I would think > you would *want* to see an error there instead if you didn't > specifically tell it to not expect one. I don't know... just because you don't give a default, you can still use None for a value (assuming the column allows NULL). It was my intention to make the default explicit, even if it isn't explicit in SQL, so default=None does what Brad wants. I can see why it would be inconvenient, but only slightly, and I think that's countered by it being a useful discipline (and more closely matching Python, which doesn't use implicit defaults). Ian |