[rentals] Use select_related
in LockerInfo admin to improve load times
This commit is contained in:
parent
81377a8a87
commit
8b5489bc6f
@ -30,3 +30,6 @@ class LockerInfoAdmin(admin.ModelAdmin):
|
||||
list_filter = ["locker_unit__bank", "locker_unit", "renter"]
|
||||
list_display = ["locker_unit", "address", "blind_code", "bitting_code", "renter"]
|
||||
list_display_links = ["locker_unit", "address"]
|
||||
|
||||
def get_queryset(self, request):
|
||||
return LockerInfo.objects.select_related("locker_unit", "locker_unit__bank")
|
||||
|
Loading…
Reference in New Issue
Block a user