Fix and improve admin search fields

This commit is contained in:
Reckless_Satoshi 2023-05-02 04:04:24 -07:00
parent 0477885998
commit ea6526f81c
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -93,9 +93,15 @@ class OrderAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
search_fields = [ search_fields = [
"id", "id",
"reference", "reference",
"maker", "maker__username",
"taker", "taker__username",
"amount", "amount",
"payout__payment_hash",
"maker_bond__payment_hash",
"taker_bond__payment_hash",
"trade_escrow__payment_hash",
"payout_tx__txid",
"payout_tx__address",
"min_amount", "min_amount",
"max_amount", "max_amount",
] ]
@ -105,7 +111,7 @@ class OrderAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
"maker_wins", "maker_wins",
"taker_wins", "taker_wins",
"return_everything", "return_everything",
"compite_median_trade_time", "compute_median_trade_time",
] ]
@admin.action(description="Solve dispute: maker wins") @admin.action(description="Solve dispute: maker wins")
@ -220,7 +226,7 @@ class OrderAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
) )
@admin.action(description="Compute median trade completion time") @admin.action(description="Compute median trade completion time")
def compite_median_trade_time(self, request, queryset): def compute_median_trade_time(self, request, queryset):
""" """
Computes the median time from an order taken to finishing Computes the median time from an order taken to finishing
successfully for the set of selected orders. successfully for the set of selected orders.
@ -289,6 +295,7 @@ class LNPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
ordering = ("-expires_at",) ordering = ("-expires_at",)
search_fields = [ search_fields = [
"payment_hash", "payment_hash",
"preimage",
"num_satoshis", "num_satoshis",
"sender__username", "sender__username",
"receiver__username", "receiver__username",