Implement upload of collection (with preexisting items).

This commit is contained in:
redxef 2022-12-06 18:56:06 +01:00
parent 464e7b5c05
commit 42103dfbf6
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -581,10 +581,11 @@ class Storage(BaseStorage):
collection_metadata_table, collection_metadata_table,
).values([dict(collection_id=parent_id, key=k, value=v) for k, v in props.items()]) ).values([dict(collection_id=parent_id, key=k, value=v) for k, v in props.items()])
connection.execute(insert_stmt) 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)) 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 return c
def create_collection( def create_collection(