From ab50de418a2a5c631f7a021e39a5a285cc4d8a05 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 11 Mar 2023 17:05:42 +0100 Subject: [PATCH] Display all project managers in the customers table --- src/customers/tables.py | 2 +- .../templates/customers/customer_details.html | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/customers/tables.py b/src/customers/tables.py index 8b66fa4..ed2b5f4 100644 --- a/src/customers/tables.py +++ b/src/customers/tables.py @@ -21,7 +21,7 @@ class CustomersTable(CoreTable): ) users = tables.LinkColumn("users", text="Users", args=[A("pk")], orderable=False) groups = tables.LinkColumn("groups", text="Groups", args=[A("pk")], orderable=False) - project_manager = tables.Column(verbose_name="Project Manager") + project_manager = tables.ManyToManyColumn(verbose_name="Project Manager") delete = tables.LinkColumn( "customer_delete", text="delete", diff --git a/src/customers/templates/customers/customer_details.html b/src/customers/templates/customers/customer_details.html index a730c2e..4e1f1cf 100644 --- a/src/customers/templates/customers/customer_details.html +++ b/src/customers/templates/customers/customer_details.html @@ -1,18 +1,23 @@ {% extends "core/base.html" %} -{% block section_title %}{{ customer.name }}{% endblock %} +{% block section_title %}Customer Details{% endblock %} {% block content %}
-
+

{{ customer.name }}

Description

{{ customer.description }}

Project Manager

-

{{ customer.project_manager }}

+

+

    + {% for pm in customer.project_manager.all %} +
  • {{ pm }}
  • + {% endfor %} +
+

-
{% endblock %}