For the "format" attribute to affect the "represent" attribute of linked reference fields, it must be set before those reference fields are defined. If you are setting the auth_user "format" attribute after calling auth.define_tables(), then the auth_event table has already been defined. Instead, you may need to directly change the "represent" attribute of the reference field in auth_event.
Anthony On Sunday, April 5, 2015 at 6:53:53 PM UTC-4, 黄祥 wrote: > > hi, > > i tried to have auth_user a proper format record representation, but it > end with just the id shown on the table. > e.g. > *models/db.py* > custom_auth_table = db[auth.settings.table_user_name] > custom_auth_table._format = '%(first_name)s %(last_name)s' > auth.settings.table_user = custom_auth_table > > *controllers/default.py* > def event(): > grid = SQLFORM.grid(db.auth_event) > return locals() > > how can i see the user id in auth_event with proper record representation > format (first_name, last_name) instead of the id in web2py way? > > 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.

