[web2py] custom form default value

2016-12-20 Thread Tom Schuerlein
Hi: I am trying to write a fairly simple custom update form as shown below. The application is used in a lab to track "jobs" which consist of many samples each. The sample names are often more than one word. I am writing a page to edit the existing data base entry. However, when I set the

[web2py] learning cache

2016-12-20 Thread 黄祥
learned about cache from the book, but got confused : 1. when tried to put cache affected for all functions in controller, the cache.action have a strange behaviour the controllers requires user to login, but it can by passed (not required user logged in), already test the simplest one just put

[web2py] Re: Need help to debug this error when using URL from gluon/html.py

2016-12-20 Thread Anthony
Note, it is line 971, not 917. In the admin app, you can view the Python code of the compiled view in the error ticket. Anthony On Tuesday, December 20, 2016 at 6:31:37 PM UTC-5, Lisandro wrote: > > Thank you all for the help. > > @Anthony, sorry my ignorance, I was looking in the wrong place (l

[web2py] Re: Need help to debug this error when using URL from gluon/html.py

2016-12-20 Thread Lisandro
Thank you all for the help. @Anthony, sorry my ignorance, I was looking in the wrong place (looking in the module, asuming the error was triggered there). Considering your answer and the traceback error, I say "ok, the error is triggered from the view, in the line 917". But how do I know which i

Re: [web2py] Re: How to check if expression is Aggregate?

2016-12-20 Thread Anthony
Not sure what's going on. You'll have to do some digging around. Maybe do a dir(db._adapter) to see what the object is. Anthony On Tuesday, December 20, 2016 at 4:03:27 PM UTC-5, Jurgis Pralgauskis wrote: > > it just has what standar app gets: > > db = DAL(myconf.get('db.uri'), >

[web2py] Issues with changing date format

2016-12-20 Thread David
Hello, I am trying to change the display of the date format on my SQL forms from -mm-dd to mm/dd/. I have changed the web2py_ajax.html to : var w2p_ajax_date_format = "{{=T('%m/%d/%Y')}}"; and added ield('birthday', 'date', label = 'Birthday', requires = IS_DATE(format = T('%m/%d/%Y'))

Re: [web2py] Re: How to check if expression is Aggregate?

2016-12-20 Thread Jurgis Pralgauskis
it just has what standar app gets: db = DAL(myconf.get('db.uri'), pool_size=myconf.get('db.pool_size'), migrate_enabled=myconf.get('db.migrate'), check_reserved=['all']) @appconfig.ini [db] uri = sqlite://storage.sqlite On Tue, Dec 20, 2016 at

[web2py] Re: Need help to debug this error when using URL from gluon/html.py

2016-12-20 Thread Pbop
Issue appears to have come up a few times on stack overflow. http://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20/9942885 On Tuesday, December 20, 2016 at 2:08:00 PM UTC-5, Dave S wrote: > > > On Tuesday, December 20, 2016 at 10:3

[web2py] Re: Need help to debug this error when using URL from gluon/html.py

2016-12-20 Thread Anthony
The traceback refers to line 971 in the compiled view (not in a module), indicating a call to the URL() function on that line. On Tuesday, December 20, 2016 at 1:33:18 PM UTC-5, Lisandro wrote: > > Thanks for the quick answer. > Yes, I have automated my app with a function; it sets the app in >

[web2py] Re: Need help to debug this error when using URL from gluon/html.py

2016-12-20 Thread Dave S
On Tuesday, December 20, 2016 at 10:33:18 AM UTC-8, Lisandro wrote: [...] > Does the ticket store info about the content of vars and args when the > error triggered? > I'm sending tickets2email, so I don't conserve the original ticket, but If > I could find that info in the ticket, I guess I

[web2py] Re: Need help to debug this error when using URL from gluon/html.py

2016-12-20 Thread Lisandro
Thanks for the quick answer. Yes, I have automated my app with a function; it sets the app in mantainance mode (message for the public), updates the code from repository, compiles the app, restarts uwsgi, and turns off mantainance mode. Just in case, I've just checked and it is running compiled

[web2py] Re: table cells truncation

2016-12-20 Thread Anthony
By the way, I would keep function definitions outside the view. And it might be better to do the truncation in the controller before passing the data to the view. Alternatively, just handle everything with CSS: https://jsfiddle.net/antb03/adcnn15c/ Anthony On Tuesday, December 20, 2016 at 6:4

[web2py] Re: table cells truncation

2016-12-20 Thread Anthony
Yes, but where are you using truncstr, and what alternative API do you imagine that would make whatever you are trying to do easier? If you want to write the table in raw HTML, the web2py template system does not provide a way to programmatically manipulate the DOM (as the DOM is generated in t

[web2py] Re: How to check if expression is Aggregate?

2016-12-20 Thread Anthony
How have you defined db? The _adapter attribute of a DAL instance should be a "SQLiteAdapter" object when using SQLite, not a "SQLite" object. Anthony On Tuesday, December 20, 2016 at 5:00:02 AM UTC-5, Jurgis Pralgauskis wrote: > > I have searchform, > > where one can define various fields and

[web2py] Re: Need help to debug this error when using URL from gluon/html.py

2016-12-20 Thread Anthony
Which line is 971? Are you sure you re-compiled the app after making the code change? On Tuesday, December 20, 2016 at 6:38:07 AM UTC-5, Lisandro wrote: > > Hi there! > I have a web2py application running, it's been running for a long time, it > is a website that serves hundreds of thousands of

[web2py] Re: table cells truncation

2016-12-20 Thread Pierre
I mean a HTML whose code lies in a view "as opposed to" a sqltable: my code looks like this: {{def truncstr(s,n,dots):}} .truncate function.. {{pass}} {{extend layout.html}} .header... etc... -- Resources: - http://web2py.com - http://web2py.com/boo

[web2py] Need help to debug this error when using URL from gluon/html.py

2016-12-20 Thread Lisandro
Hi there! I have a web2py application running, it's been running for a long time, it is a website that serves hundreds of thousands of visits per day, and everything works really good. However, everyonce in a while (let's say, every 3-4 days) an error ticket is generated with this traceback: Tr

[web2py] How to check if expression is Aggregate?

2016-12-20 Thread Jurgis Pralgauskis
I have searchform, where one can define various fields and mapping to expressions for comparison, and it automatically constructs select query, but if I want to check if expression is aggregate, and direct thesese queries to "having" but if I try if filter.target_expression.op == db._adap