Answer the question
In order to leave comments, you need to log in
How to restrict user access to models.py model entries in the admin panel?
Wrote a model where you can add companies and information about them.
class Company(models.Model):
name = models.CharField("Название компании", max_length = 80)
city = models.CharField("Город", max_length = 80)
background = models.ImageField("Фон", upload_to="annex/img/%Y/%m/%d", default='')
def __str__(self):
return self.name
return self.city
class Meta:
verbose_name = "Все компании"
verbose_name_plural = "Все компании"
Answer the question
In order to leave comments, you need to log in
How to restrict user access to model entries
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question