/
oriono
/
taskman
Обзор
Документация
Войти
/
oriono
/
taskman
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
task_manager/labels/models.py
47 строк
1 KB
Abo
Implement soft delete for user accounts
08 мар 2026, 23:12
08 мар 2026, 23:12
5768dd2
Код
Авторство
О чём код?
import uuid from django.db import models from task_manager.user.models import User from django.core.validators import RegexValidator from django.utils.translation import gettext_lazy as _ class Label(models.Model): id = models.AutoField(primary_key=True) uuid = models.UUIDField( default=uuid.uuid4, unique=True, editable=False, db_index=True ) name = models.CharField( max_length=24, unique=False, validators=[ RegexValidator( r'^[\w \-:,.!?]+$', message=_( "Only letters, numbers, spaces, " "and -_.,!? symbols are allowed. " "Symbols <, >, #, & are not allowed." ) ), ], ) team = models.ForeignKey( 'teams.Team', on_delete=models.CASCADE, null=True, blank=True, related_name='labels' ) creator = models.ForeignKey( User, on_delete=models.SET_NULL, null=True, related_name='created_labels' ) created_at = models.DateTimeField(auto_now_add=True) def __str__(self): return self.name