custom_auth_table = db[auth.settings.table_user_name]
On Thursday, April 16, 2015 at 10:13:54 AM UTC+2, Annet wrote: > > Hi Niphlod, > > - hit appname/testlazy/does_nothing: by default the generic view shows the >> toolbar. If you have all the tables listed as lazy you did a goo job. If >> not, inspect your app to find any db.tablename call. >> > > All but two of my tables are listed as lazy: auth_user and nd_node > > I defined a custom auth_user table > > > ## custom auth_user table > db.define_table( > auth.settings.table_user_name, > Field('first_name'), > Field('last_name'), > Field('email', length=128, default='', requires=[IS_EMAIL(), > IS_NOT_IN_DB(db, 'auth_user.email')], notnull=True, unique=True'), > Field('username', length=32, default='', requires=[ IS_NOT_EMPTY(), > IS_NOT_IN_DB(db, 'auth_user.username')], notnull=True, unique=True, > writable=False, readable=False), > Field('password', type='password', length=512, > requires=[IS_STRONG(),CRYPT()], writable=False, readable=False), > Field('nodeID', 'reference nd_node', > requires=[IS_EMPTY_OR(IS_IN_DB(db, 'nd_node.id', '%(id)s'))], > ondelete='CASCADE', writable=False, readable=False), > Field('registration_key', length=512, default='', writable=False, > readable=False), > Field('reset_password_key', length=512, default='', writable=False, > readable=False), > Field('registration_id', length=512, default='', writable=False, > readable=False), > Field('createdOn', **attributes), > Field('modifiedOn', update=request.now, **attributes)) > > ## get the custom_auth_table > custom_auth_table = db[auth.settings.table_user_name] > ## tell auth to use custom_auth_table > auth.settings.table_user = custom_auth_table > ## create all tables needed by auth if not custom tables > auth.define_tables(migrate=False, username=True, signature=False) > > > What's wrong with this definition? > > > Kind regards, > > Annet > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.