Django render field json in template
i'm doing a project using the Django 3.1.2, this project needs a register logs.
I created a model for logs:
class Log(models.Model):
Usuario = models.CharField('Usuário que fez a ação', max_length=100)
Perfil = models.SmallIntegerField(
'Quem está sofrendo a ação', choices=PERFIL_CHOICE)
Acao = models.CharField('Tipo de Ação Realizada',
max_length=2, choices=ACAO_CHOICE)
Resultado = models.JSONField('Resultado', null=True, blank=True)
Processando = models.BooleanField('Processando', default=True)
TituloProcesso = models.CharField(
"Titulo do Processo", max_length=100, null=True, blank=True)
DataAcao = models.DateTimeField('Data da Ação', auto_now_add=True)
The model log has field "Resultado" that is of type JSONField, this field is working correctly.
The data that is save in the field, is dynamic, so the json keys and values will not always be the same, so i needed it easier to dysplay this field in template.
I was looking the "django-jsonfiel", not work in Django 3.1
Does anyone know any way to display this field already formatted dynamically?