From 2faf8ff4fc7a21657baddfb5dcf17ab528af89f3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 11 Jun 2023 14:53:55 -0500 Subject: [PATCH] Add "typicals" view set for corporal --- corporal/web/views/essentials.py | 1 - corporal/web/views/typical.py | 54 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 corporal/web/views/typical.py diff --git a/corporal/web/views/essentials.py b/corporal/web/views/essentials.py index c32b6f6..98dc8a9 100644 --- a/corporal/web/views/essentials.py +++ b/corporal/web/views/essentials.py @@ -40,7 +40,6 @@ def defaults(config, **kwargs): config.include(mod('tailbone_corepos.views')) # batches - config.include(mod('tailbone_corepos.views.batch.vendorcatalog')) config.include(mod('tailbone_corepos.views.batch.coremember')) # corporal-specific diff --git a/corporal/web/views/typical.py b/corporal/web/views/typical.py new file mode 100644 index 0000000..3efaa55 --- /dev/null +++ b/corporal/web/views/typical.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# Rattail -- Retail Software Framework +# Copyright © 2010-2023 Lance Edgar +# +# This file is part of Rattail. +# +# Rattail 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. +# +# Rattail 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 +# Rattail. If not, see . +# +################################################################################ +""" +Typical views for convenient includes +""" + +from tailbone.views import typical as base + + +def defaults(config, **kwargs): + mod = lambda spec: kwargs.get(spec, spec) + + # tailbone essentials + config.include('tailbone.views.essentials') + + # tailbone typical + kwargs['tailbone.views.batch.vendorcatalog'] = 'tailbone_corepos.views.batch.vendorcatalog' + base.defaults(config, **kwargs) + + # tailbone extras + config.include(mod('tailbone.views.poser')) + + # main views for CORE-POS + config.include(mod('tailbone_corepos.views')) + + # batches + config.include(mod('tailbone_corepos.views.batch.coremember')) + + # corporal-specific + config.include(mod('corporal.web.views.supplemental')) + + +def includeme(config): + defaults(config)