I know 2**31, I meant the value: 2147483648  :)
And while the IS_INT_IN_RANGE is fine for negative value (I am already 
using it) that does not change the fact that is the column is not set as 
unsigned, 2147483648 can't be saved.

For the deployment, no that's not a solution. We require à fully scripted 
solution that may be deployed by maintenance guys without knowledge of what 
they do at anytime.
And the models evolve between updates.

Just out of curiosity, why unsigned it not a default and simple parameter ? 
(handled only if the backend handles)

Le vendredi 16 novembre 2012 21:46:09 UTC+1, Niphlod a écrit :
>
>
>
> On Friday, November 16, 2012 9:23:33 PM UTC+1, Joseph.Piron wrote:
>>
>> No I can't, here I have to stock and let the user enter 2**31 and not 
>> 2**31-1
>> As everything else is possible, shouldn't it be possible to add a 
>> aprameter to the field constructor to set unsigned ?
>> That would be really handy in situation such as mine where I have to 
>> deploy the solution on many servers.
>>>
>>>
>>> 2**31 is not even allowed in a normal 'integer' field. That is a math 
> notation not supported and requires a whole different validation (and 
> parsing).
>  
> What we are saying is that :
> a) if you place a requires=IS_INT_IN_RANGE(0) there's no way any user can 
> enter "-12" and submit that value, no matter what the underlying column 
> type is set on the db
> b) you can alter the column type "a posteriori" and web2py will be happy 
> with that even if your model specifies 'integer'
>
> PS: c) 
> - deploy your app to the 1st server
> - take the sql.log you can find in the databases/ folder
> - alter the column format as you wish in the declaration
> - execute those statements on all the other servers
> - deploy your app with migrate=False (which you should do in any case if 
> your model doesn't change)
>

-- 



Reply via email to