default=auth.user.first_name if auth.user else 'some_other_default' or
default=auth.user and auth.user.first_name or 'some_other_default' Anthony On Saturday, October 29, 2011 6:10:34 PM UTC-4, Pystar wrote: > > In an app I am developing, in my database definition I have a filed > whose default value is auth.user.first_name, but I noticed that when I > try to run the app it gives me an error since there is no user logged > in and auth.user == None and the None value doesnt have a first_name > attribute. How then do I solve this? > P.S: I hope my explanation is clear enough?