No. I just try to stay away from joins to leave me the option to run
on GAE.


On Oct 26, 11:38 pm, "mr.freeze" <[email protected]> wrote:
> This is how I usually do it.  Is there a better way to do this join?
>
> all = db((db.tablename.author==db.auth_user.id)&
> (db.auth_user.id==auth.user.id)).select()
> for a in all:
>     print a.tablename.title, a.auth_user.email
>
> On Oct 26, 11:25 pm, mdipierro <[email protected]> wrote:
>
> > Given:
>
> > ... Field("author", db.auth_user, default=auth.user.if if auth.user
> > else 0) ...
>
> > db.tablename.author.requires=IS_IN_DB(db,'auth_user.id','%(first_name)
> > s %(last_name)s')
>
> > You can do
>
> > record = db(db.tablename.id>0).select().first()
> > print db.auth_user[record.author].first_name
>
> > and/or
>
> > row= db(db.tablename.author==db.auth_user.id).select.first()
> > print row.tablename, row.auth_user.first_name
>
> > On Oct 26, 10:58 pm, Wiiboy <[email protected]> wrote:
>
> > > And then how would I get the user's info?
>
> > > db(db.auth_user.id == db.tablename.author)
>
> > > ?
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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