[web2py] share auth across applications

2011-12-15 Thread Chandrakant Kumar
How to share authentication across applications?

[web2py] Solidform: key-error

2011-12-15 Thread Johann Spies
I get table = self.createform(xfields) File applications/init/modules/plugin_solidform.py, line 96, in createform n = len(self.flat_fields) KeyError: 'article_eq' when I use the following code: fields = ['id', 'title', 'primaryauthor',

[web2py] Re: Smartgrid trouble: exceptions KeyError

2011-12-15 Thread tsvim
Ok, after reading up on user_signature, I don't really like to turn it off. If I do turn it off, I'd like at least something that will allow the same for anonymous users. Is there anyway I can generate a user_signature for some anonymous user? Thanks, Tsvi

[web2py] problem with mod_wsgi deployment

2011-12-15 Thread Web2Py Freak
Dear All, i am trying to use mod_wsgi with apache on fedora i installed web2py in var/www/ and i unzipped it , and i edited the httpd.conf and added the virtual host script but it keeps giving me this error with i do $ service httpd start the error is : bad user name : root@linux what to do

[web2py] requires IS_IN_SET()

2011-12-15 Thread Chandrakant Kumar
I'm adding extra fields to auth_user as, auth.settings.extra_fields['auth_user']= [ Field('user_type', requires=IS_IN_SET('Admin', 'Staff'))] But, in the Register form I'm getting a listbox with single letter options like, a, d, m, i, n. Is there something missing?

[web2py] Re: requires IS_IN_SET()

2011-12-15 Thread Alan Etkin
You might pass a sequence or dictionary instead of single arguments: IS_IN_SET([A, B, C]) or IS_IN_SET({a: a, b: b, ...}) Seems that IS_IN_SET is reading the input as a list of characters On 15 dic, 08:29, Chandrakant Kumar k.03chan...@gmail.com wrote: I'm adding extra fields to auth_user

[web2py] Change the default app folder

2011-12-15 Thread Alan Etkin
I was looking in the book for an option to change the default path of a web2py application folder, so when using appadmin to modify it or requesting actions from a browser makes web2py use another folder than the original /.../applications/app path. I found the Execution environment section but i

Re: [web2py] Re: requires IS_IN_SET()

2011-12-15 Thread Chandrakant Kumar
passing a dictionary worked fine. On Thu, 15 Dec 2011 17:36:29 +0530, Alan Etkin spame...@gmail.com wrote: You might pass a sequence or dictionary instead of single arguments: IS_IN_SET([A, B, C]) or IS_IN_SET({a: a, b: b, ...}) Seems that IS_IN_SET is reading the input as a list of

[web2py] Re: share auth across applications

2011-12-15 Thread Alan Etkin
In another thread, Anthony mentioned that it is possible to share objects between apps if i recall correctly (i think using import). So i suppose you could replace an auth object with other from another application to share it. In the book there is an authentication example wich uses one app for

[web2py] Re: Two questions: 1. empty SQLFORM.grid 2. Represent question

2011-12-15 Thread Cliff
Yes it has. The sample code runs on 1.99.2. Updated for 1.99.4 it shows the same behavior. Grid displays no information from the dogs table. On Dec 15, 12:12 am, Jim Steil j...@qlf.com wrote: Yes On 12/14/2011 10:25 PM, Nik Go wrote: columns support has been dropped, right? On

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread pbreit
Bump

[web2py] Re: the Set class should be deprecated

2011-12-15 Thread Alan Etkin
(db.mytable.id == 3).select() It appears as a one length tuple that has a select() method. Wouldn't such changes bring compatibility issues with former formats?

[web2py] Re: the Set class should be deprecated

2011-12-15 Thread Alan Etkin
Sorry, that is more likely to be a bool object with a select() method. Since a single comparison is supposed to return such object and not a sequence On 15 dic, 10:14, Alan Etkin spame...@gmail.com wrote: (db.mytable.id == 3).select() It appears as a one length tuple that has a select()

[web2py] Re: Smartgrid trouble: exceptions KeyError

2011-12-15 Thread Cliff
import string import random mykey = ''.join( random.choice(string.ascii_lowercase+string.digits)\ for x in range(32) ) session.auth.hmac_key = mykey Read up on hmac_key in the online book.

[web2py] Re: share auth across applications

2011-12-15 Thread Cliff
http://web2py.com/book/default/chapter/04#Cooperation I have cooperating applications which share several tables. It's a royal pain keeping them from stepping on each other when I upgrade the models because of the migrate issue described in the book. In retrospect perhaps I should have gone for

[web2py] Re: the Set class should be deprecated

2011-12-15 Thread Anthony
A Query is not, as some web2py docs claim, just a WHERE clause. It superficially resembles a WHERE clause, but it also implicitly encodes the joining of tables. Though I believe it joins tables by using the WHERE clause (as opposed to JOIN, which is used when you pass the join or left

[web2py] Re: matplotlib plugin

2011-12-15 Thread andrej burja
probably problem with mod_wsgi any solutions? andrej

[web2py] Re: weird database behavior

2011-12-15 Thread Cliff
After the user registers, you should probably redirect him to a login page that politely says something like: Thank you for registering. Log in now to get access to the all the features of our fantastic site. On Dec 14, 11:37 pm, Anthony abasta...@gmail.com wrote: On Wednesday, December 14,

[web2py] Re: bulk_insert

2011-12-15 Thread lyn2py
Thank you Johann, you got me thinking! So if I have a bunch of records and some are existing in the tables already, I would have to go through each of them to perform a update_or_insert. Am I wrong to say that this method is resource intensive? Is there a way to ease the db load? (And I

[web2py] NameError: name 'Scheduler' is not defined

2011-12-15 Thread Tito Garrido
Hello folks, I'm trying to use Scheduler but as soon as I start web2py with -K option I'm receiving: exec ccode in environment File applications/gt2/models/db.py, line 331, in module myscheduler = Scheduler(db,dict(teste=teste)) NameError: name 'Scheduler' is not defined Do I need to

[web2py] Re: Statistics ???

2011-12-15 Thread lyn2py
I would be happy to participate in a survey like this. On Dec 15, 12:42 pm, Vineet vineet.deod...@gmail.com wrote: Good idea. On stackoverflow.com, one can accept an answer rate comments. But on google groups, AFAIK, there isn't any such provision. We, the web2py community, may develop a

[web2py] Re: Change the default app folder

2011-12-15 Thread lyn2py
Have you looked at routes.py? http://web2py.com/book/default/chapter/04#URL-Rewrite Or did I misunderstand your question? On Dec 15, 8:47 pm, Alan Etkin spame...@gmail.com wrote: I was looking in the book for an option to change the default path of a web2py application folder, so when using

Re: [web2py] share auth across applications

2011-12-15 Thread Anthony
If you want single sign-on functionality, check out CAS: http://web2py.com/book/default/chapter/08#Central-Authentication-Service. Otherwise, you could have multiple apps share the same db for the Auth tables -- though all apps will need to use the same hmac key. If you want login to apply to

[web2py] 1.99.4 grid, How can I fix query dropdown?

2011-12-15 Thread Cliff
The grid dropdown box for custom queries has an empty first line. Is there something I can do about it without digging into the javascript?

[web2py] Re: share auth across applications

2011-12-15 Thread Cliff
I share the auth tables as described by Anthony. This means putting the app tables in a separate model file to be processed after db.py. Processing is alphabetical. On Dec 15, 9:16 am, Anthony abasta...@gmail.com wrote: If you want single sign-on functionality, check out

Re: [web2py] Re: Smartgrid trouble: exceptions KeyError

2011-12-15 Thread Tsvi Mostovicz
I want to have a working demo of my app for anybody that comes to the site. If they decide to stay I save their data, otherwise I delete it with a cron job. I understand the signature is supposed to prevent hijacking of the session. I don't want the data to be compromised, even for a anonymous

Re: [web2py] ldap failed Version 1.99.4

2011-12-15 Thread Omi Chiba
Nico, Yes, it works ! Actually the code is there for the error check reason so instead of comment out, I moved the line 92 - 94 after line 105 where result variables is declared. The attached file is the modified ldap_auth.py and I will send the patch to Massimo shortly. Looks like this:

Re: [web2py] requires IS_IN_SET()

2011-12-15 Thread Jonathan Lundell
On Dec 15, 2011, at 3:29 AM, Chandrakant Kumar wrote: I'm adding extra fields to auth_user as, auth.settings.extra_fields['auth_user']= [ Field('user_type', requires=IS_IN_SET('Admin', 'Staff'))] But, in the Register form I'm getting a listbox with single letter options

Re: [web2py] ldap failed Version 1.99.4

2011-12-15 Thread Nicolas Palumbo
that's great! On Thu, Dec 15, 2011 at 12:43 PM, Omi Chiba ochib...@gmail.com wrote: Nico, Yes, it works ! Actually the code is there for the error check reason so instead of comment out, I moved the line 92 - 94  after line 105 where result variables is declared. The attached file is the

[web2py] remove references problem

2011-12-15 Thread thodoris
I know that if i declare the following db.define_table('person', Field('name'),) db.define_table('cat', Field('name'), Field('owner',db.person)) db.cat.owner.requires = IS_IN_DB(db, db.person.id) Then if i delete a person, all the cats of this person will be deleted. But i declare the cat

[web2py] Re: remove references problem

2011-12-15 Thread thodoris
Well i guess that doing db.define_table('cat', Field('name'), Field('owner',db.person,default=db.person.id)) db.cat.owner.requires = IS_IN_DB(db, db.person.id) does the job.

[web2py] Re: Where is the best place to make e-mail by registration and login to be converted always to lower case?

2011-12-15 Thread Constantine Vasil
I added this code (reset_email_lower) to registration too. But I checked the database and see the following: 1) I create a new user account with email all lower case. 2) the app logs in as default. 3) Log out. 4) I try to create a new user account with same email but first letter a capital. I

Re: [web2py] referenced auth.user_id type string

2011-12-15 Thread thodoris
This is a solution but look at the following, if i declare db.define_table('person', Field('name'),) db.define_table('cat', Field('name'), Field('owner',integer,db.person,default=db.person.id)) db.cat.owner.requires = IS_IN_DB(db, db.person.id) the reference is broken. Is there another

Re: [web2py] referenced auth.user_id type string

2011-12-15 Thread thodoris
By reference is broken i mean that if i remove at some point the person, the cat that belongs to that person is not removed...

[web2py] Re: smartgrid - onblur

2011-12-15 Thread Adnan Smajlovic
anyone plz? i tried searching and looking through online documentation for smartgrid, but can't figure out how to attach onblur to a dropdown field, and then to insert value into another field based on dropdown selection. I'm newbie to web2py but I really love it... and have to make this app

[web2py] generic virtual field class

2011-12-15 Thread Richard
Hello, Can I make a virtual field class generic and how? Here my virtual field class : from utils import md5_hash class v_f_s(object): def hmd5(self): return md5_hash('|'.join(str(self.test1[k]) for k in db.test1.fields())) I would like to pass test1 as a argument or getting it

Re: [web2py] requires IS_IN_SET()

2011-12-15 Thread Chandrakant Kumar
oh, now i understand, thanks for your explanation jonathan. On Thu, 15 Dec 2011 21:13:42 +0530, Jonathan Lundell jlund...@pobox.com wrote: On Dec 15, 2011, at 3:29 AM, Chandrakant Kumar wrote: I'm adding extra fields to auth_user as, auth.settings.extra_fields['auth_user']= [

[web2py] Re: web2py book 4th Edition

2011-12-15 Thread Massimo Di Pierro
I have not posted the PDF version yet. Tech problems. The only 4th edition is the softcover print. On Dec 14, 3:11 pm, greenpoise danel.sega...@gmail.com wrote: is the book @ lulu the pdf version or hard cover? On Dec 10, 9:44 am, Angelo Compagnucci angelo.compagnu...@gmail.com wrote:

[web2py] Re: Image broken in exported CSV

2011-12-15 Thread Massimo Di Pierro
You need to store the original filenames in a different field. If I remember there is an eaxmple in the manual. On Dec 14, 3:45 pm, Alan Etkin spame...@gmail.com wrote: If you want to store filenames with the original name (not encoded) you must create a custom

[web2py] Re: Backbonejs in web2py

2011-12-15 Thread Massimo Di Pierro
:-) On Dec 14, 3:34 pm, howesc how...@umich.edu wrote: http://www.starmakerstudios.com/uses web2py backend with a coffee script/backbone front end.  so web2py provides all the data, and the coffee/backbone does the layout/interactions.  point being that it has been done before. :) cfh

[web2py] Re: 1.99.4 is OUT

2011-12-15 Thread Massimo Di Pierro
Sorry I had missed this. Will fix shortly. On Dec 14, 5:33 pm, Paolo Caruccio paolo.carucci...@gmail.com wrote: I already wrote how i fixed the issue (tested only IE9, chrome 15, firefox 8 and Opera 11.60 on windows7) in a previous thread

[web2py] Re: the Set class should be deprecated

2011-12-15 Thread Massimo Di Pierro
I have proposed this once and there was opposition to the change. On Dec 15, 1:46 am, Brian Will brian.thomas.w...@gmail.com wrote: The problem is that Set is superfluous, oddly named, and thereby makes the whole DAL confusing to learners. I experienced this confusion myself when learning

[web2py] adding form arguments to URL during handling

2011-12-15 Thread Carl
is there a pattern for displaying form values in the URL that the form submits to? I'd like a form submitted that accepts three values to look like this: .../default/birthdate/2/9/2011 in this way users can copy or bookmark the page that displays the results of the submission. this

[web2py] Re: NameError: name 'Scheduler' is not defined

2011-12-15 Thread Massimo Di Pierro
from scheduler import Scheduler On Dec 15, 8:10 am, Tito Garrido titogarr...@gmail.com wrote: Hello folks, I'm trying to use Scheduler but as soon as I start web2py with -K option I'm receiving:     exec ccode in environment   File applications/gt2/models/db.py, line 331, in module    

[web2py] Re: Statistics ???

2011-12-15 Thread Massimo Di Pierro
We have a number of apps for takings survey. Most are old and could be improved. This is a recent one stripped to its barebones. http://tests.web2py.com/depoll On Dec 14, 10:42 pm, Vineet vineet.deod...@gmail.com wrote: Good idea. On stackoverflow.com, one can accept an answer rate comments. 

[web2py] Re: ldap failed Version 1.99.4

2011-12-15 Thread Massimo Di Pierro
Looks like we need a 1.99.5 thanks Omi On Dec 15, 9:43 am, Omi Chiba ochib...@gmail.com wrote: Nico, Yes, it works ! Actually the code is there for the error check reason so instead of comment out, I moved the line 92 - 94  after line 105 where result variables is declared. The attached

[web2py] Re: adding form arguments to URL during handling

2011-12-15 Thread Massimo Di Pierro
def birthdate(): day,month,year = request.args(0),request.args(1),request.args(2) On Dec 15, 11:31 am, Carl m...@carlroach.com wrote: is there a pattern for displaying form values in the URL that the form submits to? I'd like a form submitted that accepts three values to look like this:

Re: [web2py] Re: Statistics ???

2011-12-15 Thread António Ramos
I think the important here is not to have a survey app in web2py but to survey the users of web2py about web2py. with or without a survey app in web2py Let me suggest LimeSurvey. Its excellent 2011/12/15 Massimo Di Pierro massimo.dipie...@gmail.com We have a number of apps for takings

[web2py] Re: adding form arguments to URL during handling

2011-12-15 Thread Carl
and what happens if the user enters the value on the form and submits the form rather than enters the values directly in an URL? how do the three values get added to the URL?

