mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-04 22:37:15 +08:00
15 lines
315 B
Python
15 lines
315 B
Python
from sqlalchemy.orm import declarative_base
|
|
|
|
Base = declarative_base()
|
|
|
|
|
|
def to_dict(obj):
|
|
fields = obj.__table__.columns.keys()
|
|
return {
|
|
field: (val.to_dict() if hasattr(val, "to_dict") else val)
|
|
for field in fields
|
|
if (val := getattr(obj, field))
|
|
}
|
|
|
|
# TODO: Define models here
|