Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Document a bunch of Resource methods #91

Merged
merged 9 commits into from
Aug 13, 2016
Merged

Document a bunch of Resource methods #91

merged 9 commits into from
Aug 13, 2016

Conversation

wojcikstefan
Copy link
Member

@wojcikstefan wojcikstefan commented Aug 11, 2016

Branched off of @thomasst 's tweaks from #89, should be diff'd and merged after that one is merged.

Includes minor style/logic tweaks on top docstrings/comments.

thomasst and others added 5 commits August 10, 2016 21:13
- Introduces two helper methods (`update_objects` and `update_object`) that can be overridden in subclasses
- Makes sure `view_method` is propagated to subresources
- Fixes an issue where `has_change_permission` is called after the object is updated in bulk updates
- Fixes an issue where `obj.save()` is unnecessarily called after `update_object()` (which already saves) in bulk updates
This was referenced Aug 12, 2016
@@ -214,18 +265,25 @@ def serialize_field(self, obj, **kwargs):
return self.serialize(obj, **kwargs)

def _subresource(self, obj):
"""Selects and creates an appropriate sub-resource class for delegation or return None if there isn't one"""
"""
Selects and creates an appropriate sub-resource class for delegation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Select and create" (otherwise "or return None" won't grammar)

@wojcikstefan wojcikstefan merged commit 1d88ba9 into master Aug 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants