[ckan-changes] [ckan/ckan] ee1247: [#3196] Register core blueprints on the Flask app

GitHub noreply at github.com
Thu Aug 18 12:13:20 UTC 2016


  Branch: refs/heads/3196-blueprints-and-templates
  Home:   https://github.com/ckan/ckan
  Commit: ee12473902f1e29fbbf7dd0d18fce011192860d0
      https://github.com/ckan/ckan/commit/ee12473902f1e29fbbf7dd0d18fce011192860d0
  Author: amercader <amercadero at gmail.com>
  Date:   2016-08-16 (Tue, 16 Aug 2016)

  Changed paths:
    M ckan/config/middleware/flask_app.py
    M ckan/config/routing.py
    A ckan/views/__init__.py
    A ckan/views/api.py

  Log Message:
  -----------
  [#3196] Register core blueprints on the Flask app

Automatically go through the `views` folder and register all instances
of Flask's Blueprint. This is done by inspecting all modules on the
folder for the relevant members.

As an example, a new api blueprint has been added, which for now only
handles the root request (`/api`).

See
https://github.com/ckan/ckan/wiki/Migration-from-Pylons-to-Flask#flask-views-blueprints-and-routing
for details on how we will use Blueprints


  Commit: 3f4553024508e2bcbb7aa099db25b5c7083b3bde
      https://github.com/ckan/ckan/commit/3f4553024508e2bcbb7aa099db25b5c7083b3bde
  Author: amercader <amercadero at gmail.com>
  Date:   2016-08-16 (Tue, 16 Aug 2016)

  Changed paths:
    M ckan/config/middleware/flask_app.py
    M ckan/plugins/interfaces.py
    M ckan/tests/config/test_middleware.py

  Log Message:
  -----------
  [#3196] Allow extensions to register their blueprints

Extensions can use the IBlueprint interface to register their own
blueprints. The main use case we have for it now is to register custom
routes, but it will also be used to register template folders, resources
etc.

Routes registered from plugins are flagged as such so theu can be
prioritized by the AppDispatcher middleware:

Flask Extension > Pylons Extension > Flask Core > Pylons Core

To do this we use a custom class for the Werkzeug rules used by Flask.

Updated the AppDispatcher tests and the test routing plugin.

All credit for these changes goes to @brook


  Commit: 7c9ca60080f4032a958c6323d20abb9dcbc035f7
      https://github.com/ckan/ckan/commit/7c9ca60080f4032a958c6323d20abb9dcbc035f7
  Author: amercader <amercadero at gmail.com>
  Date:   2016-08-16 (Tue, 16 Aug 2016)

  Changed paths:
    M ckan/config/middleware/flask_app.py

  Log Message:
  -----------
  [#3196] Make helper functions (`h`) available to Flask templates

Tests incoming


  Commit: ea5382bfb82fc3dce4f4db04fc3618bc1b6a96d0
      https://github.com/ckan/ckan/commit/ea5382bfb82fc3dce4f4db04fc3618bc1b6a96d0
  Author: amercader <amercadero at gmail.com>
  Date:   2016-08-16 (Tue, 16 Aug 2016)

  Changed paths:
    M ckan/config/middleware/flask_app.py

  Log Message:
  -----------
  [#3196] Add template directory, register Jinja2 extensions

We are registering the same ones as in Pylons, we might want to clean
them up.


  Commit: a887c04550873cb0d2acdf0af9537cc34ce06887
      https://github.com/ckan/ckan/commit/a887c04550873cb0d2acdf0af9537cc34ce06887
  Author: amercader <amercadero at gmail.com>
  Date:   2016-08-18 (Thu, 18 Aug 2016)

  Changed paths:
    M CHANGELOG.rst
    M ckan/__init__.py
    M ckan/controllers/group.py
    M ckan/controllers/package.py
    M ckan/i18n/ar/LC_MESSAGES/ckan.mo
    M ckan/i18n/bg/LC_MESSAGES/ckan.mo
    M ckan/i18n/ca/LC_MESSAGES/ckan.mo
    M ckan/i18n/cs_CZ/LC_MESSAGES/ckan.mo
    M ckan/i18n/da_DK/LC_MESSAGES/ckan.mo
    M ckan/i18n/de/LC_MESSAGES/ckan.mo
    M ckan/i18n/el/LC_MESSAGES/ckan.mo
    M ckan/i18n/en_AU/LC_MESSAGES/ckan.mo
    M ckan/i18n/en_GB/LC_MESSAGES/ckan.mo
    M ckan/i18n/es/LC_MESSAGES/ckan.mo
    M ckan/i18n/es_AR/LC_MESSAGES/ckan.mo
    M ckan/i18n/fa_IR/LC_MESSAGES/ckan.mo
    M ckan/i18n/fi/LC_MESSAGES/ckan.mo
    M ckan/i18n/fi/LC_MESSAGES/ckan.po
    M ckan/i18n/fr/LC_MESSAGES/ckan.mo
    M ckan/i18n/he/LC_MESSAGES/ckan.mo
    M ckan/i18n/hr/LC_MESSAGES/ckan.mo
    M ckan/i18n/hu/LC_MESSAGES/ckan.mo
    M ckan/i18n/id/LC_MESSAGES/ckan.mo
    M ckan/i18n/is/LC_MESSAGES/ckan.mo
    M ckan/i18n/is/LC_MESSAGES/ckan.po
    M ckan/i18n/it/LC_MESSAGES/ckan.mo
    M ckan/i18n/ja/LC_MESSAGES/ckan.mo
    M ckan/i18n/km/LC_MESSAGES/ckan.mo
    M ckan/i18n/ko_KR/LC_MESSAGES/ckan.mo
    M ckan/i18n/lt/LC_MESSAGES/ckan.mo
    M ckan/i18n/lv/LC_MESSAGES/ckan.mo
    M ckan/i18n/mn_MN/LC_MESSAGES/ckan.mo
    M ckan/i18n/ne/LC_MESSAGES/ckan.po
    M ckan/i18n/nl/LC_MESSAGES/ckan.mo
    M ckan/i18n/nl/LC_MESSAGES/ckan.po
    M ckan/i18n/no/LC_MESSAGES/ckan.mo
    M ckan/i18n/no/LC_MESSAGES/ckan.po
    M ckan/i18n/pl/LC_MESSAGES/ckan.mo
    M ckan/i18n/pt_BR/LC_MESSAGES/ckan.mo
    M ckan/i18n/pt_PT/LC_MESSAGES/ckan.mo
    M ckan/i18n/pt_PT/LC_MESSAGES/ckan.po
    M ckan/i18n/ro/LC_MESSAGES/ckan.mo
    M ckan/i18n/ru/LC_MESSAGES/ckan.mo
    M ckan/i18n/sk/LC_MESSAGES/ckan.mo
    M ckan/i18n/sl/LC_MESSAGES/ckan.mo
    M ckan/i18n/sq/LC_MESSAGES/ckan.mo
    M ckan/i18n/sr/LC_MESSAGES/ckan.mo
    M ckan/i18n/sr_Latn/LC_MESSAGES/ckan.mo
    M ckan/i18n/sv/LC_MESSAGES/ckan.mo
    M ckan/i18n/th/LC_MESSAGES/ckan.mo
    A ckan/i18n/tl/LC_MESSAGES/ckan.mo
    A ckan/i18n/tl/LC_MESSAGES/ckan.po
    M ckan/i18n/tr/LC_MESSAGES/ckan.mo
    M ckan/i18n/uk_UA/LC_MESSAGES/ckan.mo
    M ckan/i18n/uk_UA/LC_MESSAGES/ckan.po
    M ckan/i18n/vi/LC_MESSAGES/ckan.mo
    M ckan/i18n/zh_CN/LC_MESSAGES/ckan.mo
    M ckan/i18n/zh_CN/LC_MESSAGES/ckan.po
    M ckan/i18n/zh_TW/LC_MESSAGES/ckan.mo
    M ckan/lib/cli.py
    M ckan/lib/dictization/model_dictize.py
    M ckan/lib/mailer.py
    M ckan/logic/action/get.py
    M ckan/logic/action/update.py
    M ckan/public/base/css/main.css
    M ckan/public/base/less/module.less
    M ckan/tests/controllers/test_package.py
    M ckan/tests/lib/test_mailer.py
    M ckan/tests/logic/action/test_get.py
    M ckan/tests/logic/action/test_update.py
    M ckanext/reclineview/plugin.py
    M ckanext/reclineview/theme/public/css/recline.css
    M ckanext/reclineview/theme/public/recline_view.js
    M ckanext/reclineview/theme/public/resource.config
    R ckanext/reclineview/theme/public/vendor/bootstrap/2.3.2/bootstrap.js
    R ckanext/reclineview/theme/public/vendor/bootstrap/2.3.2/css/bootstrap-responsive.css
    R ckanext/reclineview/theme/public/vendor/bootstrap/2.3.2/css/bootstrap.css
    R ckanext/reclineview/theme/public/vendor/bootstrap/2.3.2/img/glyphicons-halflings-white.png
    R ckanext/reclineview/theme/public/vendor/bootstrap/2.3.2/img/glyphicons-halflings.png
    A ckanext/reclineview/theme/public/vendor/bootstrap/3.2.0/css/bootstrap-theme.css
    A ckanext/reclineview/theme/public/vendor/bootstrap/3.2.0/css/bootstrap.css
    A ckanext/reclineview/theme/public/vendor/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.eot
    A ckanext/reclineview/theme/public/vendor/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.svg
    A ckanext/reclineview/theme/public/vendor/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.ttf
    A ckanext/reclineview/theme/public/vendor/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.woff
    A ckanext/reclineview/theme/public/vendor/bootstrap/3.2.0/js/bootstrap.js
    A ckanext/reclineview/theme/public/vendor/leaflet.markercluster/leaflet.markercluster-src.js
    A ckanext/reclineview/theme/public/vendor/recline/flot.css
    A ckanext/reclineview/theme/public/vendor/recline/map.css
    M ckanext/reclineview/theme/public/vendor/recline/recline.js
    A ckanext/reclineview/theme/public/vendor/recline/slickgrid.css
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/MIT-LICENSE.txt
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/README.txt
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/images/calendar.gif
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/images/sort-asc.gif
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/images/sort-desc.gif
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/jquery-ui-1.8.16.custom.js
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/jquery-ui-1.8.16.custom.min.js
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/jquery.event.drag-2.0.js
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/jquery.event.drag-2.0.min.js
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/plugins/slick.rowmovemanager.js
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/plugins/slick.rowselectionmodel.js
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/slick.grid.css
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/slick.grid.js
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/slick.grid.min.css
    R ckanext/reclineview/theme/public/vendor/slickgrid/2.0.1/slick.grid.min.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/MIT-LICENSE.txt
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/README.md
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/controls/slick.columnpicker.css
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/controls/slick.columnpicker.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/controls/slick.pager.css
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/controls/slick.pager.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-icons_222222_256x240.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-icons_2e83ff_256x240.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-icons_454545_256x240.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-icons_888888_256x240.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/images/ui-icons_cd0a0a_256x240.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/css/smoothness/jquery-ui-1.8.16.custom.css
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/actions.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/ajax-loader-small.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/arrow_redo.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/arrow_right_peppermint.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/arrow_right_spearmint.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/arrow_undo.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/bullet_blue.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/bullet_star.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/bullet_toggle_minus.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/bullet_toggle_plus.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/calendar.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/collapse.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/comment_yellow.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/down.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/drag-handle.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/editor-helper-bg.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/expand.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/header-bg.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/header-columns-bg.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/header-columns-over-bg.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/help.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/info.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/listview.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/pencil.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/row-over-bg.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/sort-asc.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/sort-asc.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/sort-desc.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/sort-desc.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/stripes.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/tag_red.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/tick.png
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/user_identity.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/images/user_identity_plus.gif
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/jquery-1.7.min.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/jquery-ui-1.8.16.custom.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/jquery.event.drag-2.2.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/jquery.event.drop-2.2.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.autotooltips.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.cellcopymanager.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.cellrangedecorator.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.cellrangeselector.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.cellselectionmodel.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.checkboxselectcolumn.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.headerbuttons.css
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.headerbuttons.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.headermenu.css
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.headermenu.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.rowmovemanager.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/plugins/slick.rowselectionmodel.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick-default-theme.css
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick.core.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick.dataview.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick.editors.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick.formatters.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick.grid.css
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick.grid.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick.groupitemmetadataprovider.js
    A ckanext/reclineview/theme/public/vendor/slickgrid/2.2/slick.remotemodel.js
    A ckanext/reclineview/theme/public/vendor/timeline/LICENSE
    A ckanext/reclineview/theme/public/vendor/timeline/README
    M ckanext/reclineview/theme/templates/recline_view.html
    M doc/maintaining/configuration.rst
    M doc/maintaining/data-viewer.rst
    M doc/maintaining/installing/install-from-package.rst

  Log Message:
  -----------
  Merge branch 'master' into 3196-blueprints-and-templates


  Commit: 663b9995567ed4402c199f41cd3afd38d98faf7e
      https://github.com/ckan/ckan/commit/663b9995567ed4402c199f41cd3afd38d98faf7e
  Author: amercader <amercadero at gmail.com>
  Date:   2016-08-18 (Thu, 18 Aug 2016)

  Changed paths:
    M ckan/config/middleware/flask_app.py
    M ckan/tests/config/test_middleware.py
    M ckan/tests/helpers.py
    M dev-requirements.txt
    M test-core.ini

  Log Message:
  -----------
  Merge branch '3196-flask-debug-and-testing' into 3196-blueprints-and-templates

Conflicts:
	ckan/config/middleware/flask_app.py


  Commit: b92edd63b4f8f8cb876264900490fa490c394c74
      https://github.com/ckan/ckan/commit/b92edd63b4f8f8cb876264900490fa490c394c74
  Author: amercader <amercadero at gmail.com>
  Date:   2016-08-18 (Thu, 18 Aug 2016)

  Changed paths:
    A ckanext/example_flask_iblueprint/__init__.py
    A ckanext/example_flask_iblueprint/plugin.py
    A ckanext/example_flask_iblueprint/templates/about.html
    A ckanext/example_flask_iblueprint/templates/about_base.html
    A ckanext/example_flask_iblueprint/tests/__init__.py
    A ckanext/example_flask_iblueprint/tests/test_routes.py

  Log Message:
  -----------
  [#3196] Add IBlueprint example

Showint how to register custom routes and how these affect ones on core.
Also tests helpers on templates.


Compare: https://github.com/ckan/ckan/compare/ee12473902f1^...b92edd63b4f8


More information about the ckan-changes mailing list