Spaces:
Sleeping
Sleeping
Download remove_subcat.py from EliramShemesh/Spender: direct link, hf CLI and curl.
- Browser
- Download file 450 Bytes
-
https://huggingface.co/spaces/EliramShemesh/Spender/resolve/main/remove_subcat.py
- Command line
-
hf download hf://spaces/EliramShemesh/Spender/remove_subcat.py
-
curl -L -o remove_subcat.py https://huggingface.co/spaces/EliramShemesh/Spender/resolve/main/remove_subcat.py
450 Bytes
| from sqlmodel import Session, select | |
| from database import engine | |
| from models import SubCategory | |
| with Session(engine) as session: | |
| subcat = session.exec(select(SubCategory).where(SubCategory.name == "שכר עבודה 1")).first() | |
| if subcat: | |
| print("Found:", subcat.name, "ID:", subcat.id) | |
| session.delete(subcat) | |
| session.commit() | |
| print("Deleted!") | |
| else: | |
| print("No subcategory found with that name.") | |