From 1f4beeb10ccec010aa2d503ed73b4b64e9c1895f Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Tue, 14 Jul 2020 14:21:16 +0200 Subject: Rename utils.py to mixins.py. More precise. https://github.com/python-discord/site/issues/305 --- pydis_site/apps/api/models/utils.py | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 pydis_site/apps/api/models/utils.py (limited to 'pydis_site/apps/api/models/utils.py') diff --git a/pydis_site/apps/api/models/utils.py b/pydis_site/apps/api/models/utils.py deleted file mode 100644 index 0540c4de..00000000 --- a/pydis_site/apps/api/models/utils.py +++ /dev/null @@ -1,17 +0,0 @@ -from operator import itemgetter - - -class ModelReprMixin: - """Mixin providing a `__repr__()` to display model class name and initialisation parameters.""" - - def __repr__(self): - """Returns the current model class name and initialisation parameters.""" - attributes = ' '.join( - f'{attribute}={value!r}' - for attribute, value in sorted( - self.__dict__.items(), - key=itemgetter(0) - ) - if not attribute.startswith('_') - ) - return f'<{self.__class__.__name__}({attributes})>' -- cgit v1.2.3