[web2py:30031] Re: How to use validators on 2 fields?

2009-09-04 Thread tititi
B(db > (db.table.a==request.vars.a),'table.b') > > On Aug 31, 10:10 am, tititi wrote: > > > > > Hi, > > > I'm looking at IS_IN_DB and IS_NOT_IN_DB to filter out inserts and > > want to know if it's possible to use 2 fields tovalidatean insert to

[web2py:29867] Is there any way to use 2 fields to validate a table insert in model?

2009-09-02 Thread tititi
Hi everyone, I'm trying to keep the duplicate insert logic at the model level and would like to find out if there is a way to do this. For example, I would like a USER_ID and GROUP_ID to be validated before an insert can be committed. Using IS_IN_DB with 2 fields work? If there isn't support for

[web2py:29701] How to use validators on 2 fields?

2009-08-31 Thread tititi
Hi, I'm looking at IS_IN_DB and IS_NOT_IN_DB to filter out inserts and want to know if it's possible to use 2 fields to validate an insert to prevent duplicates. For example, let's say I want emails to be unique in email field, now I want it to be email AND postalcode to be unique. I would like t

[web2py:29643] Re: how to open a file from default.py

2009-08-30 Thread tititi
of the elements. Like in Highlander... there can > be only one, with one name. :) > You can replace the jQuery with $ sign, to be shorter. > > If you need some code to execute on document load, you can add a > document.ready jquery function code in your view. They are "added"

[web2py:29638] how to open a file from default.py

2009-08-30 Thread tititi
I want to open and append a javascript file (placed in Static folder) from default.py file but not seem to get past the error: filename = URL(r=request,c="static",f="jquery_dynamic.js") try: logfile = open(filename , 'w') for each in restaurantsFeatures: logfile.

[web2py:29166] Re: Help query

2009-08-23 Thread tititi
is a > dict which contains dict object for each table. > > try: > {{for review in reviews:}} >     {{=review.reviews.headline}}: {{=review.users.username}} > {{pass}} > > regards > mmlado > > On Saturday 22 August 2009 12:09:18 tititi wrote: > > > > > H

[web2py:29122] Re: Help query

2009-08-22 Thread tititi
Hi, I'm testing a similiar join query but not getting success in extracting the dictionary r = db.reviews u = db.users query = ((db.reviews.id==request.args[0]) & (db.users.id==1)) left= (r.on(u.id==r.user_id)) reviews=db(query).select (r.headline,r.article,u.username,left=lef

[web2py:28681] Re: converting the query dictionary to a list

2009-08-15 Thread tititi
Found the solution in the end, had to add another loop to change it from SQLROW to list, then to dictionary. Thanks, Fran. def gen_tags(): #tags = ['java','php','python','python'] query=db.tags.id>0 tags = db(query).select(db.tags.ALL) # results show--- tags.word indian italian sp

[web2py:28500] Re: converting the query dictionary to a list

2009-08-13 Thread tititi
Thanks for the response. Unfortunately, I got this error: AttributeError: 'dict' object has no attribute 'append' Any ideas why? Looks logical. Titi On Aug 13, 8:52 am, Fran wrote: > On Aug 13, 2:18 am, tititi wrote: > > > I'm new to w2p and would like t

[web2py:28473] converting the query dictionary to a list

2009-08-12 Thread tititi
Hi, I'm new to w2p and would like to incorporate tag cloud function into my site but can't seem to convert a dictionary to a list from a database query result. Can anyone help me with this? def gen_tags(): #tags = ['java','php','python','python'] query=db.tags.id>0 tags = db(query).