choices = django background color

10 views
Skip to first unread message

Jonathas Matos

unread,
Nov 20, 2021, 6:07:35 PM11/20/21
to Django users
Mudar condicionalmente a cor de fundo da célula no django admin

Olá Preciso retornar uma lista de opcões do mysql, cada uma com uma cor. 


models.py

STATUS_CHOICES = (
        ('Pendente', format_html('<span><style="background-color:#ffcccc">Pendente</span>')),
        ('AGuardando', format_html('<span><style="background-color:#aaffcc">Aguardando</span>')),
        ('Resolvido', format_html('<span><style="background-color:#dddddd">Resolvido</span>')),
    )
status = models.CharField(max_length=10, choices=STATUS_CHOICES, blank=False, null=False)


Alguém pode me ajudar?

Reply all
Reply to author
Forward
0 new messages