Thanks, Anthony.

On Mon, Nov 21, 2011 at 1:09 PM, Anthony <abasta...@gmail.com> wrote:
>> But, according to your define_table()'s, these tables can only be
>> managed (insert or update) with a logged user, or default contents
>> will raise an excpetion because there's no logged user.
>
> The defaults won't raise an exception (as long as auth is defined prior to
> the table definitions), because auth.user_id simply returns None when the
> user is not logged in (i.e., it is not undefined). The same is true for
> auth.user -- it returns None when there is no logged in user (though
> auth.user.id will raise an exception because if auth.user is None, obviously
> it has no 'id' attribute).
> See very end of this
> section: http://web2py.com/book/default/chapter/08#Authentication
> Anthony
>

Reply via email to