--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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"]
On the other hand I am curious that you update row with simple update(), you suppose to use update_record()
On the other hand I am curious that you update row with simple update(), you suppose to use update_record()They are both valid methods -- .update updates the Row object itself (like updating a dictionary), whereas .update_record updates the record in the database. You can actually issue several updates to the Row object via .update, and then later call .update_record() with no arguments, and the changes made to the Row object will be propagated to the database.
--
You maybe right Anthony abour update_record() it really depend though of what he is trying todo...
--
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/JlAzUE46s_M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
{"second_bool": false, "auth_fields": {"_extra": {"test_field_1": "T", "first_name": "Corinne", "id": 1}}, "other_stuff": {"hello": false}}table = db.auth_userfields = ['id','first_name']fields.append('test_field_1')query = table.id > 0row = db(query).select(*fields).first().as_dict()
--
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)
---