On 17/06/2011 16:23, Anthony wrote:
On Friday, June 17, 2011 10:20:49 AM UTC-4, Manuele wrote:
...
auth.define_tables(username=True)
auth.settings.extra_fields['auth_user'].append(
Fields('company', db.company, required=True, notnull=True,
requires=IS_IN_DB(db, 'company.id <http://company.id>', '%(name)s'))
)
auth.define_tables() # creates all needed tables
You've got auth.define_tables twice -- once before and once after.
I solved in this way defining the dict entry "auth_user"... in this way
everything works fine
db.define_table('company',
Field('name'),
format = '%(name)s'
)
auth.settings.extra_fields['auth_user'] = [
Field('company', db.company, required=True, requires=IS_IN_DB(db,
'company.id', '%(name)s'))
]
auth.define_tables(username=True) # creates all needed tables
cheers
Manuele