2022-03-19 16:33:01 +00:00
|
|
|
from django.contrib import admin
|
2022-06-05 21:16:03 +00:00
|
|
|
from control.models import AccountingDay, AccountingMonth, BalanceLog
|
2022-03-20 23:32:25 +00:00
|
|
|
from import_export.admin import ImportExportModelAdmin
|
|
|
|
|
2022-03-19 16:33:01 +00:00
|
|
|
# Register your models here.
|
|
|
|
|
|
|
|
@admin.register(AccountingDay)
|
2022-03-20 23:32:25 +00:00
|
|
|
class AccountingDayAdmin(ImportExportModelAdmin):
|
|
|
|
|
2022-03-19 16:33:01 +00:00
|
|
|
list_display = (
|
|
|
|
"day",
|
|
|
|
"contracted",
|
2022-03-20 23:32:25 +00:00
|
|
|
"num_contracts",
|
2022-03-19 16:33:01 +00:00
|
|
|
"net_settled",
|
|
|
|
"net_paid",
|
|
|
|
"net_balance",
|
2022-03-20 23:32:25 +00:00
|
|
|
"inflow",
|
|
|
|
"outflow",
|
|
|
|
"routing_fees",
|
|
|
|
"cashflow",
|
|
|
|
"outstanding_earned_rewards",
|
|
|
|
"outstanding_pending_disputes",
|
|
|
|
"lifetime_rewards_claimed",
|
2022-03-21 12:13:57 +00:00
|
|
|
"earned_rewards",
|
|
|
|
"disputes",
|
2022-03-20 23:32:25 +00:00
|
|
|
"rewards_claimed",
|
2022-03-19 16:33:01 +00:00
|
|
|
)
|
|
|
|
change_links = ["day"]
|
|
|
|
search_fields = ["day"]
|
|
|
|
|
|
|
|
@admin.register(AccountingMonth)
|
2022-03-20 23:32:25 +00:00
|
|
|
class AccountingMonthAdmin(ImportExportModelAdmin):
|
|
|
|
|
2022-03-19 16:33:01 +00:00
|
|
|
list_display = (
|
|
|
|
"month",
|
|
|
|
"contracted",
|
2022-03-20 23:32:25 +00:00
|
|
|
"num_contracts",
|
2022-03-19 16:33:01 +00:00
|
|
|
"net_settled",
|
|
|
|
"net_paid",
|
|
|
|
"net_balance",
|
2022-03-20 23:32:25 +00:00
|
|
|
"inflow",
|
|
|
|
"outflow",
|
|
|
|
"routing_fees",
|
|
|
|
"cashflow",
|
|
|
|
"outstanding_earned_rewards",
|
|
|
|
"outstanding_pending_disputes",
|
|
|
|
"lifetime_rewards_claimed",
|
|
|
|
"outstanding_earned_rewards",
|
2022-03-19 16:33:01 +00:00
|
|
|
"pending_disputes",
|
2022-03-20 23:32:25 +00:00
|
|
|
"rewards_claimed",
|
2022-03-19 16:33:01 +00:00
|
|
|
)
|
|
|
|
change_links = ["month"]
|
2022-06-05 21:16:03 +00:00
|
|
|
search_fields = ["month"]
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(BalanceLog)
|
|
|
|
class BalanceLogAdmin(ImportExportModelAdmin):
|
|
|
|
|
|
|
|
list_display = (
|
|
|
|
"time",
|
|
|
|
"total",
|
|
|
|
"onchain_fraction",
|
|
|
|
"onchain_total",
|
|
|
|
"onchain_confirmed",
|
|
|
|
"onchain_unconfirmed",
|
|
|
|
"ln_local",
|
|
|
|
"ln_remote",
|
|
|
|
"ln_local_unsettled",
|
|
|
|
"ln_remote_unsettled",
|
|
|
|
)
|
|
|
|
readonly_fields = [
|
|
|
|
"time",
|
|
|
|
"total",
|
|
|
|
"onchain_fraction",
|
|
|
|
"onchain_total",
|
|
|
|
"onchain_confirmed",
|
|
|
|
"onchain_unconfirmed",
|
|
|
|
"ln_local",
|
|
|
|
"ln_remote",
|
|
|
|
"ln_local_unsettled",
|
|
|
|
"ln_remote_unsettled",
|
|
|
|
]
|
|
|
|
change_links = ["time"]
|
|
|
|
search_fields = ["time"]
|