Skip to content

Commit

Permalink
fix: allow usage of non-db fields
Browse files Browse the repository at this point in the history
  • Loading branch information
saemideluxe committed Jun 11, 2024
1 parent 64acd82 commit 289d62b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion basxbread/views/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def get_layout(self):
def get_helptext(f):
try:
return self.model._meta.get_field(field).help_text
except Exception:
return ""

return hg.DIV(
header(),
_layout.tile.Tile(
Expand All @@ -47,7 +53,7 @@ def get_layout(self):
hg.DIV(
_layout.ObjectFieldLabel(field),
_layout.forms.helpers.HelpText(
self.model._meta.get_field(field).help_text
get_helptext(field)
),
),
),
Expand Down

0 comments on commit 289d62b

Please sign in to comment.