From 2024132105fd0f25349e1667a3a5e4f9c9ba984f Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Fri, 22 Nov 2024 10:54:20 -0700 Subject: [PATCH] delete library directly --- buildingmotif/dataclasses/library.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buildingmotif/dataclasses/library.py b/buildingmotif/dataclasses/library.py index c3994258..73c678f7 100644 --- a/buildingmotif/dataclasses/library.py +++ b/buildingmotif/dataclasses/library.py @@ -130,9 +130,10 @@ def _clear_library(cls, library: DBLibrary) -> None: :type library: DBLibrary """ bm = get_building_motif() - for template in library.templates: # type: ignore - bm.session.delete(template) - bm.session.commit() + bm.table_connection.delete_db_library(library.id) + #for template in library.templates: # type: ignore + # bm.session.delete(template) + #bm.session.commit() # TODO: load library from URI? Does the URI identify the library uniquely? # TODO: can we deduplicate shape graphs? use hash of graph?