I have two model's ,
Model1
class Model1(models.Model):
........
Model2
class Model2(models.Model):
model1 = models.ForeignKey(Model1, related_name='Model1Objects',on_delete=models.CASCADE)
......
Model1.admin
class Model2Inline(admin.StackedInline):
model = Model2
form = Model2Form
extra = 0
max_num = 3
class Model1Admin(admin.ModelAdmin):
form = Model1Form
model = Model1
inlines = [Model1Inline]
In the django permissions I created a group where they can only see what is happening in model1 and being able to edit the model2. Whenever I try to make a change in model2, it will not let me, but if I change the permissions and allow to change the model1 it already lets change the model2 as well.
How can I do to be able to change model2 without having to allow changing model1?