[web2py] Re: Change the default app folder

2011-12-15 Thread Alan Etkin
Basically, what I want is to instruct web2py that absolute/path/to/ folder should be treated as if it were web2pyroot/applications/ someapp, so i would be able to use the admin interface and run that app in the web server without the need to store the applicacion files into the applications web2py

Re: [web2py] generic virtual field class

2011-12-15 Thread Richard Vézina
Bump! Richard On Thu, Dec 15, 2011 at 11:56 AM, Richard ml.richard.vez...@gmail.comwrote: Hello, Can I make a virtual field class generic and how? Here my virtual field class : from utils import md5_hash class v_f_s(object): def hmd5(self): return

[web2py] Re: adding form arguments to URL during handling

2011-12-15 Thread Anthony
On Thursday, December 15, 2011 1:17:02 PM UTC-5, Carl wrote: and what happens if the user enters the value on the form and submits the form rather than enters the values directly in an URL? how do the three values get added to the URL? I suppose after receiving the form submission, you

[web2py] Re: Statistics ???

2011-12-15 Thread Massimo Di Pierro
What quesitons? On Dec 15, 11:56 am, António Ramos ramstei...@gmail.com wrote: I think the important here is not to have a survey app in web2py but to survey the users of web2py about web2py. with or without a survey app in web2py Let me suggest LimeSurvey. Its excellent 2011/12/15 Massimo

[web2py] Re: the Set class should be deprecated

2011-12-15 Thread Anthony
On Thursday, December 15, 2011 12:30:43 PM UTC-5, Massimo Di Pierro wrote: I have proposed this once and there was opposition to the change. Do you recall the arguments against?

[web2py] email/password login only: How to change email to lower case at the register page and store as a lower case to the database.

2011-12-15 Thread Constantine Vasil
How to make this possible: I have only email/password as login. Want email to be changed to lower case at the register page and stored as a lower case to the database. Made this for login/reset password, how to make it for register page as well? Registering with mixed case creates a new user

[web2py] 1:N relation with auth_user

2011-12-15 Thread Chandrakant Kumar
I'm trying to establish one to many relation with auth_user, but i'm getting this error: Traceback (most recent call last): File /home/chandra/dev/web2py/gluon/restricted.py, line 194, in restricted exec ccode in environment File

Re: [web2py] referenced auth.user_id type string

2011-12-15 Thread Anthony
On Thursday, December 15, 2011 11:42:42 AM UTC-5, thodoris wrote: This is a solution but look at the following, if i declare db.define_table('person', Field('name'),) db.define_table('cat', Field('name'), Field('owner',integer,db.person,default=db.person.id)) db.cat.owner.requires

[web2py] problems with linked fields using db[tablename]

2011-12-15 Thread monotasker
I'm writing a plugin that needs to work with any arbitrary db table. The table name is passed to my controller, and that string (the variable 'tablename') is used in building a query. I can't just do db.tablename, so instead I'm doing db[tablename] and it generally seems to work. But when I do

Re: [web2py] Re: Statistics ???

2011-12-15 Thread António Ramos
To Massimo, Don´t you have questions to all of us? about web2py? As a user I would like to know from all users ,for example what other tools people use with web2py Are you using web2py for personal use or commercial What do you like more in web2py. What you like less in web2py. and so on...

Re: [web2py] 1:N relation with auth_user

2011-12-15 Thread Anthony
Does this code get run before your db.auth_user table has been defined? On Thursday, December 15, 2011 1:49:31 PM UTC-5, Chandra wrote: I'm trying to establish one to many relation with auth_user, but i'm getting this error: Traceback (most recent call last): File

[web2py] Re: email/password login only: How to change email to lower case at the register page and store as a lower case to the database.

2011-12-15 Thread Anthony
Have you tried adding the IS_LOWER validator to the email field when the register form is submitted? On Thursday, December 15, 2011 1:43:27 PM UTC-5, Constantine Vasil wrote: How to make this possible: I have only email/password as login. Want email to be changed to lower case at the

