From f3e05124c393f6bfe2a5494481c903e727d94332 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 3 Mar 2022 19:33:01 -0600 Subject: [PATCH] Use new config syntax for all Harvest views --- tailbone_harvest/views/harvest/clients.py | 9 ++++++++- tailbone_harvest/views/harvest/projects.py | 9 ++++++++- tailbone_harvest/views/harvest/tasks.py | 9 ++++++++- tailbone_harvest/views/harvest/time_entries.py | 9 ++++++++- tailbone_harvest/views/harvest/users.py | 9 ++++++++- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/tailbone_harvest/views/harvest/clients.py b/tailbone_harvest/views/harvest/clients.py index 58fe842..08d39c7 100644 --- a/tailbone_harvest/views/harvest/clients.py +++ b/tailbone_harvest/views/harvest/clients.py @@ -85,5 +85,12 @@ class HarvestClientView(HarvestMasterView): return HTML.tag('ul', c=items) -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + HarvestClientView = kwargs.get('HarvestClientView', base['HarvestClientView']) HarvestClientView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_harvest/views/harvest/projects.py b/tailbone_harvest/views/harvest/projects.py index 6e8f5de..bf02fcc 100644 --- a/tailbone_harvest/views/harvest/projects.py +++ b/tailbone_harvest/views/harvest/projects.py @@ -113,5 +113,12 @@ class HarvestProjectView(HarvestMasterView): return entry.project -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + HarvestProjectView = kwargs.get('HarvestProjectView', base['HarvestProjectView']) HarvestProjectView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_harvest/views/harvest/tasks.py b/tailbone_harvest/views/harvest/tasks.py index a3b61b4..0bdf7af 100644 --- a/tailbone_harvest/views/harvest/tasks.py +++ b/tailbone_harvest/views/harvest/tasks.py @@ -61,5 +61,12 @@ class HarvestTaskView(HarvestMasterView): f.remove_field('time_entries') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + HarvestTaskView = kwargs.get('HarvestTaskView', base['HarvestTaskView']) HarvestTaskView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_harvest/views/harvest/time_entries.py b/tailbone_harvest/views/harvest/time_entries.py index 8001fab..5a3a746 100644 --- a/tailbone_harvest/views/harvest/time_entries.py +++ b/tailbone_harvest/views/harvest/time_entries.py @@ -61,5 +61,12 @@ class HarvestTimeEntryView(HarvestMasterView): g.set_link('notes') -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + HarvestTimeEntryView = kwargs.get('HarvestTimeEntryView', base['HarvestTimeEntryView']) HarvestTimeEntryView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/tailbone_harvest/views/harvest/users.py b/tailbone_harvest/views/harvest/users.py index 5fcc3ff..16a0ca0 100644 --- a/tailbone_harvest/views/harvest/users.py +++ b/tailbone_harvest/views/harvest/users.py @@ -106,5 +106,12 @@ class HarvestUserView(HarvestMasterView): raise colander.Invalid(node, "Person not found (you must *select* a record)") -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + HarvestUserView = kwargs.get('HarvestUserView', base['HarvestUserView']) HarvestUserView.defaults(config) + + +def includeme(config): + defaults(config)