Skip to content

Commit

Permalink
57 change standard view of table tablets (#61)
Browse files Browse the repository at this point in the history
* new init cols for Tablet table

* linting
  • Loading branch information
csae8092 authored Nov 20, 2024
1 parent 14df211 commit 07c61b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
28 changes: 16 additions & 12 deletions archiv/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Meta:
"archiv",
"description",
)
attrs = {"class": "table table-responsive table-hover"}


class ArchivTable(tables.Table):
Expand All @@ -33,7 +32,6 @@ class Meta:
"alt_name",
"part_of",
)
attrs = {"class": "table table-responsive table-hover"}


class BibliographyTable(tables.Table):
Expand All @@ -52,7 +50,6 @@ class Meta:
"title",
"short_title",
)
attrs = {"class": "table table-responsive table-hover"}


class GlossaryTable(tables.Table):
Expand All @@ -63,7 +60,6 @@ class GlossaryTable(tables.Table):
class Meta:
model = Glossary
sequence = ("pref_label",)
attrs = {"class": "table table-responsive table-hover"}


class PlaceTable(tables.Table):
Expand All @@ -74,19 +70,27 @@ class PlaceTable(tables.Table):
class Meta:
model = Place
sequence = ("name",)
attrs = {"class": "table table-responsive table-hover"}


class TabletTable(tables.Table):

id = tables.LinkColumn(verbose_name="ID")
museum_id = tables.LinkColumn(verbose_name="Museum No.")
merge = MergeColumn(verbose_name="keep | remove", accessor="pk")
mentioned_place = tables.columns.ManyToManyColumn()
key_word = tables.columns.ManyToManyColumn()
mentioned_archiv = tables.columns.ManyToManyColumn()
mentioned_in_pub = tables.columns.ManyToManyColumn()
mentioned_place = tables.columns.ManyToManyColumn(
verbose_name="Place mentioned on Tablet"
)
mentioned_archiv = tables.columns.ManyToManyColumn(
verbose_name="Archiv mentioned on Tablet"
)
mentioned_in_pub = tables.columns.ManyToManyColumn(
verbose_name="Mentioned in Publication"
)

class Meta:
model = Tablet
sequence = ("id",)
attrs = {"class": "table table-responsive table-hover"}
sequence = (
"id",
"publication_name",
"text_number",
"period",
)
2 changes: 1 addition & 1 deletion archiv/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class TabletListView(GenericListView):
filter_class = TabletListFilter
formhelper_class = TabletFilterFormHelper
table_class = TabletTable
init_columns = ["museum_id", "archiv", "type_content", "place_of_issue"]
init_columns = ["id", "publication_name", "text_number", "period"]
enable_merge = True


Expand Down

0 comments on commit 07c61b0

Please sign in to comment.