mirror of
https://github.com/jointakahe/takahe.git
synced 2024-12-27 15:40:29 +00:00
22 lines
559 B
Python
22 lines
559 B
Python
from django.db import models
|
|
|
|
|
|
class UserEvent(models.Model):
|
|
"""
|
|
Tracks major events that happen to users
|
|
"""
|
|
|
|
class EventType(models.TextChoices):
|
|
created = "created"
|
|
reset_password = "reset_password"
|
|
banned = "banned"
|
|
|
|
user = models.ForeignKey(
|
|
"users.User",
|
|
on_delete=models.CASCADE,
|
|
related_name="events",
|
|
)
|
|
|
|
date = models.DateTimeField(auto_now_add=True)
|
|
type = models.CharField(max_length=100, choices=EventType.choices)
|
|
data = models.JSONField(blank=True, null=True)
|