((book))

There a number of ways to customize auth. The simplest way is to add
extra fields:

# after auth = Auth(db)
auth.setting.extra_fields['auth_user']= [
  Field('address'),
  Field('city'),
  Field('zip'),
  Field('phone')]
# before auth.define_tables(username=True)

((my db.py file looks like this))

from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db, hmac_key=Auth.get_or_create_key())
crud, service, plugins = Crud(db), Service(), PluginManager()

## create all tables needed by auth if not custom tables
auth.define_tables()
from gluon.tools import Auth
    auth = Auth(globals(), db)
    auth.define_tables(username=False)


I tried inserting the example from the book inside the designated
area, but i receive this error.

     Traceback (most recent call last):
     File "gluon/restricted.py", line 194, in restricted
     File "C:/Projects/web2py/applications/noobmusic/models/db.py",
line 42, in <module>
     AttributeError: 'Auth' object has no attribute 'setting'

All i am trying to do is add extra registration fields


Thank you

Reply via email to