From 42103dfbf6bdfd49d3042462413595d3d34d6850 Mon Sep 17 00:00:00 2001 From: redxef Date: Tue, 6 Dec 2022 18:56:06 +0100 Subject: [PATCH] Implement upload of collection (with preexisting items). --- radicale_sql/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/radicale_sql/__init__.py b/radicale_sql/__init__.py index 92e935c..66da14c 100644 --- a/radicale_sql/__init__.py +++ b/radicale_sql/__init__.py @@ -581,10 +581,11 @@ class Storage(BaseStorage): collection_metadata_table, ).values([dict(collection_id=parent_id, key=k, value=v) for k, v in props.items()]) connection.execute(insert_stmt) - if props is not None and 'key' in props and items is not None: - print(items) - # TODO insert items c = Collection(self, parent_id, '/'.join(path)) + if props is not None and 'key' in props and items is not None: + for i in items: + assert i.href is not None + c._upload(i.href, i, connection=connection) return c def create_collection(