Fix get_df with no related fields

This commit is contained in:
phil 2024-05-07 00:29:26 +02:00
parent 2ea672293d
commit 50920059b6

View file

@ -106,6 +106,7 @@ class BaseModel(SQLModel):
## Chamge column names to reflect the joined tables
## Leave the first columns unchanged, as their names come straight
## from the model's fields
if with_related:
joined_columns = list(df.columns[len(cls.model_fields):])
renames: dict[str, str] = {}
# Match colum names with the joined tables