aboutsummaryrefslogtreecommitdiffstats
path: root/api/models.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-11-18 21:13:47 +0100
committerGravatar Johannes Christ <[email protected]>2018-11-18 21:13:47 +0100
commit9ac6157ba2b9f86598eede69df7b67fa320f95b2 (patch)
tree0ce8f8ff3a372b65bbe29a72af61e51bd2731806 /api/models.py
parentAdd the abstract `Message` model. (diff)
Add the `MessageDeletionContext` model.
Diffstat (limited to 'api/models.py')
-rw-r--r--api/models.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/api/models.py b/api/models.py
index 3ba0ac5c..bb3489d0 100644
--- a/api/models.py
+++ b/api/models.py
@@ -241,6 +241,25 @@ class Message(ModelReprMixin, models.Model):
abstract = True
+class MessageDeletionContext(ModelReprMixin, models.Model):
+ actor = models.ForeignKey(
+ Member,
+ on_delete=models.CASCADE,
+ help_text=(
+ "The original actor causing this deletion. Could be the author "
+ "of a manual clean command invocation, the bot when executing "
+ "automatic actions, or nothing to indicate that the bulk "
+ "deletion was not issued by us."
+ ),
+ null=True
+ )
+ creation = models.DateTimeField(
+ # Consider whether we want to add a validator here that ensures
+ # the deletion context does not take place in the future.
+ help_text="When this deletion took place."
+ )
+
+
class Tag(ModelReprMixin, models.Model):
"""A tag providing (hopefully) useful information."""