Skip to content

Commit

Permalink
show transactions list in admin
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolff committed Nov 18, 2019
1 parent 797ba6a commit 8efb969
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions payment/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ def has_delete_permission(self, request, obj=None):

@admin.register(Transaction)
class TransactionAdmin(admin.ModelAdmin):
readonly_fields = ['created']
date_hierarchy = 'created'
ordering = ['-created']
list_filter = ['kind', 'is_success']
list_display = ['created', amount, 'kind', 'is_success', 'token', 'error']
search_fields = ['token', 'payment__id']

def has_module_permission(self, request):
# Prevent TransactionAdmin from appearing in the admin menu,
# to view a transaction detail users should start navigation from a Payment.
return False
readonly_fields = ['created']


##############################################################
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='django-payment',
version='1.6',
version='1.7',
description='',
long_description='',
author='Nicholas Wolff',
Expand Down

0 comments on commit 8efb969

Please sign in to comment.