hi,

i have custom auth table that work in earlier version but not in recent 
version.
e.g. 
create new application and then add this code
*models/db.py*
db._common_fields.append(auth.signature) # work if commented

# create table : bank
db.define_table('bank', 
Field('bank'), 
format = '%(bank)s')

# custom auth user table
auth.settings.extra_fields['auth_user'] = [ 
Field('bank', 'reference bank', 
  requires = IS_IN_DB(db, db.bank.id, '%(bank)s') ), 
]

# create all tables needed by auth if not custom tables
auth.define_tables(username = True, signature = True)

""" custom_auth_table """
custom_auth_table = db[auth.settings.table_user_name]

auth.settings.table_user = custom_auth_table

in earlier version, i run twice, 
first for create auth_user tables, i comment append commond field 
e.g. 
# db._common_fields.append(auth.signature)
and then the second is to add common field on bank table i uncomment it. 
db._common_fields.append(auth.signature)

those two steps is work in earlier version, but not in recent version.
in recent version it return an error :

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 220, in restricted
    exec ccode in environment
  File "C:/web2py/applications/test/models/db.py" 
<http://127.0.0.1:8000/admin/default/edit/test/models/db.py>, line 88, in 
<module>
    format = '%(bank)s')
  File "C:\web2py\gluon\dal.py", line 8223, in define_table
    table = self.lazy_define_table(tablename,*fields,**args)
  File "C:\web2py\gluon\dal.py", line 8260, in lazy_define_table
    polymodel=polymodel)
  File "C:\web2py\gluon\dal.py", line 925, in create_table
    raise KeyError('Cannot resolve reference %s in %s definition' % 
(referenced, table._tablename))
KeyError: 'Cannot resolve reference auth_user in bank definition'


is it possible to have the same result like on earlier version?

thanks and best regards,
stifan

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to