From 1f8bf0270883fd9473f906c8566848dbb6ba1aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Cant=C3=B9?= Date: Fri, 25 Oct 2024 14:29:35 +0200 Subject: [PATCH] add links for orders without name --- src/genlab_bestilling/tables.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/genlab_bestilling/tables.py b/src/genlab_bestilling/tables.py index 2e4833a..19fa52d 100644 --- a/src/genlab_bestilling/tables.py +++ b/src/genlab_bestilling/tables.py @@ -5,17 +5,27 @@ class OrderTable(tables.Table): polymorphic_ctype = tables.Column(verbose_name="Type") - name = tables.Column(linkify=True) + id = tables.Column(linkify=True, orderable=False, empty_values=()) class Meta: model = Order fields = ("name", "status", "polymorphic_ctype", "species", "sample_types") - + sequence = ( + "id", + "name", + "status", + "polymorphic_ctype", + "species", + "sample_types", + ) empty_text = "No Orders" def render_polymorphic_ctype(self, value): return value.name + def render_id(self, record): + return str(record) + class GenrequestTable(tables.Table): project_id = tables.Column(linkify=True)