You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 4, 2024. It is now read-only.
Lets have following simple test application:
models.py:
from django.db import models
class Parent(models.Model):
name = models.CharField(max_length=20)
class Child(models.Model):
parent = models.ForeignKey(Parent, on_delete=models.CASCADE)
name = models.CharField(max_length=20)
admin.py:
from django.contrib import admin
from .models import Child, Parent
class ChildInlineAdmin1(admin.TabularInline):
model = Child
def has_add_permission(self, request):
return False
class ChildInlineAdmin2(admin.TabularInline):
model = Child
class ParentAdmin(admin.ModelAdmin):
inlines = (ChildInlineAdmin1, ChildInlineAdmin2)
admin.site.register(Parent, ParentAdmin)
The first Inline admin doesn't show the last child.