Add useful __repr__() methods to Model & Result
Fix for #12
Uses Model.fields[0] by default, but can be overridden via Model.repr_field
eg.
>>> r = chargebee.Subscription.list({})[0]
>>> r
<chargebee.Result: customer;subscription>
>>> r.customer
<chargebee.Customer: id=1mk51RNQdn96z7hT6>
>>> r.subscription
<chargebee.Subscription: id=1mkVvvHQiQMbLBBf>
>>> r.customer.billing_address
<chargebee.BillingAddress: zip=None>
I went through the models and set repr_field on anything where fields[0] was obviously not useful (eg. last_name), but there might be better options.
@rcoup Thanks for your contributions to our Python API library. We are planning to change repr() to render in the format '<modelName #id at #objectId> JSON: #response'. Will it work for you?
@vikiuvb can you paste in an example? Feels like the entire JSON is too verbose to put in a repr string?
has been updated against master ~2.6.4.
Any chance of some attention?
Updated again against 2.7.1