From 3fde80f9918675476f1627f15b288e8bc33ca020 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 7 Jun 2023 16:27:10 -0500 Subject: [PATCH] Add basic support for exposing `Customer.shoppers` now there is a Shoppers field when viewing a Customer, unless configured otherwise also tweaked some logic for navigating Customer/Person relationships, to handle implications of Shoppers being (maybe) present --- tailbone/templates/customers/configure.mako | 22 ++- tailbone/templates/customers/view.mako | 9 +- tailbone/views/customers.py | 159 ++++++++++++++++---- tailbone/views/master.py | 2 +- tailbone/views/people.py | 55 +++++-- 5 files changed, 201 insertions(+), 46 deletions(-) diff --git a/tailbone/templates/customers/configure.mako b/tailbone/templates/customers/configure.mako index 708d0b17..9013bd5b 100644 --- a/tailbone/templates/customers/configure.mako +++ b/tailbone/templates/customers/configure.mako @@ -26,12 +26,30 @@ - + + + Show the Shoppers field + + + + + + Show the People field + + + + - Show customer chooser as dropdown (select) element + Use dropdown (select element) for Customer chooser diff --git a/tailbone/templates/customers/view.mako b/tailbone/templates/customers/view.mako index e35cc635..85ec0055 100644 --- a/tailbone/templates/customers/view.mako +++ b/tailbone/templates/customers/view.mako @@ -4,8 +4,8 @@ <%def name="object_helpers()"> ${parent.object_helpers()} - % if show_profiles_helper and instance.people: - ${view_profiles_helper(instance.people)} + % if show_profiles_helper and show_profiles_people: + ${view_profiles_helper(show_profiles_people)} % endif @@ -20,7 +20,12 @@ ${parent.modify_this_page_vars()}