list_filter = ('group', 'role') list_per_page = 20 search_fields = ('account',) class TransactionLogInline(admin.TabularInline): model = TransactionLog extra = 1 max_num = 4 class TransactionEntryInline(admin.TabularInline): model = TransactionEntry extra = 3 class TransactionAdmin(BaseModelAdmin): inlines = [ TransactionLogInline, TransactionEntryInline, ] if getattr(settings, 'BACKOFFICE', False): site.register(Group, GroupAdmin) site.register(Account, AccountAdmin) site.register(RoleAccount, RoleAccountAdmin) site.register(Settlement) site.register(Transaction, TransactionAdmin) else: site.register(Group, BasicGroupAdmin)
from django.contrib import admin from django.conf import settings from itkufs.reports.models import List, ListColumn from itkufs.admin import site class ListColumnInline(admin.TabularInline): model = ListColumn extra = 3 class ListAdmin(admin.ModelAdmin): inlines = [ ListColumnInline, ] list_filter = ('group',) list_display = ('group', 'name') list_display_links = ('name',) ordering = ('group', 'name') prepopulated_fields = { 'slug': ('name',), } if getattr(settings, 'BACKOFFICE', False): site.register(List, ListAdmin)
from django.contrib import admin from django.conf import settings from itkufs.reports.models import List, ListColumn from itkufs.admin import site class ListColumnInline(admin.TabularInline): model = ListColumn extra = 3 class ListAdmin(admin.ModelAdmin): inlines = [ListColumnInline] list_filter = ("group", ) list_display = ("group", "name") list_display_links = ("name", ) ordering = ("group", "name") prepopulated_fields = {"slug": ("name", )} if getattr(settings, "BACKOFFICE", False): site.register(List, ListAdmin)
list_per_page = 20 search_fields = ('account', ) class TransactionLogInline(admin.TabularInline): model = TransactionLog extra = 1 max_num = 4 class TransactionEntryInline(admin.TabularInline): model = TransactionEntry extra = 3 class TransactionAdmin(BaseModelAdmin): inlines = [ TransactionLogInline, TransactionEntryInline, ] if getattr(settings, 'BACKOFFICE', False): site.register(Group, GroupAdmin) site.register(Account, AccountAdmin) site.register(RoleAccount, RoleAccountAdmin) site.register(Settlement) site.register(Transaction, TransactionAdmin) else: site.register(Group, BasicGroupAdmin)