Improve admin panel loading times

This commit is contained in:
Reckless_Satoshi 2023-04-27 02:38:16 -07:00
parent dc24ff7a51
commit d0450fc07d
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 19 additions and 0 deletions

View File

@ -272,6 +272,10 @@ class LNPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
"order_escrow",
"order_paid_LN",
)
raw_id_fields = (
"receiver",
"sender",
)
list_filter = ("type", "concept", "status")
ordering = ("-expires_at",)
search_fields = [
@ -302,6 +306,10 @@ class OnchainPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
"balance",
"order_paid_TX",
)
raw_id_fields = (
"receiver",
"balance",
)
list_display_links = ("id", "address", "concept")
list_filter = ("concept", "status")
search_fields = ["address", "num_satoshis", "receiver__username", "txid"]

View File

@ -21,6 +21,11 @@ class ChatRoomAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
)
change_links = ["order", "maker", "taker"]
search_fields = ["id"]
raw_id_fields = (
"order",
"maker",
"taker",
)
@admin.register(Message)
@ -38,3 +43,9 @@ class MessageAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
search_fields = ["id", "index"]
ordering = ["-chatroom_id", "-index"]
list_filter = ("chatroom",)
raw_id_fields = (
"order",
"chatroom",
"receiver",
"sender",
)