mirror of
https://github.com/onyx-dot-app/onyx.git
synced 2026-10-22 11:22:49 -05:00
10 lines
245 B
Python
10 lines
245 B
Python
from typing import Any
|
|
|
|
from sqlalchemy import inspect
|
|
|
|
from danswer.db.models import Base
|
|
|
|
|
|
def model_to_dict(model: Base) -> dict[str, Any]:
|
|
return {c.key: getattr(model, c.key) for c in inspect(model).mapper.column_attrs} # type: ignore
|