Compare commits
No commits in common. "951a1a6a0617b804d6230799cdef6a12fa82f888" and "b670d57083994a95fdc346cf4426d1946ce9cced" have entirely different histories.
951a1a6a06
...
b670d57083
1 changed files with 2 additions and 21 deletions
|
|
@ -72,31 +72,12 @@ def mark_as_registered(model_admin, request, queryset):
|
||||||
|
|
||||||
|
|
||||||
class PaymentRequestAdmin(admin.ModelAdmin):
|
class PaymentRequestAdmin(admin.ModelAdmin):
|
||||||
list_display = ['state', 'check_success_again', 'uuid', 'amount_display', 'user_display', 'jalali_datetime_display',
|
list_display = ['state', 'check_success_again', 'uuid', 'splited_amount', 'user_id', 'jajali_datetime',
|
||||||
'is_registered', 'created_at', 'updated_at', 'application', 'gateway']
|
'is_registered', 'created_at', 'application', 'gateway']
|
||||||
search_fields = ['application__uuid', 'application__client_id', 'amount', 'user__uuid']
|
search_fields = ['application__uuid', 'application__client_id', 'amount', 'user__uuid']
|
||||||
list_filter = ['application', 'state', 'gateway', ('created_at', DateTimeRangeFilter), ('updated_at', DateTimeRangeFilter)]
|
list_filter = ['application', 'state', 'gateway', ('created_at', DateTimeRangeFilter), ('updated_at', DateTimeRangeFilter)]
|
||||||
# Every real column in list_display can be sorted ascending/descending by
|
|
||||||
# clicking its header; the computed columns declare an `ordering` so they
|
|
||||||
# sort by the underlying DB field. Only the "check success again" action
|
|
||||||
# button stays unsortable.
|
|
||||||
sortable_by = ['state', 'uuid', 'amount_display', 'user_display', 'jalali_datetime_display',
|
|
||||||
'is_registered', 'created_at', 'updated_at', 'application', 'gateway']
|
|
||||||
ordering = ['-created_at']
|
|
||||||
actions = [export_exel, mark_as_registered]
|
actions = [export_exel, mark_as_registered]
|
||||||
|
|
||||||
@admin.display(description='Splited amount', ordering='amount')
|
|
||||||
def amount_display(self, obj):
|
|
||||||
return obj.splited_amount
|
|
||||||
|
|
||||||
@admin.display(description='User', ordering='user')
|
|
||||||
def user_display(self, obj):
|
|
||||||
return obj.user_id
|
|
||||||
|
|
||||||
@admin.display(description='Jajali datetime', ordering='created_at')
|
|
||||||
def jalali_datetime_display(self, obj):
|
|
||||||
return obj.jajali_datetime
|
|
||||||
|
|
||||||
def changelist_view(self, request, extra_context=None):
|
def changelist_view(self, request, extra_context=None):
|
||||||
extra_context = extra_context or {}
|
extra_context = extra_context or {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue