Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-17 Thread Richard Vézina
But your field is decimal type right? So I guess you should use decimal in your SIZES calculation... Something like this : from deciaml import * [v*Decimal('0.05') for v in range(0,int(50/Decimal('0.05')))] Richard On Fri, Feb 14, 2014 at 3:43 PM, greenpoise wrote: > requires=IS_IN_SET(SIZ

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-14 Thread greenpoise
requires=IS_IN_SET(SIZES) is what I am using but fails to accept values under 1.0. So, 0.1 to 0.99 prompt the error On Thursday, February 13, 2014 6:48:01 PM UTC-8, Richard wrote: > > So why not use IS_FLOAT_IN_RANGE()?? > > requires = IS_FLOAT_IN_RANGE(0, 100, dot=".", > error_me

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread Richard Vézina
Though what I still don't understand is why your error message talk about FK issue... It's like you have a missmatch in field declaration in your model... Richard On Thu, Feb 13, 2014 at 9:48 PM, Richard Vézina wrote: > So why not use IS_FLOAT_IN_RANGE()?? > > requires = IS_FLOAT_IN_RANGE(0,

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread Richard Vézina
So why not use IS_FLOAT_IN_RANGE()?? requires = IS_FLOAT_IN_RANGE(0, 100, dot=".", error_message='too small or too large!') Do you really need to specify the value in a dropbox dynamically? If so, requires=IS_IN_SET(SIZES) don't work? Richard On Thu, Feb 13, 2014 at 5:07 PM, gr

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread greenpoise
A list of decimal values from 0.1 to 50.0 On Thursday, February 13, 2014 1:47:53 PM UTC-8, Richard wrote: > > What is SIZES? > > Is it a validators? > > Richard > > > > On Thu, Feb 13, 2014 at 4:24 PM, greenpoise > > wrote: > >> could it be >> SIZES = [v*0.05 for v in range(0,int(50/0.05))] >>

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread Richard Vézina
What is SIZES? Is it a validators? Richard On Thu, Feb 13, 2014 at 4:24 PM, greenpoise wrote: > could it be > SIZES = [v*0.05 for v in range(0,int(50/0.05))] > > which I use to populate a select box? > > > > > On Thursday, February 13, 2014 1:06:14 PM UTC-8, Richard wrote: > >> Hmm, the mess

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread greenpoise
could it be SIZES = [v*0.05 for v in range(0,int(50/0.05))] which I use to populate a select box? On Thursday, February 13, 2014 1:06:14 PM UTC-8, Richard wrote: > > Hmm, the message says Foreign Key constraint... > > Not decimal issue... > > Richard > > > On Thu, Feb 13, 2014 at 4:02 PM, gre

Re: [web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread Richard Vézina
Hmm, the message says Foreign Key constraint... Not decimal issue... Richard On Thu, Feb 13, 2014 at 4:02 PM, greenpoise wrote: > For the first time I had to enter a value that was 0.25, for some reason, > it comes back with this error FOREIGN > KEY constraint failed > > I have the field as

[web2py] My db wont allow to enter decimals lower than 1.0

2014-02-13 Thread greenpoise
For the first time I had to enter a value that was 0.25, for some reason, it comes back with this error FOREIGN KEY constraint failed I have the field as a float type. It works with any value except from 0.1 to 0.99. I tried decimal (10,3) still nothing. -- Resources: - http://web2py.com - h