aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/models/utils.py
diff options
context:
space:
mode:
authorGravatar SebastiaanZ <[email protected]>2019-04-25 20:37:42 +0200
committerGravatar SebastiaanZ <[email protected]>2019-04-25 20:37:42 +0200
commit3ddff3f1b3ccb2e023859a64c1f453b5916d1755 (patch)
tree92b156f9cccae71e8c79ed2c356fcd40fc9e4d1b /pydis_site/apps/api/models/utils.py
parentAdding initial tests for nomination endpoint (diff)
parentMerge pull request #215 from gdude2002/django+192/flake8-docstrings (diff)
Resolving merge conflict with master
Diffstat (limited to 'pydis_site/apps/api/models/utils.py')
-rw-r--r--pydis_site/apps/api/models/utils.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/pydis_site/apps/api/models/utils.py b/pydis_site/apps/api/models/utils.py
index 731486e7..8f590392 100644
--- a/pydis_site/apps/api/models/utils.py
+++ b/pydis_site/apps/api/models/utils.py
@@ -2,13 +2,11 @@ from operator import itemgetter
class ModelReprMixin:
- """
- Adds a `__repr__` method to the model subclassing this
- mixin which will display the model's class name along
- with all parameters used to construct the object.
- """
+ """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(