From 0a223ac4f920829f2fac66f7ddc9f4938a89cc8a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 21 Jan 2016 20:04:28 -0600 Subject: [PATCH] Add autocomplete vendor field renderer. --- tailbone/forms/renderers/__init__.py | 6 ++++- tailbone/forms/renderers/vendors.py | 36 ++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tailbone/forms/renderers/vendors.py diff --git a/tailbone/forms/renderers/__init__.py b/tailbone/forms/renderers/__init__.py index 8737df53..fab9c7c1 100644 --- a/tailbone/forms/renderers/__init__.py +++ b/tailbone/forms/renderers/__init__.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2015 Lance Edgar +# Copyright © 2010-2016 Lance Edgar # # This file is part of Rattail. # @@ -24,6 +24,8 @@ FormAlchemy Field Renderers """ +from __future__ import unicode_literals, absolute_import + from .core import CustomFieldRenderer, DateFieldRenderer from .common import (AutocompleteFieldRenderer, @@ -43,3 +45,5 @@ from .products import (ProductFieldRenderer, GPCFieldRenderer, PriceFieldRenderer, PriceWithExpirationFieldRenderer) from .stores import StoreFieldRenderer + +from .vendors import VendorFieldRenderer diff --git a/tailbone/forms/renderers/vendors.py b/tailbone/forms/renderers/vendors.py new file mode 100644 index 00000000..0d1916b9 --- /dev/null +++ b/tailbone/forms/renderers/vendors.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Rattail -- Retail Software Framework +# Copyright © 2010-2016 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 Affero 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 Affero General Public License for +# more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Rattail. If not, see . +# +################################################################################ +""" +Vendor Field Renderers +""" + +from __future__ import unicode_literals, absolute_import + +from .common import AutocompleteFieldRenderer + + +class VendorFieldRenderer(AutocompleteFieldRenderer): + """ + Renderer for :class:`rattail.db.model.Vendor` instance fields. + """ + service_route = 'vendors.autocomplete'