On Mon, May 14, 2007 at 03:46:06PM +0400, Oleg Broytmann wrote:
> On Sun, May 13, 2007 at 07:53:47PM -0300, Claudio Martinez wrote:
> > On 5/13/07, Claudio Martinez <[EMAIL PROTECTED]> wrote:
> > >Given this scenario:
> > >
> > >class A(SQLObject):
> > >    n = EnumCol(enumValues=['x', 'y'], notNone=False)
> > >
> > >class B(SQLObject):
> > >    n = EnumCol(enumValues=['x', 'y'], notNone=True)
> > >
> > >A(n=None) and B(n=None) both give this error:
> > >Invalid: expected a member of ['x', 'y'] in the EnumCol 'n', got None 
> > >instead
> > >
> > >Attached a patch that WorksForMe(tm).
> > 
> > That patch is broken. Attached a working one.
> 
>    Thank you. I have to extend the patch at least for Postgres - to add
> NULL/NOT NULL and proper CHECK().

   No need to do that: just add None to the list of values:

class A(SQLObject):
   n = EnumCol(enumValues=['x', 'y', None])

   See tests/test_enum.py.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to