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

Making certain views read only is harder than it should be. #34

Open
obmarg opened this issue Jul 25, 2016 · 0 comments
Open

Making certain views read only is harder than it should be. #34

obmarg opened this issue Jul 25, 2016 · 0 comments

Comments

@obmarg
Copy link
Contributor

obmarg commented Jul 25, 2016

Essentially, flump might rely on inheritance a little too much.

Currently we expect users to inherit from flump base classes (either the FlumpView or the individual http method mixins), and then provide their own database implementation that all their views inherit from. We also expect pagination to be provided in a mixin.

For the simplest cases this is fine - you can just create a base class from FlumpView that provides your database layer and you're good to go. But when you want some endpoints to be read only (which is not an unrealistic requirement) it becomes much more complicated: suddenly you only want some of your views to inherit from FlumpView, and others need to inherit from a subset of the method mixins. So you end up having to define pagination & database functionality in mixins, and then each individual view needs to pick and choose which of the mixins it needs and be sure to pull them in in the correct order.

Maybe it's just me, but this seems quite awkward - I'm wondering if we could do better...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant