Skip to content

Commit

Permalink
refactor: use model verbose names in property table
Browse files Browse the repository at this point in the history
Switch from class name to verbose name + capitalise strings
instead of title-casing them.
  • Loading branch information
koeaw authored and b1rger committed Jan 19, 2024
1 parent a6fba0f commit dae1a54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apis_core/apis_relations/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PropertyTable(tables.Table):
"model"
), # order retrieved objects within table cell
# use .name for model verbose name, .model for model class name
transform=lambda ent: f"{ent.model.title()}",
transform=lambda ent: f"{ent.name.capitalize()}",
linkify_item={
"viewname": "apis_core:apis_entities:generic_entities_list",
"args": [tables.A("model")],
Expand All @@ -86,7 +86,7 @@ class PropertyTable(tables.Table):
"model"
), # order retrieved objects within table cell
# use .name for model verbose name, .model for model class name
transform=lambda ent: f"{ent.model.title()}",
transform=lambda ent: f"{ent.name.capitalize()}",
linkify_item={
"viewname": "apis_core:apis_entities:generic_entities_list",
"args": [tables.A("model")],
Expand Down

0 comments on commit dae1a54

Please sign in to comment.