Closed johnkawakami closed 8 years ago
Any chance we can get this merged in to master?
Sorry for being late on this @johnkawakami , I'm just getting around to accepting PRs after taking over the repo.
This looks quite nice and since it does not modify existing functionality, I don't see any risk of breaking backwards compatibility.
Accepted.
Thanks @johnkawakami
This adds support for Relations that is similar to what's provided by the Javascript SDK.
It expands on recent work done to add support for querying relations, and relies on that code to perform some functions. The specifics are as follows:
Adds Object.relation(key), which returns a Relation. Adds Relation.add(obj) to add objects to relation. Adds Relation.remove(obj) to remove objects from a relation. Adds Relation.query() which gets a Queryset that queries objects in the relation. The query is limited to the set of objects that has been added to the relation. Adds method schema() to the Object class, to retrieve its schema from Parse. Adds method schema_delete_field(key) to the Object class, to remove a column from the schema. This is used for testing. Adds a section to the documentation with an example of its use.
Testing is in test_relation.py. They went a little long, so I broke them out into a separate file.
All comments and critiques are appreciated.