Oops, the printed book is wrong -- see the corrected version here: http://web2py.com/book/default/chapter/08#Customizing-Auth. Anthony
On Friday, July 29, 2011 11:29:35 AM UTC-4, Ramos wrote: > i need to add one more field in my auth table: > > in reading the book on page 358 and 259 > > I´m not geting it to work > i get error , auth_table not defined. > > > > 1 # after > 2 # auth = Auth(globals(),db) > 3 > 4 db.define_table( > 5 auth.settings.table_user_name, > 6 Field('first_name', length=128, default=''), > 7 Field('last_name', length=128, default=''), > 8 Field('email', length=128, default='', unique=True), > 9 Field('password', 'password', length=512, > 10 readable=False, label='Password'), > 11 Field('registration_key', length=512, > 12 writable=False, readable=False, default=''), > 13 Field('reset_password_key', length=512, > 14 writable=False, readable=False, default=''), > 15 Field('registration_id', length=512, > 16 writable=False, readable=False, default='')) > 17 > 18 auth_table.first_name.requires = \ > 19 IS_NOT_EMPTY(error_message=auth.messages.is_empty) > 20 auth_table.last_name.requires = \ > 21 IS_NOT_EMPTY(error_message=auth.messages.is_empty) > 22 auth_table.password.requires = [IS_STRONG(), CRYPT()] > 23 auth_table.email.requires = [ > 24 IS_EMAIL(error_message=auth.messages. > > > before > 26 auth.settings.table_user = auth_table > 27 > 28 # before > 29 # auth.define_tables() >