Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Django Model EndpointSet mixin #11

Merged
merged 10 commits into from
Jul 5, 2016

Conversation

grahamu
Copy link
Contributor

@grahamu grahamu commented Jun 30, 2016

What does this PR do?

Creates mixin with commonly used code for EndpointSet.prepare() to retrieve a Django Model-based Resource object, if the request method is appropriate.

Where should the reviewer start?

Read the mixin code.

How should this be manually tested?

No tests yet for the mixin.

Any background context you want to provide?

See #10

What ticket or issue # does this fix?

N/A

Definition of Done (check if considered and/or addressed):

  • Is there appropriate test coverage?

Yes, updated test case ResourceEndpointSets to use new DjangoModelEndpointSetMixin.

  • Does this PR require a regression test? All fixes require a regression test.
  • Did you update internal documentation appropriately?
  • Did you update (or alert the appropriate person to update) user-facing documentation?

Also add convenience methods for obtaining PK, resource object model,
and resource object queryset.
EndpointSet-based class can inherit this mixin to automatically retrieve
Django model objects.
Test ResourceEndpointSets now inherit from DjangoModelEndpointSetMixin
rather than provide their own `get_queryset()` and `prepare()` methods.
@coveralls
Copy link

coveralls commented Jun 30, 2016

Coverage Status

Coverage increased (+0.5%) to 61.847% when pulling dbd2311 on grahamu:django-prepare-mixin into dbf9802 on pinax:master.

@coveralls
Copy link

coveralls commented Jul 5, 2016

Coverage Status

Coverage increased (+0.6%) to 61.898% when pulling 31c04e7 on grahamu:django-prepare-mixin into dbf9802 on pinax:master.

@coveralls
Copy link

coveralls commented Jul 5, 2016

Coverage Status

Coverage increased (+0.6%) to 61.905% when pulling 711a03c on grahamu:django-prepare-mixin into 092e800 on pinax:master.

@grahamu grahamu merged commit 4a3dc2a into pinax:master Jul 5, 2016
@grahamu grahamu deleted the django-prepare-mixin branch July 5, 2016 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants