Add versioning display support for contact-related models

This commit is contained in:
Lance Edgar 2017-07-05 17:16:28 -05:00
parent 20ddf2687b
commit 85bdefc25b
8 changed files with 125 additions and 27 deletions

View file

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8; -*-
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2016 Lance Edgar
# Copyright © 2010-2017 Lance Edgar
#
# This file is part of Rattail.
#
@ -44,6 +44,7 @@ class EmployeesView(MasterView):
Master view for the Employee class.
"""
model_class = model.Employee
has_versions = True
def _preconfigure_grid(self, g):
g.joiners['phone'] = lambda q: q.outerjoin(model.EmployeePhoneNumber, sa.and_(
@ -154,6 +155,13 @@ class EmployeesView(MasterView):
del fs.first_name
del fs.last_name
def get_version_child_classes(self):
return [
(model.Person, 'uuid', 'person_uuid'),
(model.EmployeePhoneNumber, 'parent_uuid'),
(model.EmployeeEmailAddress, 'parent_uuid'),
]
class StoresField(fa.Field):