The attached patch contains the following changes.
-- Refactoring profile.py and replacing the usage of property with a
dictionary for attribute name conversions(when sending the objects back
to server).
-- Replace the logic of traversing the dict of NOTYPES with a search in
NOTYPES.itervalues for the instance of an object. The traversal method
causes an issue in-case of inherited classes as
isinstance(cert_review_response, obj)) is true for obj=
CertEnrolmentRequest/CertReviewResponse. Since a dict is not an ordered
data structure, we cannot traverse it correctly. This creates problems
during attr name conversion.
This can still be modified by using a Set for NOTYPES and TYPES and
adding the class objects to the sets and performing a lookup.
Since this requires changes across the python code, i think we should
take this up in a separate patch.
-- Rewrote the attr_name_conversion method in encoder.py to return a new
dict with the changes attribute names rather than make the changes to
the object's __dict__. This would allow re-usage of the object.
Otherwise an AttributeError will be raised when accessing an attribute.
--Abhishek