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
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
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.
Try "and" instead of "&". I seem to recall that might be necessary. In fact,
you could skip the first clause since it's redundant.
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
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".
6 matches
Mail list logo