filter for user transactions

This commit is contained in:
Sayyid Hamid Mahdavi 2025-05-27 12:29:57 +03:30
parent a17c5f60bd
commit 16acfc67f5
2 changed files with 3 additions and 2 deletions

View file

@ -188,6 +188,7 @@ class WithdrawVerify(generics.RetrieveAPIView):
class TransactionListView(ListView): class TransactionListView(ListView):
model = Transaction model = Transaction
template_name = 'wallet/transaction_list.html' template_name = 'wallet/transaction_list.html'
ordering = ['-created_at']
def get_queryset(self): def get_queryset(self):
user = self.request.user user = self.request.user

View file

@ -108,8 +108,8 @@ REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ( 'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated', 'rest_framework.permissions.IsAuthenticated',
), ),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 20, 'PAGE_SIZE': 50,
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
} }