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

2015-03-12 Thread Naveed Ahmed
and it will work fine. I do that all the time. No need for the \ at each line break then either. You can declare and set your @variables all within one executesql query too. On Tuesday, March 10, 2015 at 2:36:28 PM UTC-5, naveed wrote: I need to execute multiple lines of SQL in web2py, something like

[web2py] Why does this not work: {{=LOAD(c='default', f='user', args='login', ajax=True)}}?

2015-03-12 Thread naveed
I'd like to be able to login a user using ajax if possible. I thought using LOAD for the built-in user forms would work, but when I add this to my index.html {{=LOAD(c='default', f='user', args='login', ajax=True)}} It only shows Loading Is this possible or do I have to use

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

2015-03-11 Thread Naveed Ahmed
interface? I'm guessing from the link you provided that you're using MySQL; I've only done it with MS SQL and SQLite but I'd think that the triple quoting technique should work with other databases too. On Wednesday, March 11, 2015 at 11:09:58 AM UTC-5, naveed wrote: Thank you, I tried

[web2py] Ajax User Registration

2015-03-10 Thread naveed
I have ajax login working using auth.login_bare, but I can't figure out how to do the same for register. I do see register_bare, but it's probably not what I need. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Running multiple lines of SQL in executesql

2015-03-10 Thread naveed
I need to execute multiple lines of SQL in web2py, something like this: db.executesql(set @num := 0, @type := '';)\ rows = db.executesql(select type, variety, price\ from (\ select type, variety, price,\ @num := if(@type = type, @num + 1, 1) as row_number,\

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

2015-03-10 Thread naveed
Ok, I moved it to a stored procedure and it works. Thanks for your help. It would be nice to be able to run multiple queries in one call - I prefer to keep my code in code, not in the database, but I'm probably asking for too much. -- Resources: - http://web2py.com -

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

2015-03-03 Thread Naveed Ahmed
to 2.9.12 uhm. isn't there https://github.com/web2py/web2py/blob/master/applications/welcome/views/default/index.html On Tuesday, March 3, 2015 at 12:09:47 AM UTC+1, naveed wrote: Looks like it’s caused by this line of code in index.html in the welcome app: {{=(response.json(['foo', {'bar

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

2015-03-03 Thread Naveed Ahmed
, 2015 at 8:59:59 PM UTC+1, naveed wrote: 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 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http

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

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: -

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

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

[web2py] Problems after upgrading to 2.9.12

2015-03-01 Thread naveed
I was running a version 2.8.x without any trouble except that the forgot email feature was not working. I upgraded to 2.9.12 and my index page is being rendered as text (the source is being displayed on the browser). The content-type is showing up as json instead of html. I made NO changes to

Re: [web2py] Re: gzip on Lighttpd

2012-10-10 Thread naveed
Ah! Let me try that. Thanks! On Tuesday, October 9, 2012 6:29:50 PM UTC-5, Michele Comitini wrote: Use scgi on lighttpd: the scgihandler does the compression too, fast. mic --

[web2py] Re: gzip on Lighttpd

2012-10-09 Thread naveed
Which webserver would you recommend on a VPS with 1GB RAM? I'm considering Cherokee or nginx. On Friday, October 5, 2012 6:17:39 PM UTC-5, Niphlod wrote: that docs basically says that the app needs to do compression on it's own. apache and nginx support compression of dynamic content

[web2py] gzip on Lighttpd

2012-10-05 Thread naveed
A question was asked earlier on enabling gzip with web2py and Massimo answered that it's handled by the webserver. https://groups.google.com/forum/?fromgroups=#!topic/web2py/LcfRSGN-Tbo Lighttpd handles gzip compression but in their documentation about

[web2py] Re: Specify update column

2012-06-29 Thread naveed
Awesome! Thanks, Anthony

[web2py] Specify update column

2012-06-28 Thread naveed
I understand I can do an update in web2py like so: db(query).update(field=value) where field corresponds to a column in the table. If I have the column name as a string, how can I use this string variable to specify the column to do an update?

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

2012-04-12 Thread Naveed Ahmed
, 11 April 2012 12:35:05 UTC-5, naveed wrote: 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

[web2py] web2py: encrypt uploaded files

2012-04-11 Thread naveed
I need to encrypt uploaded files in web2py (for a HIPAA compliant application) preferably with AES. How can I accomplish this?

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

2012-04-11 Thread Naveed Ahmed
uploaded files What are the specs? Can you store them in an encrypted file system? can you encrypt them with the same password? Should every file be encrypted with a different password? Where should the passwords be stored? On Wednesday, 11 April 2012 11:54:24 UTC-5, naveed wrote: I need

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

[web2py] Prevent mobile rendering on iPad/Tablets

2012-03-31 Thread naveed
How can I prevent web2py from rendering the mobile version on an iPad and other tablets. I don't want to disable mobile rendering altogether. It works fine on the iPhone/Android, but I'd like to use the standard full rendering on tablets. Thanks!

Re: [web2py] Re: Grid: Pull field, but not display it, so it can be used by links

2012-02-23 Thread naveed
Thank you, Johann, I'll try this.

[web2py] Grid: Pull field, but not display it, so it can be used by links

2012-02-22 Thread naveed
I like the grid a lot, but I think I am missing something. I have 2 fields called age and age_units. The age_units field is stored as an integer. I want to be able to show the age as a combination of the two fields including some processing to convert the int to the proper string unit. I am

[web2py] Re: Grid: Pull field, but not display it, so it can be used by links

2012-02-22 Thread naveed
Done. Thanks, Massimo.

[web2py] Re: Grid: Pull field, but not display it, so it can be used by links

2012-02-22 Thread naveed
That worked! Thanks, Anthony! Perhaps, this should be added to the manual? Should I close the defect?

[web2py] Re: Grid: Pull field, but not display it, so it can be used by links

2012-02-22 Thread naveed
A slightly related question: In the grid, how can I show values from referenced tables? I have the table: db.define_table('table1', Field('field1'), Field('usr', db.auth_user)) How can I show the user's first and last names in the grid for table1? The ignores the usr column altogether,

[web2py] registration_requires_approval login_after_registration

2012-02-06 Thread naveed
I don't know if I'm doing something wrong or it's not working as expected. I want the user to be approved before they can log in. I created a new application in web2py with all the default settings. In db.py, I added: auth.settings.registration_requires_approval = True

[web2py] Re: registration_requires_approval login_after_registration

2012-02-06 Thread naveed
Never mind. I don't know what was wrong, but python got frozen. After killing all python process and restarting it, it seems to be working perfectly.

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; }

[web2py] Change the case in auth.navbar?

2012-01-25 Thread naveed
The navbar for me shows like this: Login | Register | forgot username? | Lost password? The forgot username? is in all lowercase, while the others are in sentence case. What is the cleanest way of making them consistent? Thanks!

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

2012-01-25 Thread naveed
Thanks, I just submitted it.

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

2012-01-25 Thread naveed
It's forgot USERNAME vs forgot PASSWORD.

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

2012-01-25 Thread Naveed Ahmed
? On Wednesday, January 25, 2012 7:03:18 PM UTC-5, naveed wrote: It's forgot USERNAME vs forgot PASSWORD.

[web2py] web2py How can I use images in radiobuttons generated from a SQLFORM

2011-04-29 Thread naveed
I would like to generate a SQLFORM with radiobuttons using the radiobutton widget as below (code trimmed): db.define_table('tabA', Field('name', 'string', length=16, required=True, unique=True, ), Field('shape', 'string', length=8, default='star', widget=SQLFORM.widgets.radio.widget,