5
5
5etroff2014-03-24 18:04:22
Django
5etroff, 2014-03-24 18:04:22

Why does django_admin_log show the name of the field in the change_message field and not the value specified in verbose_name?

Hello.
There is a model, verbose_name is specified in the fields, the value from verbose_name is shown everywhere in the django administrative interface. And the name of the model fields is still indicated in django_admin_log. For example - "Id_location has been changed.", why is this happening and how can I specify that when acting on an object, not the name, but the value from verbose_name is indicated?

class Spr_location(models.Model):
    name = models.CharField(max_length=20, verbose_name=u'Местоположение')
    cdate = models.DateTimeField(blank=True, verbose_name=u'Дата')

    class Meta:
        verbose_name = (u'Справочник местоположений')
        verbose_name_plural = (u'Справочник местоположений')
    def __unicode__(self):
        return unicode(self.name)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2014-03-24
@mututunus

The name is taken from the django.contrib.contenttypes.ContentType model.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question