> On Friday, January 20, 2017 at 9:14:00 AM UTC-8, Anthony wrote: >> >> See http://stackoverflow.com/a/41769011/440323. >> >> On Friday, January 20, 2017 at 6:09:31 AM UTC-5, Bishal Saha wrote: >>> >>> I have stored a dictionary in the session variable and now I want to >>> store the values of the dictionary in my MySQL database in another server. >>> Will I be able to do it ? And if yes dn how ? >>> >> > If the dict keys don't match the table schema, an error is returned, no? >
Sure. If there's a chance there might be some extra keys (e.g., an ID field from an existing record), you can use **db.mytable._filter_fields(some_dict). On the other hand, if you're worried about a complete mismatch, you've probably got a bug in your code, and you might want some more explicit error checking. 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.

