Django: overriding verbose_name for AutoField without dropping a model

I am using the 0.97-pre-SVN-unknown Django release.

I have a model for which I did not give any primary_key. Consequently, Django automatically provides an AutoField called id. Everything is fine with this. But now I have to change the "verbose_name" of this AutoField to something other than the "id". I can not redefine the "id" field in the usual way, since for this it will be necessary to reset / reset the entire model and its data (which is strictly not an option). I can not find another way. Does what I want to do even achieve? If you can offer any alternatives that will deliver me with what I want without dropping the model / table, I would be happy.

Many thanks.

+3
source share
2 answers

... ? , :

class Entry(models.Model):
   id = models.AutoField(verbose_name="custom name")
   # and other fields...

- .

+4

manage.py; JSON JSON. , , . , db_column 'id', .

. , dumpdata loaddata.

+2

Source: https://habr.com/ru/post/1699053/


All Articles