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

CKAN 2.10 replace controllers & IRoutes with blueprints #54

Merged
merged 13 commits into from
Jun 5, 2024

Conversation

thepsalmist
Copy link
Contributor

@thepsalmist thepsalmist commented Mar 25, 2024

Migration of all the controllers to flask views/blueprints. This means changing all BaseController controllers handled by the IRoutes interface to blueprints handled by IBlueprint interface.

IRoutes is deprecates in CKAN < 2.10

ckanext/openafrica/blueprint.py Outdated Show resolved Hide resolved
@@ -23,15 +23,16 @@

import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from . import blueprint
Copy link
Member

@kilemensi kilemensi Mar 25, 2024

Choose a reason for hiding this comment

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

Prefer absolute imports.

Comment on lines +33 to +35
plugins.implements(plugins.IConfigurer, inherit=True)
plugins.implements(plugins.ITemplateHelpers, inherit=True)
plugins.implements(plugins.IBlueprint)
Copy link
Member

Choose a reason for hiding this comment

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

Why do some plugins use inherit and others don't? (This is for just my understanding).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the blueprint, we only need custom routes to handle our /about/<>/ urls hence though it was not necessary to extend CKAN core's Blueprints. On the other plugins, we inherit helper functions & configurations such as url_for, link_for et.al from CKAN core

@thepsalmist thepsalmist merged commit d425dbf into master Jun 5, 2024
3 checks passed
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.

3 participants