Use new config syntax for all Harvest views

This commit is contained in:
Lance Edgar 2022-03-03 19:33:01 -06:00
parent cc48cf5013
commit f3e05124c3
5 changed files with 40 additions and 5 deletions

View file

@ -85,5 +85,12 @@ class HarvestClientView(HarvestMasterView):
return HTML.tag('ul', c=items) return HTML.tag('ul', c=items)
def includeme(config): def defaults(config, **kwargs):
base = globals()
HarvestClientView = kwargs.get('HarvestClientView', base['HarvestClientView'])
HarvestClientView.defaults(config) HarvestClientView.defaults(config)
def includeme(config):
defaults(config)

View file

@ -113,5 +113,12 @@ class HarvestProjectView(HarvestMasterView):
return entry.project return entry.project
def includeme(config): def defaults(config, **kwargs):
base = globals()
HarvestProjectView = kwargs.get('HarvestProjectView', base['HarvestProjectView'])
HarvestProjectView.defaults(config) HarvestProjectView.defaults(config)
def includeme(config):
defaults(config)

View file

@ -61,5 +61,12 @@ class HarvestTaskView(HarvestMasterView):
f.remove_field('time_entries') f.remove_field('time_entries')
def includeme(config): def defaults(config, **kwargs):
base = globals()
HarvestTaskView = kwargs.get('HarvestTaskView', base['HarvestTaskView'])
HarvestTaskView.defaults(config) HarvestTaskView.defaults(config)
def includeme(config):
defaults(config)

View file

@ -61,5 +61,12 @@ class HarvestTimeEntryView(HarvestMasterView):
g.set_link('notes') g.set_link('notes')
def includeme(config): def defaults(config, **kwargs):
base = globals()
HarvestTimeEntryView = kwargs.get('HarvestTimeEntryView', base['HarvestTimeEntryView'])
HarvestTimeEntryView.defaults(config) HarvestTimeEntryView.defaults(config)
def includeme(config):
defaults(config)

View file

@ -106,5 +106,12 @@ class HarvestUserView(HarvestMasterView):
raise colander.Invalid(node, "Person not found (you must *select* a record)") 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) HarvestUserView.defaults(config)
def includeme(config):
defaults(config)