Fix get_df with no related fields
This commit is contained in:
parent
2ea672293d
commit
50920059b6
1 changed files with 15 additions and 14 deletions
|
@ -106,6 +106,7 @@ class BaseModel(SQLModel):
|
||||||
## Chamge column names to reflect the joined tables
|
## Chamge column names to reflect the joined tables
|
||||||
## Leave the first columns unchanged, as their names come straight
|
## Leave the first columns unchanged, as their names come straight
|
||||||
## from the model's fields
|
## from the model's fields
|
||||||
|
if with_related:
|
||||||
joined_columns = list(df.columns[len(cls.model_fields):])
|
joined_columns = list(df.columns[len(cls.model_fields):])
|
||||||
renames: dict[str, str] = {}
|
renames: dict[str, str] = {}
|
||||||
# Match colum names with the joined tables
|
# Match colum names with the joined tables
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue