Browse Source

Reduce number of requests in the persons detail view + Optimize

pull/3/head
PCoder 5 months ago
parent
commit
32b7d4e395
  1. 6
      app/admin.py
  2. 2
      gmba_django/settings/base.py

6
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']

2
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)

Loading…
Cancel
Save