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
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
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
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)
-
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,\
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
-
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
, 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
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
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:
-
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
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
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
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
--
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
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
Awesome! Thanks, Anthony
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?
, 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
I need to encrypt uploaded files in web2py (for a HIPAA compliant
application) preferably with AES. How can I accomplish this?
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
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
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!
Thank you, Johann, I'll try this.
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
Done. Thanks, Massimo.
That worked! Thanks, Anthony! Perhaps, this should be added to the manual?
Should I close the defect?
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,
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
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.
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;
}
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!
Thanks, I just submitted it.
It's forgot USERNAME vs forgot PASSWORD.
?
On Wednesday, January 25, 2012 7:03:18 PM UTC-5, naveed wrote:
It's forgot USERNAME vs forgot PASSWORD.
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,
36 matches
Mail list logo