The need of smallint as boolean is required for my application... I don't knows if the word "legacy" is correct, I can't change the table structure but I can insert and delete records... In any case I expect that running ./web2py.py-K logistica it reads my db.py and my defines.
What's happen if my scheduled task insert a record in the legacy table where boolean need to be 0 or -1, but this task is in and enviroment created by ./web2py.py-K logistica where boolean are F or T beacause it don't take care of my defines in db.py? On Fri, Mar 8, 2013 at 9:47 AM, Niphlod <niph...@gmail.com> wrote: > deviating from the standards can be a pain, but if you set the migration > off, change your column datatype outside web2py, the default typecasting > would kick in and it should work anyway..... > PS: legacy db is where there are yet tables you can't change. The > scheduler creates its own tables, so why the need for smallints as booleans > ? > > > On Friday, March 8, 2013 9:28:13 AM UTC+1, Massimiliano wrote: > >> Is there any chance to take a look on this problem? >> >> Thank you >> >> >> >> On Mon, Feb 25, 2013 at 7:42 PM, Massimiliano <mbel...@gmail.com> wrote: >> >>> Hi, >>> I'm working on a legacy database where all boolean are mapped to 0, -1. >>> >>> In my application I redefine adapter TRUE/FALSE as saw in this group. >>> >>> In db.py: >>> >>> db = >>> DAL('postgres://postgres@127.**0.0.1/logistica<http://postgres@127.0.0.1/logistica> >>> ') >>> import copy >>> db._adapter.types = copy.copy(db._adapter.types) >>> db._adapter.types['boolean']='**SMALLINT' >>> db._adapter.TRUE = -1 >>> db._adapter.FALSE = 0 >>> >>> Now I'm trying to use the scheduler but I found that running >>> >>> ./web2py.py-K logistica >>> >>> it doesn't take care (or it redefine to default 'F' and 'T') of my >>> custom db._adapter.FALSE and db._adapter.TRUE. >>> >>> Is there something that I can do to help fixing that? >>> >>> I think that to support custom boolean value is very important where >>> working on legacy databases. >>> >>> Thank you very much >>> -- >>> Massimiliano >>> >>> -- >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "web2py-users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to web2py+un...@**googlegroups.com. >>> >>> For more options, visit >>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>> . >>> >>> >>> >> >> >> >> -- >> Massimiliano >> > -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Massimiliano -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.