From b64f6c7884b7a9f39f03c380b17c077290d68d15 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 23 Nov 2022 12:20:58 -0600 Subject: [PATCH] Use newer config strategy for all views to make inheritance easier --- tailbone/views/auth.py | 9 ++++++++- tailbone/views/bouncer.py | 11 +++++++++-- tailbone/views/categories.py | 9 ++++++++- tailbone/views/common.py | 9 ++++++++- tailbone/views/customergroups.py | 11 +++++++++-- tailbone/views/custorders/creating.py | 11 +++++++++-- tailbone/views/custorders/items.py | 11 +++++++++-- tailbone/views/departments.py | 9 ++++++++- tailbone/views/depositlinks.py | 11 +++++++++-- tailbone/views/families.py | 9 ++++++++- tailbone/views/features.py | 11 +++++++++-- tailbone/views/filemon.py | 11 +++++++++-- tailbone/views/ifps.py | 11 +++++++++-- tailbone/views/importing.py | 9 ++++++++- tailbone/views/inventory.py | 11 +++++++++-- tailbone/views/labels/profiles.py | 9 ++++++++- tailbone/views/members.py | 11 +++++++++-- tailbone/views/messages.py | 25 +++++++++++++++++++------ tailbone/views/permissions.py | 11 +++++++++-- tailbone/views/progress.py | 12 ++++++++++-- tailbone/views/projects.py | 9 ++++++++- tailbone/views/purchases/core.py | 9 ++++++++- tailbone/views/purchases/credits.py | 11 +++++++++-- tailbone/views/purchasing/costing.py | 9 ++++++++- tailbone/views/purchasing/ordering.py | 9 ++++++++- tailbone/views/purchasing/receiving.py | 9 ++++++++- tailbone/views/reportcodes.py | 11 +++++++++-- tailbone/views/reports.py | 12 +++++++++++- tailbone/views/roles.py | 9 ++++++++- tailbone/views/settings.py | 11 ++++++++++- tailbone/views/shifts/core.py | 13 +++++++++++-- tailbone/views/shifts/schedule.py | 11 +++++++++-- tailbone/views/shifts/timesheet.py | 11 +++++++++-- tailbone/views/stores.py | 11 +++++++++-- tailbone/views/subdepartments.py | 9 ++++++++- tailbone/views/tables.py | 9 ++++++++- tailbone/views/taxes.py | 11 +++++++++-- tailbone/views/tempmon/appliances.py | 11 +++++++++-- tailbone/views/tempmon/clients.py | 11 +++++++++-- tailbone/views/tempmon/dashboard.py | 11 +++++++++-- tailbone/views/tempmon/probes.py | 11 +++++++++-- tailbone/views/tempmon/readings.py | 11 +++++++++-- tailbone/views/trainwreck/defaults.py | 11 +++++++++-- tailbone/views/uoms.py | 11 +++++++++-- 44 files changed, 397 insertions(+), 75 deletions(-) diff --git a/tailbone/views/auth.py b/tailbone/views/auth.py index 406b8add..e7922e3d 100644 --- a/tailbone/views/auth.py +++ b/tailbone/views/auth.py @@ -239,5 +239,12 @@ class AuthenticationView(View): config.add_view(cls, attr='stop_root', route_name='stop_root') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + AuthenticationView = kwargs.get('AuthenticationView', base['AuthenticationView']) AuthenticationView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/bouncer.py b/tailbone/views/bouncer.py index 6bee7099..628ed07c 100644 --- a/tailbone/views/bouncer.py +++ b/tailbone/views/bouncer.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -210,5 +210,12 @@ class EmailBounceView(MasterView): cls._defaults(config) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + EmailBounceView = kwargs.get('EmailBounceView', base['EmailBounceView']) EmailBounceView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/categories.py b/tailbone/views/categories.py index c76c9292..941257b8 100644 --- a/tailbone/views/categories.py +++ b/tailbone/views/categories.py @@ -110,5 +110,12 @@ class CategoryView(MasterView): CategoriesView = CategoryView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + CategoryView = kwargs.get('CategoryView', base['CategoryView']) CategoryView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/common.py b/tailbone/views/common.py index c2ec897f..f531b48e 100644 --- a/tailbone/views/common.py +++ b/tailbone/views/common.py @@ -340,5 +340,12 @@ class CommonView(View): permission='admin') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + CommonView = kwargs.get('CommonView', base['CommonView']) CommonView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/customergroups.py b/tailbone/views/customergroups.py index 02138346..98cea8e0 100644 --- a/tailbone/views/customergroups.py +++ b/tailbone/views/customergroups.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -80,5 +80,12 @@ class CustomerGroupView(MasterView): CustomerGroupsView = CustomerGroupView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + CustomerGroupView = kwargs.get('CustomerGroupView', base['CustomerGroupView']) CustomerGroupView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/custorders/creating.py b/tailbone/views/custorders/creating.py index d0d648b5..cbdf6d5e 100644 --- a/tailbone/views/custorders/creating.py +++ b/tailbone/views/custorders/creating.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -45,5 +45,12 @@ class CreateCustomerOrderBatchView(CustomerOrderBatchView): creatable = False -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + CreateCustomerOrderBatchView = kwargs.get('CreateCustomerOrderBatchView', base['CreateCustomerOrderBatchView']) CreateCustomerOrderBatchView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/custorders/items.py b/tailbone/views/custorders/items.py index 823130ed..c780756a 100644 --- a/tailbone/views/custorders/items.py +++ b/tailbone/views/custorders/items.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -566,5 +566,12 @@ class CustomerOrderItemView(MasterView): CustomerOrderItemsView = CustomerOrderItemView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + CustomerOrderItemView = kwargs.get('CustomerOrderItemView', base['CustomerOrderItemView']) CustomerOrderItemView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/departments.py b/tailbone/views/departments.py index 1e964624..96dcfb61 100644 --- a/tailbone/views/departments.py +++ b/tailbone/views/departments.py @@ -241,5 +241,12 @@ class DepartmentView(MasterView): cls._defaults(config) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + DepartmentView = kwargs.get('DepartmentView', base['DepartmentView']) DepartmentView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/depositlinks.py b/tailbone/views/depositlinks.py index 42f83460..1c9abde1 100644 --- a/tailbone/views/depositlinks.py +++ b/tailbone/views/depositlinks.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -64,5 +64,12 @@ class DepositLinkView(MasterView): DepositLinksView = DepositLinkView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + DepositLinkView = kwargs.get('DepositLinkView', base['DepositLinkView']) DepositLinkView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/families.py b/tailbone/views/families.py index 0b8ba31d..2d445b78 100644 --- a/tailbone/views/families.py +++ b/tailbone/views/families.py @@ -108,5 +108,12 @@ class FamilyView(MasterView): FamiliesView = FamilyView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + FamilyView = kwargs.get('FamilyView', base['FamilyView']) FamilyView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/features.py b/tailbone/views/features.py index f9c2b5c7..d55be524 100644 --- a/tailbone/views/features.py +++ b/tailbone/views/features.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -112,5 +112,12 @@ class GenerateFeatureView(View): renderer='/generate_feature.mako') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + GenerateFeatureView = kwargs.get('GenerateFeatureView', base['GenerateFeatureView']) GenerateFeatureView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/filemon.py b/tailbone/views/filemon.py index 1d164c83..b0c81b45 100644 --- a/tailbone/views/filemon.py +++ b/tailbone/views/filemon.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2018 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -63,5 +63,12 @@ class FilemonView(View): config.add_view(cls, attr='restart', route_name='filemon.restart', permission='filemon.restart') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + FilemonView = kwargs.get('FilemonView', base['FilemonView']) FilemonView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/ifps.py b/tailbone/views/ifps.py index be3bb0f8..af626ef3 100644 --- a/tailbone/views/ifps.py +++ b/tailbone/views/ifps.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -90,5 +90,12 @@ class IFPS_PLUView(MasterView): -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + IFPS_PLUView = kwargs.get('IFPS_PLUView', base['IFPS_PLUView']) IFPS_PLUView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/importing.py b/tailbone/views/importing.py index a6126c9e..003d7ac4 100644 --- a/tailbone/views/importing.py +++ b/tailbone/views/importing.py @@ -650,5 +650,12 @@ class RunJobSchema(colander.MappingSchema): warnings = colander.SchemaNode(colander.Bool()) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + ImportingView = kwargs.get('ImportingView', base['ImportingView']) ImportingView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/inventory.py b/tailbone/views/inventory.py index 7cf5d8d0..4622fa9f 100644 --- a/tailbone/views/inventory.py +++ b/tailbone/views/inventory.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -70,5 +70,12 @@ class InventoryAdjustmentReasonView(MasterView): InventoryAdjustmentReasonsView = InventoryAdjustmentReasonView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + InventoryAdjustmentReasonView = kwargs.get('InventoryAdjustmentReasonView', base['InventoryAdjustmentReasonView']) InventoryAdjustmentReasonView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/labels/profiles.py b/tailbone/views/labels/profiles.py index a91cdfb2..c392e510 100644 --- a/tailbone/views/labels/profiles.py +++ b/tailbone/views/labels/profiles.py @@ -177,5 +177,12 @@ class LabelProfileView(MasterView): ProfilesView = LabelProfileView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + LabelProfileView = kwargs.get('LabelProfileView', base['LabelProfileView']) LabelProfileView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/members.py b/tailbone/views/members.py index 070b543a..a0157649 100644 --- a/tailbone/views/members.py +++ b/tailbone/views/members.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -189,5 +189,12 @@ class MemberView(MasterView): return member.phones[0].number -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + MemberView = kwargs.get('MemberView', base['MemberView']) MemberView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/messages.py b/tailbone/views/messages.py index 7371e2e9..f483d03b 100644 --- a/tailbone/views/messages.py +++ b/tailbone/views/messages.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -575,23 +575,36 @@ class RecipientsWidgetBuefy(dfwidget.Widget): return field.renderer(template, **values) -def includeme(config): +def defaults(config, **kwargs): + base = globals() - config.add_tailbone_permission('messages', 'messages.list', "List/Search Messages") + config.add_tailbone_permission('messages', 'messages.list', + "List/Search Messages") # inbox + InboxView = kwargs.get('InboxView', base['InboxView']) config.add_route('messages.inbox', '/messages/inbox/') - config.add_view(InboxView, attr='index', route_name='messages.inbox', + config.add_view(InboxView, attr='index', + route_name='messages.inbox', permission='messages.list') # archive + ArchiveView = kwargs.get('ArchiveView', base['ArchiveView']) config.add_route('messages.archive', '/messages/archive/') - config.add_view(ArchiveView, attr='index', route_name='messages.archive', + config.add_view(ArchiveView, attr='index', + route_name='messages.archive', permission='messages.list') # sent + SentView = kwargs.get('SentView', base['SentView']) config.add_route('messages.sent', '/messages/sent/') - config.add_view(SentView, attr='index', route_name='messages.sent', + config.add_view(SentView, attr='index', + route_name='messages.sent', permission='messages.list') + MessageView = kwargs.get('MessageView', base['MessageView']) MessageView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/permissions.py b/tailbone/views/permissions.py index 67f6e9b1..5168d544 100644 --- a/tailbone/views/permissions.py +++ b/tailbone/views/permissions.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -54,5 +54,12 @@ class PermissionView(MasterView): return query -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + PermissionView = kwargs.get('PermissionView', base['PermissionView']) PermissionView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/progress.py b/tailbone/views/progress.py index 5d06f158..169f324e 100644 --- a/tailbone/views/progress.py +++ b/tailbone/views/progress.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -65,9 +65,17 @@ def cancel(request): return {} -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + progress = kwargs.get('progress', base['progress']) config.add_route('progress', '/progress/{key}') config.add_view(progress, route_name='progress', renderer='json') + cancel = kwargs.get('cancel', base['cancel']) config.add_route('progress.cancel', '/progress/{key}/cancel') config.add_view(cancel, route_name='progress.cancel', renderer='json') + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/projects.py b/tailbone/views/projects.py index 746a3c47..9a6633f4 100644 --- a/tailbone/views/projects.py +++ b/tailbone/views/projects.py @@ -223,5 +223,12 @@ class GenerateProjectView(View): renderer='/generate_project.mako') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + GenerateProjectView = kwargs.get('GenerateProjectView', base['GenerateProjectView']) GenerateProjectView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/purchases/core.py b/tailbone/views/purchases/core.py index eca5de34..77b02501 100644 --- a/tailbone/views/purchases/core.py +++ b/tailbone/views/purchases/core.py @@ -408,5 +408,12 @@ class PurchaseView(MasterView): permission='{}.receiving_worksheet'.format(permission_prefix)) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + PurchaseView = kwargs.get('PurchaseView', base['PurchaseView']) PurchaseView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/purchases/credits.py b/tailbone/views/purchases/credits.py index 79530fe2..71902426 100644 --- a/tailbone/views/purchases/credits.py +++ b/tailbone/views/purchases/credits.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -201,5 +201,12 @@ class PurchaseCreditView(MasterView): permission='{}.change_status'.format(permission_prefix)) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + PurchaseCreditView = kwargs.get('PurchaseCreditView', base['PurchaseCreditView']) PurchaseCreditView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/purchasing/costing.py b/tailbone/views/purchasing/costing.py index 2f467feb..2d62d6e1 100644 --- a/tailbone/views/purchasing/costing.py +++ b/tailbone/views/purchasing/costing.py @@ -377,5 +377,12 @@ class NewCostingBatch(colander.Schema): validator=valid_workflow) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + CostingBatchView = kwargs.get('CostingBatchView', base['CostingBatchView']) CostingBatchView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/purchasing/ordering.py b/tailbone/views/purchasing/ordering.py index d772a359..f4820783 100644 --- a/tailbone/views/purchasing/ordering.py +++ b/tailbone/views/purchasing/ordering.py @@ -527,5 +527,12 @@ class OrderingBatchView(PurchasingBatchView): "Download {} as Excel".format(model_title)) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + OrderingBatchView = kwargs.get('OrderingBatchView', base['OrderingBatchView']) OrderingBatchView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/purchasing/receiving.py b/tailbone/views/purchasing/receiving.py index 2fe692f0..78136ef3 100644 --- a/tailbone/views/purchasing/receiving.py +++ b/tailbone/views/purchasing/receiving.py @@ -2082,5 +2082,12 @@ class DeclareCreditForm(colander.MappingSchema): missing=colander.null) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + ReceivingBatchView = kwargs.get('ReceivingBatchView', base['ReceivingBatchView']) ReceivingBatchView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/reportcodes.py b/tailbone/views/reportcodes.py index 0f85aecb..ef090c22 100644 --- a/tailbone/views/reportcodes.py +++ b/tailbone/views/reportcodes.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -107,5 +107,12 @@ class ReportCodeView(MasterView): ReportCodesView = ReportCodeView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + ReportCodeView = kwargs.get('ReportCodeView', base['ReportCodeView']) ReportCodeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/reports.py b/tailbone/views/reports.py index 69eec23d..7cb5ecfe 100644 --- a/tailbone/views/reports.py +++ b/tailbone/views/reports.py @@ -800,14 +800,24 @@ def add_routes(config): config.add_route('reports.inventory', '/reports/inventory') -def includeme(config): +def defaults(config, **kwargs): + base = globals() # TODO: not in love with this pattern, but works for now add_routes(config) + OrderingWorksheet = kwargs.get('OrderingWorksheet', base['OrderingWorksheet']) config.add_view(OrderingWorksheet, route_name='reports.ordering', renderer='/reports/ordering.mako') + InventoryWorksheet = kwargs.get('InventoryWorksheet', base['InventoryWorksheet']) config.add_view(InventoryWorksheet, route_name='reports.inventory', renderer='/reports/inventory.mako') + ReportOutputView = kwargs.get('ReportOutputView', base['ReportOutputView']) ReportOutputView.defaults(config) + + ProblemReportView = kwargs.get('ProblemReportView', base['ProblemReportView']) ProblemReportView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/roles.py b/tailbone/views/roles.py index 61de606a..224356ed 100644 --- a/tailbone/views/roles.py +++ b/tailbone/views/roles.py @@ -529,5 +529,12 @@ class PermissionsWidget(dfwidget.Widget): return field.renderer(template, **values) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + RoleView = kwargs.get('RoleView', base['RoleView']) RoleView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/settings.py b/tailbone/views/settings.py index eaebce93..c38e3136 100644 --- a/tailbone/views/settings.py +++ b/tailbone/views/settings.py @@ -310,6 +310,15 @@ class AppSettingsView(View): permission='settings.edit') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + AppSettingsView = kwargs.get('AppSettingsView', base['AppSettingsView']) AppSettingsView.defaults(config) + + SettingView = kwargs.get('SettingView', base['SettingView']) SettingView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/shifts/core.py b/tailbone/views/shifts/core.py index b33ae0f0..b6d9aadf 100644 --- a/tailbone/views/shifts/core.py +++ b/tailbone/views/shifts/core.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -207,6 +207,15 @@ class WorkedShiftView(MasterView): WorkedShiftsView = WorkedShiftView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + ScheduledShiftView = kwargs.get('ScheduledShiftView', base['ScheduledShiftView']) ScheduledShiftView.defaults(config) + + WorkedShiftView = kwargs.get('WorkedShiftView', base['WorkedShiftView']) WorkedShiftView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/shifts/schedule.py b/tailbone/views/shifts/schedule.py index efaf4e33..7a1ccbe5 100644 --- a/tailbone/views/shifts/schedule.py +++ b/tailbone/views/shifts/schedule.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2018 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -212,5 +212,12 @@ class ScheduleView(TimeSheetView): permission='schedule.print') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + ScheduleView = kwargs.get('ScheduleView', base['ScheduleView']) ScheduleView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/shifts/timesheet.py b/tailbone/views/shifts/timesheet.py index 84d303e9..9898cd04 100644 --- a/tailbone/views/shifts/timesheet.py +++ b/tailbone/views/shifts/timesheet.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2018 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -133,5 +133,12 @@ class TimeSheetView(BaseTimeSheetView): permission='timesheet.edit') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TimeSheetView = kwargs.get('TimeSheetView', base['TimeSheetView']) TimeSheetView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/stores.py b/tailbone/views/stores.py index ef09e69b..5d507745 100644 --- a/tailbone/views/stores.py +++ b/tailbone/views/stores.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -121,5 +121,12 @@ class StoreView(MasterView): StoresView = StoreView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + StoreView = kwargs.get('StoreView', base['StoreView']) StoreView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/subdepartments.py b/tailbone/views/subdepartments.py index 67945581..d2a337cc 100644 --- a/tailbone/views/subdepartments.py +++ b/tailbone/views/subdepartments.py @@ -154,5 +154,12 @@ class SubdepartmentView(MasterView): SubdepartmentsView = SubdepartmentView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + SubdepartmentView = kwargs.get('SubdepartmentView', base['SubdepartmentView']) SubdepartmentView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/tables.py b/tailbone/views/tables.py index ea8aef99..5d4f7d95 100644 --- a/tailbone/views/tables.py +++ b/tailbone/views/tables.py @@ -76,5 +76,12 @@ class TableView(MasterView): TablesView = TableView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TableView = kwargs.get('TableView', base['TableView']) TableView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/taxes.py b/tailbone/views/taxes.py index 96a404c7..19a385ba 100644 --- a/tailbone/views/taxes.py +++ b/tailbone/views/taxes.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -64,5 +64,12 @@ class TaxView(MasterView): TaxesView = TaxView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TaxView = kwargs.get('TaxView', base['TaxView']) TaxView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/tempmon/appliances.py b/tailbone/views/tempmon/appliances.py index eeb22882..6b8ee036 100644 --- a/tailbone/views/tempmon/appliances.py +++ b/tailbone/views/tempmon/appliances.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2018 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -187,5 +187,12 @@ class TempmonApplianceView(MasterView): raise NotImplementedError("too many uploads?") -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TempmonApplianceView = kwargs.get('TempmonApplianceView', base['TempmonApplianceView']) TempmonApplianceView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/tempmon/clients.py b/tailbone/views/tempmon/clients.py index 1952c56d..a3fdb31b 100644 --- a/tailbone/views/tempmon/clients.py +++ b/tailbone/views/tempmon/clients.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -276,5 +276,12 @@ class TempmonClientView(MasterView): permission='{}.restart'.format(permission_prefix)) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TempmonClientView = kwargs.get('TempmonClientView', base['TempmonClientView']) TempmonClientView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/tempmon/dashboard.py b/tailbone/views/tempmon/dashboard.py index 321f8c83..954acf94 100644 --- a/tailbone/views/tempmon/dashboard.py +++ b/tailbone/views/tempmon/dashboard.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -158,5 +158,12 @@ class TempmonDashboardView(View): renderer='json') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TempmonDashboardView = kwargs.get('TempmonDashboardView', base['TempmonDashboardView']) TempmonDashboardView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/tempmon/probes.py b/tailbone/views/tempmon/probes.py index de0ca42d..218caafa 100644 --- a/tailbone/views/tempmon/probes.py +++ b/tailbone/views/tempmon/probes.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -344,5 +344,12 @@ class TempmonProbeView(MasterView): cls._defaults(config) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TempmonProbeView = kwargs.get('TempmonProbeView', base['TempmonProbeView']) TempmonProbeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/tempmon/readings.py b/tailbone/views/tempmon/readings.py index a9c6d2c2..a8223dd2 100644 --- a/tailbone/views/tempmon/readings.py +++ b/tailbone/views/tempmon/readings.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2018 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -125,5 +125,12 @@ class TempmonReadingView(MasterView): return tags.link_to(text, url) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TempmonReadingView = kwargs.get('TempmonReadingView', base['TempmonReadingView']) TempmonReadingView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/trainwreck/defaults.py b/tailbone/views/trainwreck/defaults.py index 68b08a42..85c61fae 100644 --- a/tailbone/views/trainwreck/defaults.py +++ b/tailbone/views/trainwreck/defaults.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -39,5 +39,12 @@ class TransactionView(base.TransactionView): model_row_class = trainwreck.TransactionItem -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + TransactionView = kwargs.get('TransactionView', base['TransactionView']) TransactionView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone/views/uoms.py b/tailbone/views/uoms.py index 964401f1..0b7b060f 100644 --- a/tailbone/views/uoms.py +++ b/tailbone/views/uoms.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -126,5 +126,12 @@ class UnitOfMeasureView(MasterView): permission='{}.collect_wild_uoms'.format(permission_prefix)) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + UnitOfMeasureView = kwargs.get('UnitOfMeasureView', base['UnitOfMeasureView']) UnitOfMeasureView.defaults(config) + + +def includeme(config): + defaults(config)