diff --git a/app/admin.py b/app/admin.py index 34589ae..05b543c 100644 --- a/app/admin.py +++ b/app/admin.py @@ -2,14 +2,19 @@ from django.contrib import admin from django.utils.html import format_html from .models import * from django.forms import TextInput +from django.conf import settings class PeopleResourceInline(admin.TabularInline): + autocomplete_fields = ['resource'] model = PeopleResource + extra = 0 class PeopleRangeInline(admin.TabularInline): + autocomplete_fields = ['range'] model = PeopleRange + extra = 0 class PersonAdmin(admin.ModelAdmin): @@ -60,6 +65,7 @@ class PersonAdmin(admin.ModelAdmin): ) list_display = ['id', 'full_name', 'organization'] autocomplete_fields = ['organization'] + list_per_page = settings.ADMIN_LIST_PER_PAGE # list_display_links = ['id'] diff --git a/gmba_django/settings/base.py b/gmba_django/settings/base.py index 1255a0c..1342ba3 100644 --- a/gmba_django/settings/base.py +++ b/gmba_django/settings/base.py @@ -118,3 +118,5 @@ STATIC_URL = '/static/' # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +ADMIN_LIST_PER_PAGE = os.getenv('ADMIN_LIST_PER_PAGE', 20)