diff --git a/rattail_demo/config.py b/rattail_demo/config.py index 7815db9..29524c4 100644 --- a/rattail_demo/config.py +++ b/rattail_demo/config.py @@ -14,6 +14,8 @@ class DemoConfigExtension(ConfigExtension): def configure(self, config): + config.setdefault('rattail', 'app_package', 'rattail_demo') + # tell rattail where our stuff lives config.setdefault('rattail', 'model', 'rattail_demo.db.model') config.setdefault('rattail.mail', 'emails', 'rattail_demo.emails') diff --git a/rattail_demo/db/model/__init__.py b/rattail_demo/db/model/__init__.py index c1974e2..8e6126a 100644 --- a/rattail_demo/db/model/__init__.py +++ b/rattail_demo/db/model/__init__.py @@ -6,8 +6,11 @@ Rattail Demo data model # bring in all the normal stuff from Rattail from rattail.db.model import * -# also bring in CORE integration models +# also bring in CORE-POS integration models from rattail_corepos.db.model import * +# also bring in WooCommerce integration models +from rattail_woocommerce.db.model import * + # now bring in Demo-specific models from .shopfoo import ShopfooProduct, ShopfooProductExport diff --git a/rattail_demo/importing/versions.py b/rattail_demo/importing/versions.py index 07d4067..332a29d 100644 --- a/rattail_demo/importing/versions.py +++ b/rattail_demo/importing/versions.py @@ -6,10 +6,12 @@ Rattail Demo -> Rattail Demo "versions" data import from rattail_demo.db import model from rattail.importing import versions as base from rattail_corepos.importing.versions import CoreposVersionMixin +from rattail_woocommerce.importing.versions import WooVersionMixin class FromRattailDemoToRattailDemoVersions(base.FromRattailToRattailVersions, - CoreposVersionMixin): + CoreposVersionMixin, + WooVersionMixin): """ Handler for Rattail Demo -> Rattail Demo "versions" data import """ @@ -17,6 +19,7 @@ class FromRattailDemoToRattailDemoVersions(base.FromRattailToRattailVersions, def get_importers(self): importers = super(FromRattailDemoToRattailDemoVersions, self).get_importers() importers = self.add_corepos_importers(importers) + importers = self.add_woo_importers(importers) importers['ShopfooProduct'] = ShopfooProductImporter return importers diff --git a/rattail_demo/web/app.py b/rattail_demo/web/app.py index e6e9895..9e7dd14 100644 --- a/rattail_demo/web/app.py +++ b/rattail_demo/web/app.py @@ -16,6 +16,7 @@ def main(global_config, **settings): # prefer demo templates over tailbone settings.setdefault('mako.directories', ['rattail_demo.web:templates', 'tailbone_corepos:templates', + 'tailbone_woocommerce:templates', 'tailbone:templates',]) # for graceful handling of postgres restart diff --git a/rattail_demo/web/menus.py b/rattail_demo/web/menus.py index f981d4b..341447e 100644 --- a/rattail_demo/web/menus.py +++ b/rattail_demo/web/menus.py @@ -122,6 +122,12 @@ def simple_menus(request): 'url': url('shopfoo.product_exports'), 'perm': 'shopfoo.product_exports.list', }, + {'type': 'sep'}, + { + 'title': "WooCommerce Products", + 'url': url('woocommerce.products'), + 'perm': 'woocommerce.products.list', + }, ], }, { diff --git a/rattail_demo/web/templates/products/view.mako b/rattail_demo/web/templates/products/view.mako new file mode 100644 index 0000000..934bab2 --- /dev/null +++ b/rattail_demo/web/templates/products/view.mako @@ -0,0 +1,46 @@ +## -*- coding: utf-8; -*- +<%inherit file="tailbone:templates/products/view.mako" /> +<%namespace name="corepos" file="tailbone_corepos:templates/products/view.mako" /> +<%namespace name="woocommerce" file="tailbone_woocommerce:templates/products/view.mako" /> + +<%def name="object_helpers()"> + ${parent.object_helpers()} + ${self.render_xref_helper()} + +