Re: [web2py] Re: Running multiple lines of SQL in executesql

2015-03-12 Thread Naveed Ahmed
Thank you, I tried this: db.executesql("""set @num := 0, @type := ''; select type, variety, price from ( select type, variety, price, @num := if(@type = type, @num + 1, 1) as row_number, @type := type as dummy from fruits order by type, price

Re: [web2py] Re: Running multiple lines of SQL in executesql

2015-03-11 Thread Naveed Ahmed
Yes it works from the DB’s interface and yes, I’m using MySQL. From: Brian M Sent: Wednesday, March 11, 2015 3:18 PM To: web2py@googlegroups.com Subject: Re: [web2py] Re: Running multiple lines of SQL in executesql Strange. Does that same query work if you enter it directly in your DB's interf

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-03 Thread Naveed Ahmed
This helps a lot, thank you. From: Leonel Câmara Sent: Tuesday, March 03, 2015 2:53 PM To: web2py@googlegroups.com Subject: [web2py] Re: Problems after upgrading to 2.9.12 You can do this {{from gluon.serializers import json}} {{=XML(json(myrows), sanitize=False)}} -- Resources: - http://w

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-03 Thread Naveed Ahmed
Thanks. I did go along this path, but I was trying to use a database rows object, I need to iterate through it in the view, but javascript needs to iterate through it as well. The response json method works well for this, but as you mention it’s not a response. Is there a similar web2py method t

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-03 Thread Naveed Ahmed
Ok, how do I convert a python object to a json object in the view? From: Niphlod Sent: Tuesday, March 03, 2015 2:10 PM To: web2py@googlegroups.com Subject: Re: [web2py] Re: Problems after upgrading to 2.9.12 then, it's exactly as I said: the improper use of response.json. On Tuesday, March 3,

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-03 Thread Naveed Ahmed
Sorry, I should have been more clear. It’s caused by adding the line {{=(response.json(['foo', {'bar': ('baz', None, 1.0, 2)}])) }} in to the existing index.html From: Niphlod Sent: Tuesday, March 03, 2015 4:21 AM To: web2py@googlegroups.com Subject: Re: [web2py] Re: Problems after upgrading

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-02 Thread Naveed Ahmed
Looks like it’s caused by this line of code in index.html in the welcome app: {{=(response.json(['foo', {'bar': ('baz', None, 1.0, 2)}])) }} From: Niphlod Sent: Monday, March 02, 2015 1:56 PM To: web2py@googlegroups.com Subject: Re: [web2py] Re: Problems after upgrading to 2.9.12 that's def

Re: [web2py] Re: Problems after upgrading to 2.9.12

2015-03-02 Thread Naveed Ahmed
Makes sense for the json response, but why is the index which uses an html view returning as json? From: Niphlod Sent: Monday, March 02, 2015 2:41 AM To: web2py@googlegroups.com Subject: [web2py] Re: Problems after upgrading to 2.9.12 it's a bug that got fixed. You used to rely on response.jso

Re: [web2py] Re: web2py: encrypt uploaded files

2012-04-12 Thread Naveed Ahmed
I wasn’t asking as how to encrypt the file itself, but how to incorporate it in to web2py’s existing excellent form upload and download system. Assuming that we have functions encrypt(file, password) and decrypt(file, password) which return the encrypted and decrypted file respectively. From:

Re: [web2py] Re: web2py: encrypt uploaded files

2012-04-11 Thread Naveed Ahmed
Thanks Massimo for getting back. I can’t use an encrypted file system as when the file system is mounted, it’s totally open. Every file can be encrypted with the same master password. I’m thinking of storing this master password which is itself encrypted using the user’s password (or it’s hash)

Re: [web2py] Prevent mobile rendering on iPad/Tablets

2012-04-04 Thread Naveed Ahmed
I worked around it using this: {{is_mobile=request.user_agent().is_mobile and not request.user_agent().is_tablet}} in layout.html Naveed From: Anthony Sent: Tuesday, April 03, 2012 08.45 To: web2py@googlegroups.com Subject: Re: [web2py] Prevent mobile rendering on iPad/Tablets Any future

Re: [web2py] Change the case in auth.navbar?

2012-01-26 Thread Naveed Ahmed
Thanks, I didn’t think of that. This will help. From: Martín Mulone Sent: Thursday, January 26, 2012 06.17 To: web2py@googlegroups.com Subject: Re: [web2py] Change the case in auth.navbar? Remember you can do it with css: .auth_navbar a { text-transform:capitalize; }

Re: [web2py] Change the case in auth.navbar?

2012-01-25 Thread Naveed Ahmed
I agree. From: Anthony Sent: Wednesday, January 25, 2012 18.54 To: web2py@googlegroups.com Subject: Re: [web2py] Change the case in auth.navbar? Yeah, that's why we should probably just make it configurable. :-) On Wednesday, January 25, 2012 7:46:39 PM UTC-5, ニコノコ wrote: Hmm ... if one is