I tried...
users_advertisements = db((db.auth_user.id==db.user_tags.user_id) & (db.user_tags.tag_id==db.tag.id) & (db.advertisement.id == db.advertisement_tags.advertisement_id) == (db.tag.id == db.advertisement_tags.tag_id)).select()'
and it works until I use select()
In additon to these I need to get the specific logged in user id on top of all this.
BR
Jason

On 10/09/2010 09:25 PM, ron_m wrote:
The last statement is between two db(condition1&  condition2) as in
db(condition1&  condition2)&  db(condition3&  condition4)

Why not make this statement and try it
db(condition1&  condition2&  condition3&  condition4).select()

Ron

On Oct 9, 11:09 am, Jason Brower<encomp...@gmail.com>  wrote:
      #Get the users tags
      users_tags = db((db.auth_user.id==db.user_tags.user_id)&
(db.user_tags.tag_id==db.tag.id))
      #Get the advertisement's tags too
      advertisements_tags = db((db.advertisement.id ==
db.advertisement_tags.advertisement_id)&  (db.tag.id ==
db.advertisement_tags.tag_id))
      #Now glue dem tegever and select them
      users_advertisements = (advertisements_tags&  users_tags).select()

I am trying to get the tags that the current use and the advertisements
have in common.  This is to do targeted advertising. auth_user is my
auth database.
How can I make it happen?  Why doesn't the last one work?
---
Best Regards,
Jason Brower

Reply via email to