Re: [web2py] limitby without orderby - why primary ids of tables are added as orderby

2011-09-22 Thread Tarun Arora
http://www.depesz.com/index.php/2007/09/16/my-thoughts-on-getting-random-row/ explains alternate approaches than using order by random(). "this is very good way to get truly random records. there is no “preference” for specific rows. the major drawback is speed. or lack of it actually."

Re: [web2py] limitby without orderby - why primary ids of tables are added as orderby

2011-09-22 Thread Tarun Arora
any orderby is over-head (small or big). Also limit with order by is not cost-efficient since limiting is done after ordering rows, resulting in fetching of all rows. For time being, I am using executesql to execute my query.

[web2py] limitby without orderby - why primary ids of tables are added as orderby

2011-09-22 Thread Tarun Arora
I have a requirement, just to have 50 random records from table without any order. I don't want to use any orderby condition as number of records in tables is very large and any ordering is over-head cost when I need random records. A query like *db().select(db.person.name, limitby=(0,50)) *aut

[web2py] reset_password_onvalidation fired while requesting retrieve_password form

2011-09-21 Thread Tarun Arora
web2py version 1.98.2 I have a custom form on reset_password, where i want to have my own validations on top of default validations, but reset_password_onvalidation was not called on resetting password. Digging into code, I observed that while fetching retrieve_password form onvalidation is se

[web2py] form=auth() does not honor setting.login_url incase no arg is passed

2011-09-19 Thread Tarun Arora
web2py version 1.98.2 If a custom url is set for login_url (via auth.settings.login_url) and no arg is passed, auth() does not honor login_url and redirects to url based on controller set while initializing Auth() e.g. auth=Auth(globals(),db) auth.settings.login_url = URL(request.application,

[web2py] Re: postgres - prepared statements in DAL?

2011-08-03 Thread Tarun Arora
We have lots of queries where we only need to change variables( bind parameters) and I was thinking of using prepared statements as it is recommended way for optimize performance to avoid over ahead costs of planning, parsing by query analyzer each time query is executed. 2-phase commit it not

[web2py] Re: Help needed with Google App Engine on Ubuntu 11.04

2011-08-03 Thread Tarun Arora
I was facing same issues. I found a ppa for python 2.5. It is maintained by Felix Krull sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update sudo apt-get install python2.5 After this urllib2.HTTPSHandler errors were gone and was

[web2py] postgres - prepared statements in DAL?

2011-08-03 Thread Tarun Arora
Is it possible to create and execute prepared statements in DAL for postgresql? I observed there is a prepare api for creating 'PREPARE TRANSACTIONS' for two-phase commit but no api for prepared statements.