管理者の「所有者」ログインを作成する必要があります。このモデル構造があるとします。
class Product(models.Model):
owner = models.ManyToManyField(User)
name = models.CharField(max_length=255)
description = models.CharField(max_length=255)
photos = models.ManyToManyField(Photo, through='ProductPhoto')
class Photo(models.Model):
order = models.IntegerField()
image = models.ImageField(upload_to='photos')
alt = models.CharField(max_length=255)
class ProductPhoto(models.Model):
photo = models.ForeignKey(Photo)
product = models.ForeignKey(Product)
Owners
一部のユーザーが参加しているというグループがあります。は管理ページにありProductPhoto
ます。TabularInline
Product
今、所有者は編集する許可が必要です
(主な目標) 製品のみ
product__in=user.products
(つまり、基本的には、それらが所有する製品のみ)。(二次目標) 商品の説明と写真のみ
Djangoの管理/許可システムでこれを行うにはどうすればよいですか?