3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-16 08:23:12 +00:00
coope/preferences/admin.py

20 lines
1,022 B
Python
Raw Normal View History

2018-08-31 12:46:35 +00:00
from django.contrib import admin
2018-11-27 08:07:12 +00:00
from simple_history.admin import SimpleHistoryAdmin
2018-10-05 22:03:02 +00:00
from .models import PaymentMethod, GeneralPreferences, Cotisation
2019-02-27 07:59:41 +00:00
class CotisationAdmin(SimpleHistoryAdmin):
list_display = ('__str__', 'amount', 'duration')
ordering = ('-duration', '-amount')
class GeneralPreferencesAdmin(SimpleHistoryAdmin):
list_display = ('is_active', 'president', 'vice_president', 'treasurer', 'secretary', 'brewer', 'grocer', 'use_pinte_monitoring', 'lost_pintes_allowed', 'floating_buttons', 'automatic_logout_time')
class PaymentMethodAdmin(SimpleHistoryAdmin):
list_display = ('name', 'is_active', 'is_usable_in_cotisation', 'is_usable_in_reload', 'affect_balance')
ordering = ('name',)
search_fields = ('name',)
list_filter = ('is_active', 'is_usable_in_cotisation', 'is_usable_in_reload', 'affect_balance')
admin.site.register(PaymentMethod, PaymentMethodAdmin)
admin.site.register(GeneralPreferences, GeneralPreferencesAdmin)
admin.site.register(Cotisation, CotisationAdmin)