[web2py] Re: Setting a header

2017-11-01 Thread Dave S
On Wednesday, November 1, 2017 at 7:15:11 PM UTC-7, Anthony wrote: > > It's response.headers. > Indeed, but that isn't a sufficient correction. /dps > > Anthony > > On Wednesday, November 1, 2017 at 1:18:07 AM UTC-4, Dave S wrote: >> >> I wanted to set the refresh on a page according to how

[web2py] Re: Data Representation SQLFORM.factory /linked tables

2017-11-01 Thread Anthony
> > db.define_table('drench', > Field('status', requires=IS_IN_SET(STATUSES), > default=STATUSES[0]), > Field('assigned_to', db.auth_user), #, default=auth.user_id > Field('start_date', 'date',default=request.now), > Field('com

[web2py] Re: Setting a header

2017-11-01 Thread Anthony
It's response.headers. Anthony On Wednesday, November 1, 2017 at 1:18:07 AM UTC-4, Dave S wrote: > > I wanted to set the refresh on a page according to how often an event is > occurring, and so I tried adding this to my controller function: > > response.header["meta"]='http-equiv="refresh" c

[web2py] Re: crud.read labels

2017-11-01 Thread Anthony
Not via any settings, but you can always set the label attributes of the DAL fields: Field(..., label='mylabel') or after table definition: db.mytable.myfield.label = 'mylabel' Also, note that Crud is no longer recommended -- in most cases, you should be able to get similar results with some

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

2017-11-01 Thread Anthony
> > Btw, on the web2py.com website I see a similar problem. When you first go > to the web2py site you land on this URL: http://web2py.com/ then after > you visit an other page and then go back to the index page, the URL changes > to this:http://web2py.com/init/default/index > It's possible th

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

2017-11-01 Thread Anthony
> > In any case, can you advise me on how to fix this problem? My directory > structure is clearly wrong: > /home/username/web2py/applications/my_app_directory/applications/init > > Can you please post how the correct structure should look like on > pythonanywhere? > It should just be the usual

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

2017-11-01 Thread Joe
Hi Anthony, It seems my problem is the directory structure setup on pythonanywhere. But, I just followed the pythonanywhere system of installing web2py apps, I didn't actually create the directory structure myself. Btw, on the web2py.com website I see a similar problem. When you first go to th

[web2py] [ISSUE] can't see db from database administration menu

2017-11-01 Thread Арслан Ибатуллин
Hi, i'm newbee on web-development, so if i click on every db(even in new created app), web2py gives me traceback: Traceback (most recent call last): File "/app/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/app/applications/blank/views/appadmin.html"

[web2py] how to plot a sympy plot in web2py

2017-11-01 Thread Sanjiv Durve
0down votefavorite I want to plot a sympy plot in web2py by writing a web2py function myplot4() and call it usinghttp://host:port/app/controller/myplot4.png This is the demo sympy code for a plot which works in a p

[web2py] Re: forward auth.user record

2017-11-01 Thread Massimo Di Pierro
Absolutely both should be decorated. You solve the problem by having some periodic ajax ping that keeps the session alive On Wednesday, 1 November 2017 09:37:28 UTC-5, Pierre wrote: > > hello everyone, > > I have a decorated action | controller (@auth.requires_login()) making an > ajax call to

[web2py] Re: ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-01 Thread Massimo Di Pierro
make sure web2py is in PYTHON_PATH On Wednesday, 1 November 2017 08:19:02 UTC-5, Omicron VT wrote: > > > > El miércoles, 1 de noviembre de 2017, 9:17:45 (UTC-3), Omicron VT escribió: >> >> I have been using websocket_messaging.py without problems in version >> 2.14.6. After upgrading to 2.15.4 i

[web2py] Re: websocket_messaging incompatible in web2py 2.15.4?

2017-11-01 Thread Massimo Di Pierro
No Looks like pypyodbc is not installed properly On Saturday, 21 October 2017 08:12:29 UTC-5, mweissen wrote: > > Some months ago I have written a test application for > gluon/contrib/websocket_messaging.py and it worked very well. Now (after an > update to 2.15.4) I tried it again and I got som

[web2py] Re: Increment the value of a field + 1 or how to auto-increment a field value ?

2017-11-01 Thread Massimo Di Pierro
I guess what I meant is that you have a possible concurrency problem: max_id=db(db.invoice.company_id==auth.user.company_id).select (db.invoice.invoice_number, orderby=~db.invoice.invoice_number, limitby= (0,1)).first().invoice_number db.invoice.invoice_number.default = max_id + 1 form=SQLFORM(d

[web2py] crud.read labels

2017-11-01 Thread Andrea Fae'
Is it possibile to manage crud.read field labels? Thanks -- 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 Issues) --- You received this message because you are subscr

[web2py] Re: override record in db

2017-11-01 Thread Dave S
On Wednesday, November 1, 2017 at 8:36:49 AM UTC-7, runr...@gmail.com wrote: > > I have scrapped the controller I was using because it wasn't working but > it was something like this > def display_form(): > *record = alpha.person(request.args(0)) or redirect (URL('index'))* > form=SQLFOR

[web2py] Re: override record in db

2017-11-01 Thread runruh11
I have scrapped the controller I was using because it wasn't working but it was something like this def display_form(): *record = alpha.person(request.args(0)) or redirect (URL('index'))* form=SQLFORM(alpha.person,* record)* if form.process(keepvalues=True).accepted: response.f

[web2py] forward auth.user record

2017-11-01 Thread Pierre
hello everyone, I have a decorated action | controller (@auth.requires_login()) making an ajax call to perform another action. Some time ago I realized that user session might expire while the ajax is being processed so if ajax secondary action does something like : *user = auth.user_id* and s

[web2py] Re: ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-01 Thread Omicron VT
El miércoles, 1 de noviembre de 2017, 9:17:45 (UTC-3), Omicron VT escribió: > > I have been using websocket_messaging.py without problems in version > 2.14.6. After upgrading to 2.15.4 i can not start websocket_messaging > anymore, iget this error : > ImportError: No module named gluon.utils >

[web2py] Re: ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-01 Thread 黄祥
had you try: from gluon import utils best regards, stifan -- 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 Issues) --- You received this message because you are subsc

[web2py] ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-01 Thread Omicron VT
I have been using websocket_messaging.py without problems in version 2.14.6. After upgrading to 2.15.4 i can not start websocket_messaging anymore, iget this error : ImportError: No module named gluon.utils Any help ? Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documenta