Answer the question
In order to leave comments, you need to log in
How to hide a field in the admin in Django?
There is a model:
class Article(models.Model):
title = models.CharField(verbose_name='Заголовок', max_length=100)
content = models.TextField(verbose_name='Контент')
date = models.DateField(verbose_name='Дата публикации')
image = models.ImageField(verbose_name='Изображение', blank=True, default='default.png')
short_description = models.CharField(verbose_name='Краткое описание',max_length=300)
tags = TaggableManager(verbose_name='Теги', blank=True)
hits = models.PositiveIntegerField()
def __str__(self):
return f"{self.title} {self.date}"
class Meta:
verbose_name = 'Статья'
verbose_name_plural = 'Статьи'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question