mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-16 05:10:31 +02:00
Adjusted files for isort & autopep
This commit is contained in:
committed by
github-actions[bot]
parent
910638e3a6
commit
c903266ec4
@@ -59,8 +59,7 @@ def get_object_or_404(
|
|||||||
if hasattr(row, "_mapping"):
|
if hasattr(row, "_mapping"):
|
||||||
obj_dict = dict(row._mapping)
|
obj_dict = dict(row._mapping)
|
||||||
else:
|
else:
|
||||||
obj_dict = {column.key: getattr(row, column.key)
|
obj_dict = {column.key: getattr(row, column.key) for column in selected_columns}
|
||||||
for column in selected_columns}
|
|
||||||
else:
|
else:
|
||||||
query = select(db_class).where(getattr(db_class, lookup_column) == id)
|
query = select(db_class).where(getattr(db_class, lookup_column) == id)
|
||||||
result = await db.execute(query)
|
result = await db.execute(query)
|
||||||
@@ -69,8 +68,7 @@ def get_object_or_404(
|
|||||||
if row is None:
|
if row is None:
|
||||||
raise HTTPException(status_code=404, detail="The object does not exist.")
|
raise HTTPException(status_code=404, detail="The object does not exist.")
|
||||||
|
|
||||||
obj_dict = {k: v for k, v in row.__dict__.items()
|
obj_dict = {k: v for k, v in row.__dict__.items() if not k.startswith("_")}
|
||||||
if not k.startswith('_')}
|
|
||||||
if expunge:
|
if expunge:
|
||||||
await db.expunge(obj_dict)
|
await db.expunge(obj_dict)
|
||||||
return obj_dict
|
return obj_dict
|
||||||
|
|||||||
Reference in New Issue
Block a user