There are only two possibilities:
- you are not logged in
- the code above is executed before auth=Auth() in db.py is
executed (remember models are executed alphabetically)
On Oct 24, 2:18 pm, Luther Goh Lu Feng wrote:
> The snippet below defines a table that stores comments that are
> create
I think what is happening is the model is exec'd at the start of the
request but if the user is not logged in yet or the session has
expired forcing a trip to the login page, the model with get None
because auth is not in the session. Once the trip to the login page
completes it goes back to the co
As far as I know auth.user.id should work. However, I faced a similar
problem and solved it by setting the default in the function,
something like:
def add_comment():
db.comment.user.default=auth.user.id
return dict(...)
Maybe someone else can provide you (and me) with
3 matches
Mail list logo