diff --git a/docs/api/wuttaweb/index.rst b/docs/api/wuttaweb/index.rst index 6b305cf..5a65f11 100644 --- a/docs/api/wuttaweb/index.rst +++ b/docs/api/wuttaweb/index.rst @@ -20,3 +20,4 @@ views views.base views.common + views.essential diff --git a/docs/api/wuttaweb/views.essential.rst b/docs/api/wuttaweb/views.essential.rst new file mode 100644 index 0000000..79c0b57 --- /dev/null +++ b/docs/api/wuttaweb/views.essential.rst @@ -0,0 +1,6 @@ + +``wuttaweb.views.essential`` +============================ + +.. automodule:: wuttaweb.views.essential + :members: diff --git a/src/wuttaweb/views/__init__.py b/src/wuttaweb/views/__init__.py index 0b62a83..68fdd77 100644 --- a/src/wuttaweb/views/__init__.py +++ b/src/wuttaweb/views/__init__.py @@ -33,4 +33,4 @@ from .base import View def includeme(config): - config.include('wuttaweb.views.common') + config.include('wuttaweb.views.essential') diff --git a/src/wuttaweb/views/essential.py b/src/wuttaweb/views/essential.py new file mode 100644 index 0000000..a9272f4 --- /dev/null +++ b/src/wuttaweb/views/essential.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# wuttaweb -- Web App for Wutta Framework +# Copyright © 2024 Lance Edgar +# +# This file is part of Wutta Framework. +# +# Wutta Framework is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) any +# later version. +# +# Wutta Framework is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# Wutta Framework. If not, see . +# +################################################################################ +""" +Essential views for convenient includes + +Most apps should include this module:: + + pyramid_config.include('wuttaweb.views.essential') + +That will in turn include the following modules: + +* :mod:`wuttaweb.views.common` +""" + + +def defaults(config, **kwargs): + mod = lambda spec: kwargs.get(spec, spec) + + config.include(mod('wuttaweb.views.common')) + + +def includeme(config): + defaults(config)