Community: CMS / eCommerce Experts mailing list archives


How do I dump the data from a model?

- 05 ديسمبر, 2014 05:34:23
If I use self.pool.get('model').browse(ID)

I get a model object which also seems to automatically load the relationships.

How do I dump all of the key/value pairs of just the data from the
database from that returned model object?

If I use vars() on the object, it returns literally hundreds of
things, because it dumps all of the models various helper functions. I
also found get_fields(), which dumps a lot of schema information, but
none of the data (and it's not very readable for something with a lot
of relationships like product_product).

What I want is to see the fields and data so I can better understand
the actual data in the business objects. Is there a helper method
somewhere in osv.Model which does this?