Re: [web2py] How do I SELECT * FROM table WHERE field IN (1,2,3,4,7)

2014-04-06 Thread Martin Weissenboeck
Try db(db.table.field.belongs([1,2,3,4,7]) (db.table.field2==3)).select() db(db.table.field1.belongs([1,2,3,4,7]) (db.table.field2==3)).delete() Regards, Martin 2014-04-06 5:49 GMT+02:00 Kurt Jensen kurtis.jen...@gmail.com: How do I do : SELECT * FROM table WHERE field IN (1,2,3,4,7)

[web2py] Multiple domains, one app

2014-04-06 Thread Kenneth
Hello, is it possible to build an app that handle multiple domains but totally different layouts. I'm thinking something like this: views/domain1/layout.html default/index.html .. views/domain2/layout.html

[web2py] What is the purpose of auth.settings.login_userfield?

2014-04-06 Thread Ray (a.k.a. Iceberg)
I found many following lines in tools.py: userfield = self.settings.login_userfield or 'username' \ if 'username' in table_user.fields else 'email' Should it be this instead? userfield = self.settings.login_userfield or ('username' if 'username' in

[web2py] Re: Can't run web2py from App Engine Launcher

2014-04-06 Thread Vladimir Makarov
Just copy gaehandler.py from web2py\handlers to the web2py root folder. It works for me. And I use web2py souse instead of web2py win. On Saturday, April 5, 2014 4:54:03 AM UTC+4, gubbanoa wrote: I'm trying to run web2py 2.9.5 from Google App Engine Launcher 1.9.2 on Windows. After modifying

[web2py] Month picker

2014-04-06 Thread Pearu Peterson
Hi, In a form I'd like to have a field that contains month and year information, only. The current date picker (via using IS_DATE validator, for instance) includes also days which for the given application UI would be a noise. Is there any way to configure date pickler to show only months (as

[web2py] Re: Multiple domains, one app

2014-04-06 Thread Kenneth
One row is missing in my message: response.view= domain_url + request.controller + '/' + request.function + '.html' I have it in models/db.py so it reflects on all controllers. Kenneth Den söndagen den 6:e april 2014 kl. 09:56:38 UTC+3 skrev Kenneth: Hello, is it possible to build an

[web2py] Re: Multiple domains, one app

2014-04-06 Thread Anthony
I made an table called site that contains domainname and domain_url and by matching domainname and request.env.host_name I get an domain_url from database. In every .html I have changed the {{extend layout.html}} to {{extend domain_url + layout.html}} This approach may be somewhat

[web2py] importing modules to web2py

2014-04-06 Thread Maurice Waka
I have several modules with a print function in python 3.4. How do i import them to web2py and display the print to the web? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: What is the purpose of auth.settings.login_userfield?

2014-04-06 Thread Ray (a.k.a. Iceberg)
On Sunday, April 6, 2014 12:03:59 AM UTC-7, Ray (a.k.a. Iceberg) wrote: Just want to double confirm. 1. I found many following lines in tools.py: userfield = self.settings.login_userfield or 'username' \ if 'username' in table_user.fields else 'email' it means:

[web2py] Re: Can't run web2py from App Engine Launcher

2014-04-06 Thread gubbanoa
That works, thanks! On Saturday, April 5, 2014 3:51:10 PM UTC+1, Massimo Di Pierro wrote: Use trunk. We made some changes to fix appengine problems. Will release a 2.9.6 soon. It allows: web2py.py -G Which configures appending (app.yaml and gaehandler.py) for you. On Friday, 4 April

[web2py] Re: Multiple tables select

2014-04-06 Thread Júlia Rizza
Marin Pranjic answered me on Facebook: You need 4 separate queries to select records for given board and you can sort them afterwards, using python. First you merge the records using itertools.chain, then you sort it using sorted(merged_records, key=lambda record: record.created_on). Something

[web2py] Re: Question about Web2py inner workings

2014-04-06 Thread Cliff Kachinske
Ach! My sample was a simplified version of the file that is actually failing. Here is the actual code. Explanatory comments on line 3 and line 43 delineated with ## #. This fails every time on my system, Python 2.7.3 on Debian Wheezy. I wrote this to demonstrate the exact point made by

[web2py] Re: How do I post an image to web2py from HTML5 Canvas

2014-04-06 Thread Ari Lion BR Sp
Any answer? I have the very same need. Thanks Ari Em segunda-feira, 2 de dezembro de 2013 14h02min30s UTC-2, Michael Hall escreveu: If I have the following model: db.define_table('user_images', Field('my_image', 'upload', label=T('My Image')), ) and In my rendered html

[web2py] Re: Question about Web2py inner workings

2014-04-06 Thread Anthony
# Here is the change if found_it: print 'Now I\'m going to change it to pwned.' i_am_global = new_val Above you assign a value to i_am_global. Because you have not explicitly declared i_am_global as a global variable, it is automatically defined as being local to

[web2py] Re: Question about Web2py inner workings

2014-04-06 Thread Cliff Kachinske
Anthony, thank you. On Sunday, April 6, 2014 8:26:33 PM UTC-4, Anthony wrote: # Here is the change if found_it: print 'Now I\'m going to change it to pwned.' i_am_global = new_val Above you assign a value to i_am_global. Because you have not explicitly declared

[web2py] Re: How do I SELECT * FROM table WHERE field IN (1,2,3,4,7)

2014-04-06 Thread Cliff Kachinske
Kurt, I think the key is to realize that the WHERE clause comes first in DAL dialect, and the fields to be selected come after. On Saturday, April 5, 2014 11:49:28 PM UTC-4, Kurt Jensen wrote: How do I do : SELECT * FROM table WHERE field IN (1,2,3,4,7) AND field2='3' AND / OR DELETE