After changing the model, the admin panel stopped showing the model fields. That is, they are shown in the general list, and when opening any particular model, just an empty admin window with “delete”, “save”, etc. buttons. Changes in the model are also quite simple: deleted the TextField field, added the ForeignKey field. Migrations made, in admin.py mention of the old field was also deleted.
The model code and the corresponding model in the admin panel are listed below.
class DocumentModel(models.Model): title = models.CharField(max_length=100, db_index=True) url_address = models.CharField(max_length=255, blank=True, null=True, db_index=True) text_document = models.ForeignKey(DocumentTextModel, blank=True, null=True, verbose_name=u'Контент', db_index=True) #text_doc = models.TextField(blank=True, null=True, verbose_name=u'Контент') visible_left = models.BooleanField(verbose_name=u'Левый столбец', db_index=True) visible_right = models.BooleanField(default=True, verbose_name=u'Правый столбец', db_index=True) visible_middle = models.BooleanField(default=True, verbose_name=u'Центр главной страницы', db_index=True) changedate = models.DateTimeField(auto_now=True, verbose_name=u'Дата изменения', db_index=True) class DocumentAdminModel(admin.ModelAdmin): ordering = ['changedate'] list_display = ('title', 'changedate', ) list_filter = ('changedate') # resize CharField in Form formfield_overrides = { # Django enforces maximum field length of 14 onto 'title' field when user is editing in the change form models.CharField: {'widget': forms.TextInput(attrs={'size':'300'})}, } # search in model search_fields = ['title', ] 