Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,8 @@ def delete_all_items_in_container(db_name, container_name):
|
|
20 |
|
21 |
for item in container_client.read_all_items():
|
22 |
try:
|
23 |
-
|
|
|
24 |
st.write(f"Deleted Item: {item['id']}")
|
25 |
except CosmosResourceNotFoundError:
|
26 |
st.error(f"Item not found: {item['id']}")
|
@@ -47,7 +48,8 @@ def display_and_manage_cosmos_db():
|
|
47 |
|
48 |
# Update and Delete buttons for each item
|
49 |
if st.button(f"🗑️ Delete {item['id']}", key=f"delete_{item['id']}"):
|
50 |
-
|
|
|
51 |
st.success(f"Deleted Item: {item['id']}")
|
52 |
|
53 |
# Insert PNG Images with Unique Identifiers
|
|
|
20 |
|
21 |
for item in container_client.read_all_items():
|
22 |
try:
|
23 |
+
partition_key = '/id'
|
24 |
+
container_client.delete_item(item=item['id'], partition_key=partition_key)
|
25 |
st.write(f"Deleted Item: {item['id']}")
|
26 |
except CosmosResourceNotFoundError:
|
27 |
st.error(f"Item not found: {item['id']}")
|
|
|
48 |
|
49 |
# Update and Delete buttons for each item
|
50 |
if st.button(f"🗑️ Delete {item['id']}", key=f"delete_{item['id']}"):
|
51 |
+
partition_key = '/id'
|
52 |
+
container_client.delete_item(item=item['id'], partition_key)
|
53 |
st.success(f"Deleted Item: {item['id']}")
|
54 |
|
55 |
# Insert PNG Images with Unique Identifiers
|