[web2py] Re: Is this a bug? DAL update records using an expression

2013-03-14 Thread LightDot
This probably breaks quite a few apps out there? It did one for us. Did anyone open a bug report? Regards, Ales On Wednesday, March 13, 2013 1:22:57 AM UTC+1, Alex wrote: I've got the same problem. I have a field with type decimal(12,4), I can add a number to this field but not subtract. So

[web2py] Re: Is this a bug? DAL update records using an expression

2013-03-14 Thread Alex
I just opened a bug report (Issue 1391). Alex Am Donnerstag, 14. März 2013 13:56:34 UTC+1 schrieb LightDot: This probably breaks quite a few apps out there? It did one for us. Did anyone open a bug report? Regards, Ales On Wednesday, March 13, 2013 1:22:57 AM UTC+1, Alex wrote: I've

[web2py] Re: Is this a bug? DAL update records using an expression

2013-03-12 Thread Alex
I've got the same problem. I have a field with type decimal(12,4), I can add a number to this field but not subtract. So instead of db(db.client_service.id == id).update(minutes_done = db.client_service.minutes_done - minutes) I have to write minutes = -minutes db(db.client_service.id ==

[web2py] Re: Is this a bug? DAL update records using an expression

2013-03-06 Thread Massimo Di Pierro
According to the code: if self.type in ('integer','bigint'): result_type = 'integer' elif self.type in ['date','time','datetime','double','float']: result_type = 'double' else: raise SyntaxError(subtraction operation not supported for type) what is the type

[web2py] Re: Is this a bug? DAL update records using an expression

2013-03-06 Thread Cliff Kachinske
Here is the field def: Field('quantity_on_hand', 'decimal(12,3)', default=0.0, writable=False, readable= False, requires=IS_EMPTY_OR(IS_DECIMAL_IN_RANGE(0, .999)), ), On Wednesday, March 6, 2013 9:45:20 AM

[web2py] Re: Is this a bug? DAL update records using an expression

2013-03-06 Thread Cliff Kachinske
I see what the code is doing. Would this work? if db._adapter.driver.__name__ in ('sqlite'): # maybe others? if self.type in ('integer','bigint'): result_type = 'integer' elif self.type in ['date','time','datetime','double','float']: result_type = 'double'