Skip to content

Commit

Permalink
feat(sample_project): example for MoreLessColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
gythaogg authored and b1rger committed Oct 14, 2024
1 parent 3d8ebc7 commit 8b0d40e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sample_project/tables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from apis_core.apis_entities.tables import AbstractEntityTable
from apis_core.generic.tables import MoreLessColumn


class PersonTable(AbstractEntityTable):
class Meta(AbstractEntityTable.Meta):
sequence = ["desc", "bio"]

# example column to show preview and detail
bio = MoreLessColumn(
orderable=False,
preview=lambda x: f"This is {x.surname}",
fulltext=lambda x: f"This is {x.surname}, {x.forename} {x.surname}.",
)

0 comments on commit 8b0d40e

Please sign in to comment.