How to restrict user access to records model models.py in the admin panel?

0 like 0 dislike
9 views
Wrote a model where you can add companies and information about them.
class Company(models.Model): name = models.CharField("company Name", max_length = 80) city = models.CharField("City", max_length = 80) background = models.ImageField("Background", upload_to="annex/img/%Y/%m/%d", default=") def __str__(self): return self.name return self.city class Meta: verbose_name = "All companies" verbose_name_plural = "All companies"

5ae1ce8cecbce761148170.pngPlease help, how can I make it so that depending on the authenticated user, in this model, only display the corresponding record ?
5ae1cef96685f996877379.png
by | 9 views

2 Answers

0 like 0 dislike
How to restrict user access to records model


Controller.
by
0 like 0 dislike
Beginners must often to the docks to look https://docs.djangoproject.com/en/2.0/ref/contrib/...
However you have in the model there is no information about whom the record belongs.
by

Related questions

0 like 0 dislike
3 answers
asked May 22, 2019 by google_online
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,944 users