FEATURE(wallet): add DateTimeRangeFilter to panel admin

add DateTimeRangeFilter to panel admin
This commit is contained in:
Haydar Ghasemi 2026-04-27 13:02:37 +03:30
parent d9b7dbe1b2
commit 5eff037d10
4 changed files with 6 additions and 2 deletions

View file

@ -5,6 +5,7 @@ import io
import xlsxwriter
import jdatetime
from django.utils import timezone
from rangefilter.filters import DateTimeRangeFilter
# from utils.accounts_client import get_user_detailed_info
@admin.action(description="export excel")
@ -59,7 +60,7 @@ def export_excel(modeladmin, request, queryset):
class TransactionAdmin(admin.ModelAdmin):
list_display = ['uuid', 'application', 'splited_amount', 'jalali_datetime', 'payer', 'payer_type', 'payee', 'payee_type', 'state', 'amount', 'created_at', 'updated_at']
search_fields = ['uuid', 'created_at', 'updated_at', 'payer_account__owner_uuid', 'payee_account__owner_uuid', 'application__uuid']
list_filter = ['application', 'state']
list_filter = ['application', 'state', ('created_at', DateTimeRangeFilter),]
actions = [export_excel]
class AccountAdmin(admin.ModelAdmin):

View file

@ -47,6 +47,7 @@ INSTALLED_APPS = [
'crispy_forms',
'crispy_bootstrap5',
'django_filters',
'rangefilter',
# 'jalali_date',
# local apps

View file

@ -22,4 +22,5 @@ psycopg[binary,pool]
django-redis
httpx
packaging==25.0
xlsxwriter
xlsxwriter
django-admin-rangefilter

View file

@ -181,3 +181,4 @@ zope-interface==8.2
# via gevent
xlsxwriter==3.2.3
# via -r requirements.in
django-admin-rangefilter==0.13.5