Re: [web2py] 1:N relation with auth_user

2011-12-15 Thread Chandrakant Kumar
no, i'm sharing the auth tables from another application in a separate model (auth.py) and this code is defined in db.py. so, alphabetically auth.py is exceuted first. On Fri, 16 Dec 2011 00:27:59 +0530, Anthony abasta...@gmail.com wrote: Does this code get run before your db.auth_user

[web2py] [OT] Pycharm 2 is out

2011-12-15 Thread mikech
Still no web2py love, but some nice features. http://www.jetbrains.com/pycharm/whatsnew/ and here is the link for voting for web2py support. http://youtrack.jetbrains.net/issue/PY-1648?projectKey=PY 'web2py the Rodney Dangerfield of Python web frameworks'

[web2py] Re: email/password login only: How to change email to lower case at the register page and store as a lower case to the database.

2011-12-15 Thread thstart
I used your suggestion for 'reset_email_lower' from this thread but it doesn't works with register. It works for login/reset_password but not with register. https://groups.google.com/forum/#!topic/web2py/1QjBUy62jP8 I added this code (reset_email_lower) to registration too. But I checked the

[web2py] Re: problems with linked fields using db[tablename]

2011-12-15 Thread monotasker
OK, I found a workaround by doing a double inner-join: tb = db[tablename] rowlist = db((tb.author == db.authors.id) (tb.work == db.works.id)).select() I'm still confused, though, by the difference between db.tablename and db[tablename]. Why do they act differently in queries?

[web2py] Re: Change the default app folder

2011-12-15 Thread pbreit
I looked through some of the source code and couldn't find any evidence that an app or the applications folder could reside elsewhere (except with a sym link). Is a sym link really not an option for you?

[web2py] Re: email/password login only: How to change email to lower case at the register page and store as a lower case to the database.

2011-12-15 Thread Anthony
But did you try using the IS_LOWER validator? On Thursday, December 15, 2011 2:09:33 PM UTC-5, thstart wrote: I used your suggestion for 'reset_email_lower' from this thread but it doesn't works with register. It works for login/reset_password but not with register.

Re: [web2py] 1:N relation with auth_user

2011-12-15 Thread Anthony
Is this two separate databases -- one from the other app for Auth, and one for this app? If so, I don't think you can join tables across databases. Also, does the other app call its user table 'auth_user', or is it using a different name for that table? Anthony On Thursday, December 15, 2011

[web2py] Re: ldap failed Version 1.99.4

2011-12-15 Thread Omi Chiba
It's issue #565. This is actually my first PATCH in the community ! On Dec 15, 11:34 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Looks like we need  a 1.99.5 thanks Omi On Dec 15, 9:43 am, Omi Chiba ochib...@gmail.com wrote: Nico, Yes, it works ! Actually the code is

Re: [web2py] 1:N relation with auth_user

2011-12-15 Thread Chandrakant Kumar
Both apps are using same mysql database. masterapp calls it auth_user and it is present in the database, as i checked it in mysql console. On Fri, 16 Dec 2011 01:13:02 +0530, Anthony abasta...@gmail.com wrote: Is this two separate databases -- one from the other app for Auth, and one for

Re: [web2py] generic virtual field class

2011-12-15 Thread Richard Vézina
Try to do this : class v_f_s(object): def hmd5(self): return md5_hash('|'.join(str(self[-1][k]) for k in db[self[-1]]fields())) But I get object is unsubscriptable error... I don't know if it possible to add a __getitem__ to the virtual field class that could allow me to access class

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread Massimo Di Pierro
I disagree. this SELECT * FROM table where field ILIKE '%|featured|%'; is valid SQL. % does not need to be escaped in SQL and, in fact, it is used for pattern patching: http://www.postgresql.org/docs/7.4/static/functions-matching.html Perhaps new-relic may have a bug. On Dec 14, 5:30 pm,

Re: [web2py] Re: problems with linked fields using db[tablename]

