Re: [web2py] Re: navbar in sqlform.grid

2015-01-11 Thread Vid Ogris
Yes this is my db.py for one of those views db.define_table('shift', Field('sh_organisation' , 'reference organization', label = T('Organization')), Field('sh_code', type= 'string', length = 256, label = T('Code')), Field('sh_status', type= 'integer'

[web2py] Fwd: https and rescr.it responsive image

2015-01-11 Thread al ex
It seems I found the solution. It works if instead of https://trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg"; /> I use: https://mydomain/myapp/static/images/myimage.jpg " /> --

[web2py] Re: Please help us test the 2.9.12 binaries

2015-01-11 Thread Dmitry Ermolaev
in editor auto-Indent not worked (( shit-tab - not worked (( -- 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 s

[web2py] https and rescr.it responsive image

2015-01-11 Thread al ex
I am trying resrc.it (http://www.resrc.it/tutorials/preview) to manage responsive images. I use the scheme they suggest, on img tag: https://trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg"; /> where s=w300m is a paramter/value to get the image resized. This works fine w

[web2py] Re: What is the best way to add an extra input on the client side?

2015-01-11 Thread Przemysław Loesch
Massimo, thank you very much for your answer. List type widget works just great. I didn't know web2py already has the feature which I tried to implement in the complicated way. I'm wondering how many such goodies are waiting for me to discover in this great framework. Now going back to forms. T

[web2py] Re: Orderby on reference table

2015-01-11 Thread Massimo Di Pierro
How about this? L1, L2 = db.l1_categories, db.l2_categories categories=db(L2.l1_categories==L1.id).select(L2.ALL, orderby=L1.name ) On Sunday, 11 January 2015 15:57:47 UTC-6, Gael Princivalle wrote: > > Hello all. > > We talk about a categories system f

Re: [web2py] Re: does cache decorator work for services ?

2015-01-11 Thread Massimo Di Pierro
The order of the decorators is important. This: @cache('service_platdak', 300, cache.ram ) @service.csv def service_platdak(): registers the service (without caching) and the defined a cached action (normal action). This: @service.csv @cache('service_platdak', 300, cache.ram ) def service

[web2py] Re: Is the .select(cache.x) cleared automatically upon expiration?

2015-01-11 Thread Anthony
The key is the key you used to store the cached value (i.e., the first argument you pass to cache.ram, etc.). The regex is a standard Python regular expression that matches one or more keys. On Sunday, January 11, 2015 at 6:09:00 PM UTC-5, Robin Manoli wrote: > > Is there some documentation or e

[web2py] Why is the default form enctype multipart/form-data?

2015-01-11 Thread Richard Penman
Hello, I noticed the encoding type for all forms is multipart/form-data rather than application/x-www-form-urlencoded. Is there a reason for this? My understanding is the form-data encoding is useful for file uploads and when transferring large amounts of non-alphanumeric data, but otherwise is

[web2py] Re: Login to web2py from external script

2015-01-11 Thread Richard Penman
Strangely I found that the login forms works even when encode the data as usual for application/x-www-form-urlencoded: cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) html = opener.open(login_url).read() formkey = xpath.get(html, '//input[@name="_formkey

Re: [web2py] Re: webfaction nginx uwsgi install

2015-01-11 Thread Richard Baron Penman
When the script is run it converts this template into what I posted. So how has web2py changed since that would break this? On Sun, Jan 11, 2015 at 11:29 PM, Paolo Valleri wrote: > According to the script you mention, the uwsgi.xml should be much different > because it doesn't referee to any spe

[web2py] Re: Is the .select(cache.x) cleared automatically upon expiration?

2015-01-11 Thread Leonel Câmara
Well it's regular python regexes so you can just look at Python documentation. -- 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

[web2py] Re: Is the .select(cache.x) cleared automatically upon expiration?

2015-01-11 Thread Robin Manoli
Is there some documentation or examples for what values to use as key or regex? Den fredag 9 januari 2015 kl. 14:02:42 UTC+1 skrev Anthony: > > To clear a single item, you can use cache.ram(key, None), and to clear > multiple items, you can use cache.ram.clear(regex='[some regex]'). To clear >

[web2py] Orderby on reference table

2015-01-11 Thread Gael Princivalle
Hello all. We talk about a categories system for a vertical menu. Here is my model: db.define_table('l1_categories', Field('name'), format = '%(name)s') db.define_table('l2_categories', Field('l1_category', 'reference l1_categories'), Field('name'), format=lambda row: '%s - %

[web2py] lazy tables & auth_event

2015-01-11 Thread Louis Amon
Hello, I'm trying to optimize the performance of my website by using lazy tables. When I do so, every feature linked with Auth breaks with the following error msg : ProgrammingError: ('ERROR', '42703', 'column "created_on" of relation "auth_event" does not exist') I think it is due to the lo

[web2py] Updated appliances or web2py blog?

2015-01-11 Thread LoveWeb2py
Hello, I'm looking to implement a nice blog for my site. I'd like to use a web2py appliance if there is one available. I went through the old appliances but they all seem fairly old. Is there an site which has a list of all the current web2py projects or more specifically blogs that I could im

[web2py] Re: built-in wiki

2015-01-11 Thread Niphlod
http://web2py.com/books/default/chapter/29/03/overview#Extending-the-auth-wiki-feature On Sunday, January 11, 2015 at 5:50:24 PM UTC+1, mweissen wrote: > > I want to use the built-in wiki. > Ok, it starts. But (silly question): where is the storage for the new > pages. Is it a database table? But

Re: [web2py] Re: does cache decorator work for services ?

2015-01-11 Thread Stef Mientki
thanks Paolo and Leonel, things seems even weirder than I had in mind: 1. changing the order of the decorators: the program doesn't work anymore, there's no csv response anymore 2. the code form Leonel works, as long as you use it as a plain example Now I made 2 identical csv services, both w

[web2py] built-in wiki

2015-01-11 Thread Martin Weissenboeck
I want to use the built-in wiki. Ok, it starts. But (silly question): where is the storage for the new pages. Is it a database table? But there is no db.wiki... or db.auth_wiki ​R​ egar ​d​ s, Martin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.c

[web2py] Re: What is the best way to add an extra input on the client side?

2015-01-11 Thread Massimo Di Pierro
I would not use an additional table unless you plan to ever search by phone numbers. I would do: db.define_table ('institutions', Field('name'), Field('numbers','list:string')) In controler: form=SQLFORM(db.institution ) In view: {{=form}} You can also do w

[web2py] What is the best way to add an extra input on the client side?

2015-01-11 Thread Przemysław Loesch
Hi! I need to add extra fields to my custom form generated from some fields of different tables. These extra fields are are additional phone numbers for the institution. The code looks like this (here simplified for better readability): In model: db.define_table ('institutions', Field('name

[web2py] Re: postgresql error ... (relation "auth_user" already exists)

2015-01-11 Thread James McGlynn
I realize this thread is 5 years old, but it still came up when searching for help with the error above and I just wanted to add my struggles. I was getting the following error when deploying to Heroku: relation "web2py_session_3muses" already exists and it was because I had "applications/*/data

[web2py] Re: does cache decorator work for services ?

2015-01-11 Thread Leonel Câmara
There must be something else wrong with your code. This should work. My test: @cache('test', 600, cache.ram ) @service.csv def test(): import sys try: sys.N_Schuurdak += 1 except : sys.N_Schuurdak = 10 return {'N_Schuurdak': sys.N_Schuurdak} As expected it ret

[web2py] Re: does cache decorator work for services ?

2015-01-11 Thread Paolo Valleri
try to swap the order of the decoratos Paolo On Sunday, January 11, 2015 at 11:59:21 AM UTC+1, aapaap wrote: > > hello, > > I've a service, for which the output can change only ones every 10 > minutes. So I want to cache the resulting output. > To test if caching is working, I made the followi

[web2py] Re: webfaction nginx uwsgi install

2015-01-11 Thread Paolo Valleri
According to the script you mention, the uwsgi.xml should be much different because it doesn't referee to any specific app. it should be something like 127.0.0.1:${nginx_uwsgi_port} 4 /home/${USER}/webapps/${webfaction_app_name}/web2py /home/${USER}/webapps/${webfaction_app

[web2py] does cache decorator work for services ?

2015-01-11 Thread Stef Mientki
hello, I've a service, for which the output can change only ones every 10 minutes. So I want to cache the resulting output. To test if caching is working, I made the following setup: - In the view there's a javascript that requests a refresh of the data every minute. - A global sys.N_Schuurdak

[web2py] webfaction nginx uwsgi install

2015-01-11 Thread Richard Penman
Hello, I used the recipe here for installing web2py on webfaction with nginx and uwsgi: https://community.webfaction.com/questions/7193/install-web2py-with-nginx-and-uwsgi It worked great for me before but now have some problems. I copied uwsgihandler.py from handlers/ directory but get this err