k4ever/k4ever/transaction/admin.py

25 lines
988 B
Python

# -*- coding: utf-8 -*-
from models import Transaction, TransactionType, VirtualTransaction
from django.contrib import admin
class TransactionAdmin(admin.ModelAdmin):
list_filter = ('transactionType','checked','user')
#actions = ['really_delete_selected']
list_display = ('user', 'transactionType', 'amount', 'dateTime', 'checked')
list_display_links = ('user', 'transactionType')
search_fields = ['user__username','user__first_name','user__last_name']
date_hierarchy = 'dateTime'
ordering = ['-dateTime']
class VirtualTransactionAdmin(admin.ModelAdmin):
list_display = ('user','recipient','amount','dateTime','comment')
list_display_links = ('user','recipient')
list_filter = ('user','recipient')
search_fields = ['user__username','recipient__username','comment']
date_hierarchy = 'dateTime'
ordering = ['-dateTime']
admin.site.register(Transaction, TransactionAdmin)
admin.site.register(TransactionType)
admin.site.register(VirtualTransaction, VirtualTransactionAdmin)