2011-12-15 Thread Richard Vézina
I don't think the act differently... db.tablename and db[tablename] are synonym I think and let you do something like this : db(db[request.args(0)].id == 1).select(...) Where request.args(0) is your table name coming from your URL... In the example you give in your first post you seems to have

Re: [web2py] 1:N relation with auth_user

2011-12-15 Thread Anthony
Not sure what's going on. On Thursday, December 15, 2011 2:47:23 PM UTC-5, Chandra wrote: Both apps are using same mysql database. masterapp calls it auth_user and it is present in the database, as i checked it in mysql console. On Fri, 16 Dec 2011 01:13:02 +0530, Anthony abas...@gmail.com

Re: [web2py] Re: problems with linked fields using db[tablename]

2011-12-15 Thread Anthony
In the example you give in your first post you seems to have forget the field you want to make a constraint for... in db(db.tablename.fieldname == something).select(...) this part db.tablename.fieldname == something is equal to where tablename.fieldname = something in raw SQL... If

[web2py] Re: WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking still showing up

2011-12-15 Thread nick name
Are you sure you got the right win32? e.g. it needs to match the Python version number (2.6) and bit width (32? 64?) of your interpreter. If you start Python independently, can you import win32con without error?

[web2py] Re: bulk_insert

2011-12-15 Thread nick name
bulk insert is not really bulk except on GAE, although it might potentially be in the future. The non GAE implementation at this point is: def bulk_insert(self, table, items): return [self.insert(table,item) for item in items] No database seems to override it.

[web2py] Re: Change the default app folder

2011-12-15 Thread Alan Etkin
Perhaps there is no choice for this. I wanted to avoid writing setup script code for each operating system (well, i mean for win and linux and maybe mac) to link the folder. Thanks anyway for the help. On 15 dic, 16:35, pbreit pbreitenb...@gmail.com wrote: I looked through some of the source

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread pbreit
I tend to agree. Even if it's not best practice (probably debatable), it should still be supported by New Relic).

RE: [web2py] Re: bulk_insert

2011-12-15 Thread Mark Breedveld
I am planning on implementing mongodb bulk inserts. They should be a bit faster. Van: web2py@googlegroups.com [mailto:web2py@googlegroups.com] Namens nick name Verzonden: donderdag 15 december 2011 23:11 Aan: web2py@googlegroups.com Onderwerp: [web2py] Re: bulk_insert bulk insert is not

[web2py] Re: 1:N relation with auth_user

2011-12-15 Thread Cliff
Both auth_user tables contain the org field with an identical definition, right? On Dec 15, 1:49 pm, Chandrakant Kumar k.03chan...@gmail.com wrote: I'm trying to establish one to many relation with auth_user, but i'm getting this error: Traceback (most recent call last):    File

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread pbreit
Although it does seem like psycopg prefers parameterization.

[web2py] Re: email/password login only: How to change email to lower case at the register page and store as a lower case to the database.

2011-12-15 Thread thstart
could you please post a code how to that for register especially?

[web2py] Re: psycopg2 OperationalError (with fake environment)

2011-12-15 Thread Alan Etkin
I found a workaround to keep the connection available. Every 5 minutes, the desktop app fires an event wich calls this command: db[_adapter].connection.reset() This only works for a postgres database interface. I still couldn't find the cause for the connection irreversible closing I think the

[web2py] Re: email/password login only: How to change email to lower case at the register page and store as a lower case to the database.

2011-12-15 Thread Anthony
def user(): if request.args(0) == 'register': db.auth_user.email.requires.insert(0, IS_LOWER()) [rest of code] Note, the above assumes there is already at least one validator defined for the email field (which there should be by default) -- otherwise, just do requires=...

[web2py] Re: email/password login only: How to change email to lower case at the register page and store as a lower case to the database.

