I did this for the tags with this from what you gave me:
userTags = db(db.user_tags.user_id ==
current_user_id).select('user_tags.tag_id')
should I actually run the query for each one?  Shouldn't I be able to
get the rows of the tags too?


On Mon, 2009-06-22 at 12:12 -0700, DenesL wrote:
> So if your model is basically:
> 
> db.define_table('user', SQLField('name'))
> db.define_table('tag, SQLField('name'))
> db.define_table('user_tags',
>   SQLField('user_id','reference user'),
>   SQLField('tag_id','reference tag'))
> 
> then
>   usertags=db(db.user_tags.user_id==theuserid).select('user_tags.tag')
> gives you the tags for theuserid you want.
> 
> No joins are required.
> Joins are explained in:
> http://en.wikipedia.org/wiki/Join_(SQL)
> has some good "visual explanation" links at the bottom.
> 
> Denes
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to