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
subclassing API #29
base: master
Are you sure you want to change the base?
subclassing API #29
Conversation
Good intention, but I think these methods should be public, why protect them to reuse on inherited classes? I'd like to rename them to |
I liked the idea of appending '_page' to the function names and did so in 7e5bf8b. I also managed to include them in the sphinx documentation ( ccdbaf4). I thought about it and I still think that these functions should be protected. When using an instance of I think both funtions are internal implementation details. They should not clutter the public API of |
Also didn't note this pull request while making 0.6, moved to 1.0 |
Conflicts: flask_flatpages/flatpages.py
I merged master and resolved one merge conflict. |
While working on a project using Flask-FlatPages I found myself wanting to exclude some pages (e.g. because they had metadata like
published: false
ordate: 2040-03-12
). I also wanted to normalize the metadata (e.g. allowing bothcategory
andcategories
).My approach for implementing this was to subclass
FlatPages
. I guess this might be a common usecase so providing default hooks for this kind of functionality seemd like a good idea. So now I added to methods_is_excluded
and_process
that do nothing by default but can be overwritten by subclasses.However, there is an issues with this: Because both methods are private they are not included in the autogenerated documentation.