2011-12-15 Thread thstart
Thank you, I will test it.

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread Graham Dumpleton
On Dec 16, 7:13 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I disagree. this SELECT * FROM table where field ILIKE '%|featured|%'; is valid SQL. % does not need to be escaped in SQL and, in fact, it is used for pattern patching:

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread Graham Dumpleton
Are you perhaps introspecting the type of the cursor object in some way and changing behaviour based on that? We wrap the cursor object returned by DBAPI2 module and so you wouldn't see original psycopg2 cursor type. Graham On Dec 16, 10:02 am, Graham Dumpleton graham.dumple...@gmail.com wrote:

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread Graham Dumpleton
Okay, have an answer. Looks like we may be falling into a bit of undefined territory within the DBAPI2 specification that I can see and different DBAPI2 modules behave differently. Some will take parameters as evaluating False to mean no parameters and so not trigger doing any variable

[web2py] Re: list:reference validation

2011-12-15 Thread Nik Go
Thanks Anthony. I don't think I've seen that in the docs. On Thursday, December 15, 2011, Anthony wrote: Try IS_IN_DB(..., multiple=(0, 3)) The multiple argument to IS_IN_SET and IS_IN_DB can be a list or tuple specifying a minimum and maximum number of items to be selected (strictly less

[web2py] smartgrid - still not resolving a problem

2011-12-15 Thread Adi
I'm still trying to resolve my problem, and desperately need someone's help :) When I try to add a new sku to a purchase order, I would like to prepopulate CPU field with the value from db.sku.cpu (determined by a dropdown).

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread pbreit
Thanks for investigating. Is it something that is fixable on NewRelic's end? Or would Web2py need to change how it submits the query? From my brief research, it does seem like psycopg expects queries to be parameterized (ie, using string substitution). However my query works fine when not

[web2py] Re: weird database behavior

2011-12-15 Thread Nik Go
Isn't that the default behavior? I mean, after registration a user is automatically logged in. Anyway, what I did was when a currently logged-in and unverified user's account is verified or updated by the admin, his status will be updated when he checks his profile (or logs out and logs in

Re: [web2py] smartgrid - still not resolving a problem

2011-12-15 Thread Nik Go
Try this: db.po_sku.default=lambda v,r: db.sku[r.sku_id].cpu On Friday, December 16, 2011, Adi wrote: I'm still trying to resolve my problem, and desperately need someone's help :) When I try to add a new sku to a purchase order, I would like to prepopulate CPU field with the value from

Re: [web2py] smartgrid - still not resolving a problem

2011-12-15 Thread Adi
i put it as suggested, but it didn't work... another problem is onchange', when a different value gets selected in dropdown how to pass the accompanying db.sku.cpu to db.po_sku.cpu field.

[web2py] Re: grid question - specifying initial fields

2011-12-15 Thread Nik Go
Great! Thanks Cliff On Thursday, December 15, 2011, Cliff wrote: You can differentiate based on the request, like this: if len(request.args) 2 and request.args[-3] == 'edit': fields = [] # what you want to show for editing else: fields = [] # what you want to show on the initial grid

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread pbreit
I found a fix but I am not qualified to determine if it should go in as a patch. I basically added a % on each side. I think %% distills down to % without triggering a substitution. http://code.google.com/p/web2py/source/browse/gluon/dal.py#1924 From: key =

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-15 Thread Graham Dumpleton
I am making a change on New Relic side. You can't do what you are doing as that then will cause wrong thing to happen for when New Relic not used. So am changing things to accommodate for what psycopg2 interprets as default argument. The issue hasn't come up before because Web2Py is the only

Re: [web2py] smartgrid - still not resolving a problem

2011-12-15 Thread Nik Go
Ah .. so you want it processed as soon as the drop-down is selected? That would need some Ajax magic. On Friday, December 16, 2011, Adi wrote: i put it as suggested, but it didn't work... another problem is onchange', when a different value gets selected in dropdown how to pass the

[web2py] Re: smartgrid - still not resolving a problem

2011-12-15 Thread Anthony
You can't really pre-populate the field because you don't know the cpu value until after the user selects the sku. So, you'll have to do this with JS/jQuery and Ajax on the client side. Use jQuery to detect the sku selection, and when detected, send an Ajax request to web2py to have it look up

  1   2   >