deleteduser.py 599 B

123456789101112131415161718192021
  1. from django.db import models
  2. from django.utils import timezone
  3. from django.utils.translation import gettext_lazy as _
  4. class DeletedUser(models.Model):
  5. DELETED_BY_SELF = 1
  6. DELETED_BY_STAFF = 2
  7. DELETED_BY_SYSTEM = 3
  8. DELETED_BY_CHOICES = (
  9. (DELETED_BY_SELF, _("By self")),
  10. (DELETED_BY_STAFF, _("By staff")),
  11. (DELETED_BY_SYSTEM, _("By system")),
  12. )
  13. deleted_on = models.DateTimeField(default=timezone.now, db_index=True)
  14. deleted_by = models.PositiveIntegerField(choices=DELETED_BY_CHOICES, db_index=True)
  15. class Meta:
  16. ordering = ["-id"]