working order by, refactor models merging, refactors ordering into dict

This commit is contained in:
collerek
2020-11-09 12:45:32 +01:00
parent 9f4bde595f
commit ca38f7853e
7 changed files with 259 additions and 37 deletions

View File

@ -37,10 +37,7 @@ class Model(NewBaseModel):
objects: "QuerySet"
def __repr__(self) -> str: # pragma nocover
attrs_to_include = ["tablename", "columns", "pkname"]
_repr = {k: v for k, v in self.Meta.model_fields.items()}
for atr in attrs_to_include:
_repr[atr] = getattr(self.Meta, atr)
_repr = {k: getattr(self, k) for k, v in self.Meta.model_fields.items()}
return f"{self.__class__.__name__}({str(_repr)})"
@classmethod