On Mar 10, 2011, at 2:18 PM, LightOfMooN wrote:
>
> because it's not beautiful ;)
Well, the field you're using in the database doesn't have a beautiful
constraint...
>
> On 11 мар, 03:16, Jonathan Lundell wrote:
>> On Mar 10, 2011, at 11:57 AM, LightOfMooN wrote:
>>
>>
>>
>>> the same resu
because it's not beautiful ;)
On 11 мар, 03:16, Jonathan Lundell wrote:
> On Mar 10, 2011, at 11:57 AM, LightOfMooN wrote:
>
>
>
> > the same result..
>
> > so my validate for value is:
> > isinstance(value, int) and -2147483649
> > It works fine, but... it's not good...
>
> Why not? You shouldn'
On Mar 10, 2011, at 11:57 AM, LightOfMooN wrote:
>
> the same result..
>
> so my validate for value is:
> isinstance(value, int) and -2147483649
> It works fine, but... it's not good...
Why not? You shouldn't be relying on sizeof(int).
>
> On 10 мар, 23:32, Martín Mulone wrote:
>> Better use
the same result..
so my validate for value is:
isinstance(value, int) and -2147483649 wrote:
> Better use:
>
> if isinstance(value, int):
>
> instead of
>
> if type(value)==int:
>
> 2011/3/9 LightOfMooN
>
>
>
>
>
>
>
>
>
> > value=request.vars.myvar
>
> > try:
> > value = int(value)
> > except
On Mar 10, 2011, at 9:36 AM, LightOfMooN wrote:
>
> Full function is too complex.
> But this little shows the problem well:
>
> value=request.vars.myvar
> t = type(value)
> value = float(value)
> t2 = type(value)
> value = int(value)
> t3 = type(value)
> print value, t, t2, t3
>
> result:
>
Full function is too complex.
But this little shows the problem well:
value=request.vars.myvar
t = type(value)
value = float(value)
t2 = type(value)
value = int(value)
t3 = type(value)
print value, t, t2, t3
result:
99,,,
Why it makes int from 99?
On 10 мар, 16:50, villa
Why don't you try testing the value of 'value' in your code by using a
print statement to the console? At least that's what I usually do.
You would ideally provide the entire controller function because your
code does not explain itself very well to me (although it may be
obvious to others!).
On
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:
Can I see more of the code without ...
On Mar 9, 3:17 pm, LightOfMooN wrote:
> value=request.vars.myvar
>
> try:
> value = int(value)
> except:
> pass
>
> if type(value)==int:
> insert()
>
> it rises
> (current transaction is aborted,
> commands ignored until end of transaction bl
9 matches
Mail list logo