From 86417df098af48336775059bb84a6880d391c46f Mon Sep 17 00:00:00 2001 From: Wolfgang Fahl Date: Thu, 6 Jun 2024 19:38:42 -0600 Subject: [PATCH] improves wikidata sync --- ceurws/view.py | 2 +- ceurws/wikidata_view.py | 11 +++++------ pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ceurws/view.py b/ceurws/view.py index 279a033..43e8565 100644 --- a/ceurws/view.py +++ b/ceurws/view.py @@ -76,7 +76,7 @@ def createExternalLink( str - html link for external id """ value = self.getRowValue(row, key) - if not value: + if not value or value==View.noneValue: if emptyIfNone: return "" else: diff --git a/ceurws/wikidata_view.py b/ceurws/wikidata_view.py index f44d3ba..4b832f4 100644 --- a/ceurws/wikidata_view.py +++ b/ceurws/wikidata_view.py @@ -70,13 +70,12 @@ def reload_aggrid(self, olod: list): itemLink = self.createItemLink(row, "item") eventLink = self.createItemLink(row, "event", separator="|") eventSeriesLink = self.createItemLink(row, "eventSeries", separator="|") - dblpLink = self.createExternalLink(row, "dblpProceedingsId", "dblp", DblpEndpoint.DBLP_REC_PREFIX, emptyIfNone=True) + dblpLink = self.createExternalLink(row, "dblpProceedingsId", "dblp", DblpEndpoint.DBLP_REC_PREFIX) k10PlusLink = self.createExternalLink( row, "ppnId", "k10plus", - "https://opac.k10plus.de/DB=2.299/PPNSET?PPN=", - emptyIfNone=True + "https://opac.k10plus.de/DB=2.299/PPNSET?PPN=" ) lod.append( { @@ -93,9 +92,9 @@ def reload_aggrid(self, olod: list): } ) self.lod_grid.load_lod(lod) - for col_def in self.lod_grid.ag_grid.options["columnDefs"]: - if col_def["field"] == "Item": # Identify the "Title" column - col_def["maxWidth"] = 350 # width in pixels + # set max width of Item column + self.lod_grid.set_column_def("item","maxWidth",380) + self.lod_grid.set_column_def("event","maxWidth",380) self.lod_grid.sizeColumnsToFit() async def on_refresh_button_click(self): diff --git a/pyproject.toml b/pyproject.toml index a3b4a4e..016d3f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ dependencies = [ # https://pypi.org/project/neo4j/ 'neo4j', # https://github.com/WolfgangFahl/nicegui_widgets - 'ngwidgets>=0.12.5', + 'ngwidgets>=0.15.2', # https://pypi.org/project/sqlmodel/ 'sqlmodel>=0.0.16', # https://pypi.org/project/wdgrid/