On Wednesday, April 6, 2016 at 2:06:11 AM UTC-4, Mark Graves wrote: > > Hey everyone, > > I saw a random bug in an app I'm working on, and I was wondering what the > correct approach is. > > I have auth.settings.extra_fields["auth_user"] = [LIST_OF_FIELDS] > > later, I select that row and get it as a dict: > > row = db(db.auth_user.id == user_id).select().first().as_dict() > > then I get the extra fields and set them as normal attributes of the table > > _f = row["extra"] >
This is confusing. When you add extra fields to the auth_user table, they are just regular database table fields, so their keys/values are added to the Row object just like any other fields. There should be nothing in row['extra'] (unless you have a field named "extra"). Can you show some more code (e.g., the details of the extra fields) and what the Row object looks like before and after .as_dict (without doing any updating/mutating)? Anthony -- 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.

