Yes, ofc

controller/function:

prop = db(db.properties.id==request.args(0)).select().first()
value=request.vars.myvar

try:
    value = int(value)
except:
    pass

if value!=prop.value and type(value)==int:
    try:
        db(db.properties.id==request.args(0)).update(value=value)
    except:
        pass

it rises error
<class 'psycopg2.InternalError'>(current transaction is aborted,
commands ignored until end of transaction block)
only if value not in range (-2147483648 : 2147483647)

so I type in shell
a = 2147483647
type(a)
>>> <type 'int'>
a +=9999
a
>>> 2147493646
type(a)
>>> <type 'int'>

but I think it's already must be long

On 10 мар, 03:35, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:
> Can I see more of the code without ...
>
> On Mar 9, 3:17 pm, LightOfMooN <vladsale...@yandex.ru> wrote:
>
>
>
>
>
>
>
> > value=request.vars.myvar
>
> > try:
> >     value = int(value)
> > except:
> >     pass
>
> > if type(value)==int:
> >     insert(....)
>
> > it rises
> > <class 'psycopg2.InternalError'>(current transaction is aborted,
> > commands ignored until end of transaction block)
> > even if value > 2147483647
>
> > But why?
> > It's so strange, because type(value) must be long.

Reply via email to