[web2py] validate_and_insert does not work with CRYPT

2014-09-19 Thread Martin Weissenboeck
This is my modeL ​db.define_table('myperson', Field('name'), Field('password','password', requires=CRYPT()), )​ ​And here are the functions: ​ ​def newperson1(): db.myperson.insert(name="Smith1", password=CRYPT()("abc")[0]) ​​def newperson2():

[web2py] Re: Accesing table from external database

2014-09-19 Thread Brian M
José, Just because the database was not created by web2py does not automatically mean that you cannot access it through the DAL. As long as the table you want to get at has an auto-increment integer primary key field you can define that table through the DAL - even if the identity field is not

[web2py] Re: Current status of adapting OrientDB for web2py

2014-09-19 Thread lpg
bumping this to the future. On Wednesday, September 5, 2012 2:59:26 AM UTC-4, luckysmack wrote: > > I am curious if anyone has made any advancements with OrientDB. I only > recently found out about it and Neo4j. I had been planning on using > mongo/couch for my db backend, but based on the way

[web2py] Re: Accesing table from external database

2014-09-19 Thread José Eloy
Thanks Brian and Carlos for the answer and sorry for my delay. "external database" means it's a database not created by Web2py. The matter is I'd like to reference a web2py table with another table from the "external database". I know that this is not possible, but what could be the best way to

Re: [web2py] Re: Float issue

2014-09-19 Thread António Ramos
Ok, thank you Regards 2014-09-19 14:58 GMT+01:00 Leonel Câmara : > Why are you using such an ancient version of web2py? Simplejson had a lot > of corrections since then. You need to at least update the simplejson > module in contrib. > > -- > Resources: > - http://web2py.com > - http://web2py.

[web2py] Re: Float issue

2014-09-19 Thread Leonel Câmara
Why are you using such an ancient version of web2py? Simplejson had a lot of corrections since then. You need to at least update the simplejson module in contrib. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https:/

Re: [web2py] Re: Float issue

2014-09-19 Thread António Ramos
In this case i´m using web2py 2.0.9 and import gluon.contrib.simplejson as json 2014-09-19 14:44 GMT+01:00 Leonel Câmara : > This is what that outputs in the browser for me: > > [[141112800, 119.99, "a"]] > > Which seems about right. What version of python are you using? Have you > tried thi

[web2py] Re: Float issue

2014-09-19 Thread Leonel Câmara
This is what that outputs in the browser for me: [[141112800, 119.99, "a"]] Which seems about right. What version of python are you using? Have you tried this with using web2py's included simplejson instead of the native json? -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Re: Float issue

2014-09-19 Thread António Ramos
try this code: def getgraphData2(): ret=[] rows=[ {u'values':[[1411128000,u'119.989876762313']],u'key':'a'}, ] for row in rows: print row for value in row['values']: print value if type(value[1]==type(u'a')): value[1]=rou

[web2py] Re: Float issue

2014-09-19 Thread Leonel Câmara
This is just how floats work. 0.2 is not representable in binary so you round it and you endup with the same float problem. That said I don't know why you're getting that problem because I can't reproduce it with either stdlib json or web2py's included simplejson. >>> json.dumps([[141093864

[web2py] Re: Float issue

2014-09-19 Thread Niphlod
I wouldn't know, without seeing the actual code and the table definition. >>> testvalue = -0.20001 >>> import json >>> json.dumps(round(testvalue, 2)) '-0.2' >>> testvalue = 141093864 >>> json.dumps(testvalue) '141093864' On Friday, September 19, 2014 1:53:55 PM UTC+2, Ramo

[web2py] Float issue

2014-09-19 Thread António Ramos
Hello i ´m stuck with this problem, python related, not web2py but this group is the place to get help right? I have a webservice to return around 20k records in a json format like [[141093864, -0.20001, "RI_12N01_VAL"], [141093870, -0.20001, "RI_12N01_VAL"]] the