old_contents: from django.contrib import admin
  
  from models import *
  
  class APIKeyAdmin(admin.ModelAdmin):
      prepopulated_fields = {"slug": ("name",)}
  
  class PermissionAdmin(admin.ModelAdmin):
      pass
  
  admin.site.register(APIKey, APIKeyAdmin)
  admin.site.register(Permission, PermissionAdmin)
  
  
new_contents: from django.contrib import admin
  
  from models import *
  
  class PermissionInline(admin.TabularInline):
      model = Permission
  
  class APIKeyAdmin(admin.ModelAdmin):
      prepopulated_fields = {"slug": ("name",)}
      inlines = [
          PermissionInline,
      ]
  
  class PermissionAdmin(admin.ModelAdmin):
      pass
  
  admin.site.register(APIKey, APIKeyAdmin)
  admin.site.register(Permission, PermissionAdmin)
  
  
subject: edit permissions inline with api key