Add initial versioning support with SQLAlchemy-Continuum.
This commit is contained in:
parent
41dd2ef17b
commit
def466935b
43 changed files with 717 additions and 26 deletions
3
tailbone/views/vendors/__init__.py
vendored
3
tailbone/views/vendors/__init__.py
vendored
|
@ -26,7 +26,8 @@ Views pertaining to vendors
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .core import VendorsGrid, VendorCrud, VendorsAutocomplete, add_routes
|
||||
from .core import (VendorsGrid, VendorCrud, VendorVersionView,
|
||||
VendorsAutocomplete, add_routes)
|
||||
|
||||
|
||||
def includeme(config):
|
||||
|
|
25
tailbone/views/vendors/core.py
vendored
25
tailbone/views/vendors/core.py
vendored
|
@ -1,9 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2012 Lance Edgar
|
||||
# Copyright © 2010-2015 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -21,15 +20,19 @@
|
|||
# along with Rattail. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
"""
|
||||
Vendor Views
|
||||
"""
|
||||
|
||||
from tailbone.views import SearchableAlchemyGridView, CrudView, AutocompleteView
|
||||
from tailbone.forms import AssociationProxyField, PersonFieldRenderer
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rattail.db import model
|
||||
from rattail.db.model import Vendor
|
||||
|
||||
from tailbone.views import SearchableAlchemyGridView, CrudView, AutocompleteView
|
||||
from tailbone.views.continuum import VersionView, version_defaults
|
||||
from tailbone.forms import AssociationProxyField, PersonFieldRenderer
|
||||
|
||||
|
||||
class VendorsGrid(SearchableAlchemyGridView):
|
||||
|
||||
|
@ -93,6 +96,14 @@ class VendorCrud(CrudView):
|
|||
return fs
|
||||
|
||||
|
||||
class VendorVersionView(VersionView):
|
||||
"""
|
||||
View which shows version history for a vendor.
|
||||
"""
|
||||
parent_class = model.Vendor
|
||||
route_model_view = 'vendor.read'
|
||||
|
||||
|
||||
class VendorsAutocomplete(AutocompleteView):
|
||||
|
||||
mapped_class = Vendor
|
||||
|
@ -127,3 +138,5 @@ def includeme(config):
|
|||
permission='vendors.update')
|
||||
config.add_view(VendorCrud, attr='delete', route_name='vendor.delete',
|
||||
permission='vendors.delete')
|
||||
|
||||
version_defaults(config, VendorVersionView, 'vendor')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue