'Django - Display in inline random info without relation to any model

Imagine there is a model:

class OrgUnit(models.Model):
    name = models.CharField(...)
    type = models.CharField(...)
    address = models.TextField(...)
    active = models.BooleanField(...)
    sapid = models.CharField(...)
    parent = models.ForeignKey('self', ...)

Register it in admin:

@admin.register(OrgUnit)
class OrgUnitAdmin(admin.ModelAdmin):
    pass

Usually in inline displayed some queryset. But I need to display an errors list (python list). That errors look like validation checks. The list example: ['No orgunit name', 'No orgunit type']. The errors can be related not only to OrgUnit model. No foreign key, no relations at all.

How could I do that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source