[web2py] Re: help.. is this correct-auth_user

2011-04-29 Thread Massimo Di Pierro
or more simply: updated = db(db.Matworksheeetdb.email==auth.user.email) (db.Matworksheeetdb.mgp>session. mpg).update(...) On Apr 29, 12:36 am, pbreit wrote: > Now that I'm looking at the code again, can you even do that? > > Wouldn't you need to do something like: > > user = db(db.Matworksheetdb

[web2py] Re: help.. is this correct-auth_user

2011-04-28 Thread pbreit
Now that I'm looking at the code again, can you even do that? Wouldn't you need to do something like: user = db(db.Matworksheetdb.email==auth.user.email).select().first() if user: ... Or in your case: user = db(( db.Matworksheeetdb.email==auth.user.email)&(db.Matworksheeetdb.mgp>session.mp

[web2py] Re: help.. is this correct-auth_user

2011-04-28 Thread Massimo Di Pierro
Not sure I understand the context but there should be no "and" or "or" in dal queries. On Apr 28, 10:10 pm, pbreit wrote: > Try "and" instead of "&". I seem to recall that might be necessary. In fact, > you could skip the first clause since it's redundant.

Re: [web2py] Re: help.. is this correct-auth_user

2011-04-28 Thread pbreit
Try "and" instead of "&". I seem to recall that might be necessary. In fact, you could skip the first clause since it's redundant.

[web2py] Re: help.. is this correct-auth_user

2011-04-26 Thread pbreit
Also, what you have coded looks similar to what happens if you decorate with @auth.requires_login(): http://web2py.com/book/default/chapter/08#Decorators

[web2py] Re: help.. is this correct-auth_user

2011-04-26 Thread pbreit
I would suggest doing that in the controller. def controller() if auth.user.id: return dict() else: redirect() And I'm not really sure what you are trying to do with "numquest".