auth.settings.hmac_key = 'sha512:9d8d83af-4769-410b-9cf5-e01a163b498d' # before define_tables()
auth.settings.extra_fields['auth_user']= [
Field('auth_group', 'reference auth_group', label='Group',
requires=IS_EMPTY_OR(IS_IN_DB(db, 'auth_group.id', '%(group)s'))),
Field('phone', 'string', length=20),
Field('active', 'boolean', default=True),
Field('image', 'upload'),
Field('created', 'datetime', default=request.now, writable=False),
Field('supplier', 'reference supplier', requires=IS_EMPTY_OR(IS_IN_DB(db, 'supplier.id'))),
Field('distributor', 'reference distributor', requires=IS_EMPTY_OR(IS_IN_DB(db, 'distributor.id'))),
Field('fax', 'string', length=20)
]
## create all tables needed by auth if not custom tables
auth.define_tables(username=True, signature=False)
Traceback (most recent call last):
File "C:\dev\web2py\gluon\restricted.py", line 217, in restricted
exec ccode in environment
File "C:/dev/web2py/applications/ibc/models/db.py", line 69, in <module>
auth.define_tables(username=True, signature=False)
File "C:\dev\web2py\gluon\tools.py", line 1707, in define_tables
format='%(username)s'))
File "C:\dev\web2py\gluon\dal.py", line 8226, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
File "C:\dev\web2py\gluon\dal.py", line 8263, in lazy_define_table
polymodel=polymodel)
File "C:\dev\web2py\gluon\dal.py", line 908, in create_table
raise KeyError('Cannot resolve reference %s in %s definition' % (referenced, table._tablename))
KeyError: 'Cannot resolve reference auth_group in auth_user definition'
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/T1kli0maSBE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.