Misc improvements on a branch named for a feature that got deleted #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improved
exceptions.py
security/models.py
New
membersuite_api_client.models.MemberSuiteObject. A base MemberSuite object for PortalUser and Individual.
Takes
membersuite_object_dataas argument.This object data is the Zeep'ed XML representation of a concrete type of MemberSuiteObject, like PortalUser or Individual.
Takes care of converting data to a
fieldsdictionary.Hangs this dictionary, named
fields, on self.Sets self.id and self.extra_data.
membersuite_object_factory() in utils.py
Takes
membersuite_object_dataas input, returns a MemberSuiteObject.If factory "knows" about the type of MemberSuiteObject, that specific type of MSO is returned. Otherwise, a generic MemberSuiteObject is returned. Now it only knows of PortalUser and Individual.
Usage:
Maybe a factory is overkill, since you can make a MemberSuiteObject by simply constructing it with the appropriate Zeep object, e.g.,
PortalUser(membersuite_object_data).