mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-11-13 20:07:28 +03:00
elif => if (return statement before elif)
This commit is contained in:
parent
cabc848cb8
commit
95c6713586
1 changed files with 5 additions and 5 deletions
|
@ -32,18 +32,18 @@ def to_dict_without_none(model):
|
||||||
|
|
||||||
return dict(result)
|
return dict(result)
|
||||||
|
|
||||||
elif isinstance(model, tuple) and hasattr(model, "_fields"):
|
if isinstance(model, tuple) and hasattr(model, "_fields"):
|
||||||
return type(model)(*[to_dict_without_none(v) for v in model])
|
return type(model)(*[to_dict_without_none(v) for v in model])
|
||||||
|
|
||||||
elif isinstance(model, (list, tuple)):
|
if isinstance(model, (list, tuple)):
|
||||||
return type(model)(to_dict_without_none(v) for v in model)
|
return type(model)(to_dict_without_none(v) for v in model)
|
||||||
|
|
||||||
elif isinstance(model, dict):
|
if isinstance(model, dict):
|
||||||
return type(model)(
|
return type(model)(
|
||||||
(to_dict_without_none(k), to_dict_without_none(v)) for k, v in model.items()
|
(to_dict_without_none(k), to_dict_without_none(v)) for k, v in model.items()
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
return copy.deepcopy(model)
|
return copy.deepcopy(model)
|
||||||
|
|
||||||
|
|
||||||
class APIModelBase:
|
class APIModelBase:
|
||||||
|
|
Loading…
Reference in a new issue