[web2py] Custom search function in GRID does not work anymore in R-2.18.5?

2019-11-11 Thread Krzysztof Socha
I have some old code that uses a custom search function in a sqlform.grid - something along the lines: def process_filtered(sfields, keywords): search_query = SQLFORM.build_query(sfields, keywords) [...] return search_query grid = SQLFORM.grid(db.doc_scan_details, searchable=process_filtered) I

Re: [web2py] Re: Flash messages not showing correctly

2016-05-04 Thread Krzysztof Socha
you retained. > > Anthony > > > On Tuesday, May 3, 2016 at 11:47:26 AM UTC-4, Krzysztof Socha wrote: >> >> Worked! Thanks! >> >> BTW: I keep running into issues when updating old web2py applications to >> new releases of web2py... Is there a recommended

[web2py] Re: Flash messages not showing correctly

2016-05-03 Thread Krzysztof Socha
Tuesday, May 3, 2016 at 5:31:52 PM UTC+2, Anthony wrote: > > In layout.html, have you tried changing the class of the flash div from > "flash" to "w2p_flash"? > > Anthony > > On Tuesday, May 3, 2016 at 11:22:07 AM UTC-4, Krzysztof Socha wrote: >> >

[web2py] Flash messages not showing correctly

2016-05-03 Thread Krzysztof Socha
I have issues with showing "flash"-type messages recently. First I could not get them to show at all. I updated several files in my application based on the recent version of web2py (R-2.14.5), such as web2py.js, web2py-ajax.html, and the like. Now it shows the flash message, but the formatting

[web2py] Re: How to disable cache on client side, but keep it on server side?

2016-02-29 Thread Krzysztof Socha
ing when using @cache.action. However, if you don't want > client-side caching, you might as well just use @cache.ram. > > Anthony > > On Sunday, February 28, 2016 at 3:39:08 PM UTC-5, Krzysztof Socha wrote: >> >> I have a page that is sometimes (not very often) upda

[web2py] How to disable cache on client side, but keep it on server side?

2016-02-28 Thread Krzysztof Socha
I have a page that is sometimes (not very often) updated. The default view is quite complex, so caching it in RAM significantly improves performance. However, if I try to cache it in RAM using something like: @cache.action(time_expire=3600, cache_model=cache.ram, prefix='index') the browser ser

[web2py] Re: GRID selectable inside component

2016-01-06 Thread Krzysztof Socha
On Wednesday, January 6, 2016 at 5:30:25 PM UTC+1, Anthony wrote: > > >> I guess, this is more-less what I need to do, but this is not perfect, as >> I have several applications that I maintain and updating all of them >> manually is not great. Also - is this the only file that should be update

[web2py] Re: GRID selectable inside component

2016-01-06 Thread Krzysztof Socha
On Wednesday, January 6, 2016 at 1:58:19 PM UTC+1, Anthony wrote: > > > Well, any time you upgrade the framework, you should always upgrade > web2py.js (no need to check whether it has changed -- just do it). > > I guess, this is more-less what I need to do, but this is not perfect, as I have s

[web2py] web2py version reported in the admin interface does not match the git tag?

2016-01-05 Thread Krzysztof Socha
I have been playing with git repo for web2py, and I find it very useful. Especially the tags - you can easily move from the current master (trunk) to a specific stable release... or so it seems. I noticed that the tag do not seem to match the version numbers reported in the admin panel for some

[web2py] Re: GRID selectable inside component

2016-01-04 Thread Krzysztof Socha
uce. > > On Thursday, December 31, 2015 at 5:23:38 PM UTC-5, Krzysztof Socha wrote: >> >> As I wrote: >> >> 2.13.4-stable+timestamp.2015.12.26.04.59.39 >> (Running on nginx/1.4.6, Python 2.7.6) >> >> Strange... I will have to investigate a bit more,

[web2py] Re: GRID selectable inside component

2015-12-31 Thread Krzysztof Socha
exact code and it works for me. Which version of web2py? > Maybe attach a minimal app that demonstrates the problem. > > Anthony > > On Thursday, December 31, 2015 at 3:39:37 PM UTC-5, Krzysztof Socha wrote: >> >> Anthony, >> >> Thank you for (very) quick reac

[web2py] Re: GRID selectable inside component

2015-12-31 Thread Krzysztof Socha
> > A basic example works for me. Can you show some code that you know > exhibits the problem? > > Anthony > > On Thursday, December 31, 2015 at 12:53:53 PM UTC-5, Krzysztof Socha wrote: >> >> I noticed a similar thing... I need two grids on a page. As documented, >&

[web2py] Re: GRID selectable inside component

2015-12-31 Thread Krzysztof Socha
I noticed a similar thing... I need two grids on a page. As documented, it does not work very well to simply put them in one controller function. Hence, I tried with LOADing a component. This generally works, but I cannot get the selectable actions to work. I have defined custom selectable acti

[web2py] Re: Problem with processing unicode character by render function in gluon.template

2015-11-29 Thread Krzysztof Socha
It appears that I have been missing somthing. It is sufficient to properly encode the string before passing it to render: render(template_content.encode('utf-8')) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https:

[web2py] Problem with processing unicode character by render function in gluon.template

2015-11-29 Thread Krzysztof Socha
I tried to use the templating system of web2py for parsing dynamically generated views. Theoretically, it should work - render from gluon.template accepts streams and strings as well. However, it seems that due to the fact it uses cStringIO instead of StringIO, it is unable to process unicode c

[web2py] Re: cache.action decorator generates an error

2015-10-17 Thread Krzysztof Socha
015 at 5:56:20 PM UTC+2, Krzysztof Socha wrote: > > I cloned repo from github, and now I get: > > type 'exceptions.UnboundLocalError'> local variable 'expires' referenced > before assignment > > I guess something was fixed, but something else got br

[web2py] Re: cache.action decorator generates an error

2015-10-17 Thread Krzysztof Socha
wrapped_f 'Expires' : expires, UnboundLocalError: local variable 'expires' referenced before assignment Regards, Krzysztof. On Saturday, October 17, 2015 at 4:39:44 AM UTC+2, Massimo Di Pierro wrote: > > This may be fixed in trunk. Can you please check it. > > On

[web2py] cache.action decorator generates an error

2015-10-14 Thread Krzysztof Socha
Hi, I am trying to configure caching on my site, but it does not seem to work. As soon as I use the cache.action decorator, such as: @cache.action(time_expire=0,cache_model=cache.ram) for any action in the controller, I get an exception thrown with: *'session_' local variable referenced before

Re: [web2py] Custom login form error display

2015-10-14 Thread Krzysztof Socha
> > > Note, if you use form.custom.widget.fieldname in a custom form, you still > get errors displayed automatically (the error is part of the widget > object). The example linked above shows the hiderror option being used. In > that case, you are explicitly suppressing the automatic error disp

Re: [web2py] Re: Prevent multiple submit buttons from showing "Working..." on submit

2015-07-07 Thread Krzysztof Socha
On Wednesday, December 11, 2013 at 10:01:39 PM UTC+1, Mark Li wrote: > > I looked into the code and my web2py.js was not the same as the github > link, which I noticed because my forminputclickselector did not contain > > :not([name]) > > . When I diff-ed the original link for the newest web2py

[web2py] Adding scheduler to an existing app break the MySQL DB...

2014-06-24 Thread Krzysztof Socha
I am fighting it for some time now... I tried all the different ways to migrate the database so that the tables for the scheduler are created, but no luck - maybe someone could help... I have an existing application. Recently I decided I needed to run some things in the background, so I added a

Re: [web2py] Nginx/passenger/web2py -> 504 Gateway Timeout?

2014-04-17 Thread Krzysztof Socha
use it is not include by >> default, to me just that is enough to not consider it prod ready... >> >> Richard >> >> >> On Tue, Apr 15, 2014 at 3:34 AM, Krzysztof Socha wrote: >> >>> Thanks... But I kinda cannot... The hosting I am using is providin

Re: [web2py] Nginx/passenger/web2py -> 504 Gateway Timeout?

2014-04-15 Thread Krzysztof Socha
Thanks... But I kinda cannot... The hosting I am using is providing nginx + phusion passenger... and it works with a simple script, as I have shown. Unfortunately, it looks like the web2py handler never returns anything and the request time-outs... I do not even know where to look to understand

[web2py] Nginx/passenger/web2py -> 504 Gateway Timeout?

2014-04-13 Thread Krzysztof Socha
I am trying to setup (vanila) web2py on shared hosting with nginx and passenger with support for python. I put all the files from web2py folder in the folder expected by passenger, I created a file passenger_wsgi.py required by passenger, which I simlinked to wsgihandler.py (taken from the hand

[web2py] Re: Beginner question: foreign key constraint failed (?)

2014-03-28 Thread Krzysztof Socha
Just an update. It appears to be an issue with SQLITE. The actual problem was related to the fact that I have redefined AUTH_USER table (by company table - not all of it quated in my post). I had a missing field used in the default NavBar - first_name. When I switched from SQLITE to MYSQL, the

[web2py] Re: Beginner question: foreign key constraint failed (?)

2014-03-28 Thread Krzysztof Socha
On Thursday, March 27, 2014 5:21:34 PM UTC+1, Niphlod wrote: > > did you try with a fresh database ? > > After some investigation, it seems that the problem is not related to what I wrote above (!) I tried to change the DB - to MySQL - and the error reported changed to something like 'attribute

[web2py] Beginner question: foreign key constraint failed (?)

2014-03-27 Thread Krzysztof Socha
I created a simple table that uses another table as a list of possible values for a field: db.define_table('country', Field('name','string',length=DEFAULT_STRING_LENGTH)) db.define_table('company', Field('name', 'string', requires=IS_NOT_EMPTY(error_message=auth.messages.is_empty)), Field('addre