mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-11-14 12:27: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,17 +32,17 @@ 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)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue