Skip to content

Commit

Permalink
add links for orders without name
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Oct 25, 2024
1 parent 410715e commit 1f8bf02
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/genlab_bestilling/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1f8bf02

Please sign in to comment.