set permissions to membership actions

This commit is contained in:
2025-05-29 14:42:23 +03:00
parent e30eb10d7d
commit be27f5ee97
3 changed files with 65 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ from django.dispatch import receiver
from transliterate import translit
from routes.constants.account_types import account_types
from django.contrib.auth.models import User
from routes.models import Route
class FAQ (models.Model):
title = models.CharField(max_length=250)
@@ -89,4 +90,17 @@ class Transactions(models.Model):
def __str__(self):
return f'{self.user} - {self.amount}'
class RoutePromotionLog(models.Model):
ACTION_CHOICES = [
('highlight', 'Выделение'),
('rising', 'Поднятие'),
]
route = models.ForeignKey(Route, on_delete=models.CASCADE, related_name='promotion_logs')
user = models.ForeignKey(User, on_delete=models.CASCADE)
action_type = models.CharField(max_length=20, choices=ACTION_CHOICES)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return f"{self.user} - {self.action_type} for route {self.route.id} at {self.created_at}"