[web2py] Re: the way to return json

2017-09-18 Thread 黄祥
a, i c, not tested on that yet, will do, btw, forgot to add service.json() not sure about the difference or performance compare with json/simplejson, as_json(), response.json(), restful e.g. @service.json def service_json_call_json_rows(): query = (db.auth_user.id > 0) rows = db(query).select()

[web2py] Re: Getting "relation 'table' does not exist" in pycharm, production server runs fine.

2017-09-18 Thread E T Bear
On Monday, September 18, 2017 at 7:31:35 AM UTC-7, E T Bear wrote: > > *SOLVED (more or less) - see Addendum in the following message.* > > My application, which uses postgresql, is getting the following error for > all of my own tables, i.e. all tables other than the "auth_" set. For >

[web2py] Re: Getting "relation 'table' does not exist" in pycharm, production server runs fine.

2017-09-18 Thread E T Bear
Thank you Dave S. Adding '*ignore_field_case=True, entity_quoting=False,* ' to the DAL constructor call seems to have solved the problem. That, plus the ritual invocation of '*find ~/web2py -name "*.pyc" -delete*'. On Monday, September 18, 2017 at 7:31:35 AM UTC-7, E T Bear wrote: > >

[web2py] Re: how to import csv data and use the imported data

2017-09-18 Thread 黄祥
web2py has dal function for import csv (.import_from_csv_file() ) ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data i think you should define the table that meet your data in the model first, then use dal function

[web2py] Re: Getting "relation 'table' does not exist" in pycharm, production server runs fine.

2017-09-18 Thread Dave S
On Monday, September 18, 2017 at 10:52:47 AM UTC-7, E T Bear wrote: > > Addendum: the original description is incorrect. My (working) production > copy was actually running a previous version of web2py: > > *Version 2.14.6-stable+timestamp.2016.05.10.00.21.47* > > Once I reverted my

[web2py] Re: Getting "relation 'table' does not exist" in pycharm, production server runs fine.

2017-09-18 Thread E T Bear
Addendum: the original description is incorrect. My (working) production copy was actually running a previous version of web2py: *Version 2.14.6-stable+timestamp.2016.05.10.00.21.47* Once I revered my development version to 2.14.6, the development version started working correctly again. So

Re: [web2py] Re: Future of web2py

2017-09-18 Thread Richard Vézina
Hello Marlysson, The focus rigth now is on make web2py work with python 3... Actually it already works but there is maybe some bugs, so any input, testing and report is welcome... You can follow the progression here : https://github.com/web2py/ web2py/issues/1353 Richard On Sun, Sep 17, 2017

[web2py] Re: caching variable data sample

2017-09-18 Thread Anthony
On Monday, September 18, 2017 at 10:09:51 AM UTC-4, Pierre wrote: > > I'd prefer the module option but I need to pass *time_expire* as a > variable (*db.atable.__variableName*), I don't think I can do that in a > module can I ? > You are not limited to using the decorator to cache the results

[web2py] how to upload csv data and then use the data for calculation

2017-09-18 Thread wangfenghu0506
I am a nood in coding and web development. I want to use web2py to establish a small APP for my research. But I have some problems to import the csv data and then use the data for calculation (or model establishment). I search for some examples in manual book, web2pyslices.com and some other

[web2py] Getting "relation 'table' does not exist" in pycharm, production server runs fine.

2017-09-18 Thread E T Bear
My application, which uses postgresql, is getting the following error for all of my own tables, i.e. all tables other than the "auth_" set. For example, if the table is UserEvent, the error is: * relation "UserEvent" does not exist LINE 1: ...ype", "UserEvent"."Description" FROM

[web2py] how to import csv data and use the imported data

2017-09-18 Thread wangfenghu0506
I am phD students in Hiroshima University, Japan. I try to use web2py to establish an app for my research about environment management of the Seto Inland Sea,Japan. In the app, users upload their csv data, and will get the results here is my controller file and view file #controller data.py def

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-09-18 Thread Anthony
FYI, here is a Pythonanywhere app with routing working as expected (the app is named "init"): https://w2ptest.pythonanywhere.com/ Below are the exact contents of the /web2py/routes.py file for the above installation: routers = dict( BASE = dict( default_application='init' ),

[web2py] Re: caching variable data sample

2017-09-18 Thread Pierre
I'd prefer the module option but I need to pass *time_expire* as a variable (*db.table.__variableName*), I don't think I can do that in a module can I ? On Friday, September 15, 2017 at 6:15:44 AM UTC-4, Pierre wrote: >> >> actually the real function is a little more complex since it returns

[web2py] Re: the way to return json

2017-09-18 Thread Anthony
On Monday, September 18, 2017 at 9:09:59 AM UTC-4, 黄祥 wrote: > > yes you are right .as_list() will be called automatically when pass it to > response.json() > > rows.as_json() work well too unfortunately it's not documented in book yet: > def json_rows_as_json(): > query = (db.auth_user.id > 0) >

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-09-18 Thread Anthony
On Monday, September 18, 2017 at 9:30:26 AM UTC-4, Joe wrote: > > Thanks Anthony, when you say "*specify the functions in the default > controller* ", what do you mean exactly? I just want to make sure I > understand you correctly. > See

[web2py] Re: How to get rid if the /init/default/ in the URL?

2017-09-18 Thread Joe
Thanks Anthony, when you say "*specify the functions in the default controller* ", what do you mean exactly? I just want to make sure I understand you correctly. When I go to http://mydomain.com I don't have the *init/default/ *in the URL. But, when I click to go to

[web2py] Re: the way to return json

2017-09-18 Thread 黄祥
yes you are right .as_list() will be called automatically when pass it to response.json() rows.as_json() work well too unfortunately it's not documented in book yet: def json_rows_as_json(): query = (db.auth_user.id > 0) rows = db(query).select() return rows.as_json() *not sure about :*

[web2py] Python malaware on PyPI, beware! caution installing external packages!

2017-09-18 Thread Michele Comitini
*Please note: web2py standard distribution is NOT affected!* http://www.nbu.gov.sk/skcsirt-sa-20170909-pypi/ mic -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report