1234567891011121314151617181920 |
- from django.contrib import admin
- from rest_framework_api_key.admin import APIKeyModelAdmin
- from rest_framework_api_key.models import APIKey as APIKey_default
- from .models import APIKey
- from django.contrib.auth.models import Permission
- admin.site.unregister(APIKey_default)
- admin.site.register(Permission)
- @admin.register(APIKey)
- class ClientAPIKeyModelAdmin(APIKeyModelAdmin):
- filter_horizontal = ['permission']
- pass
- #admin.site.register(APIKey)
|