コード例 #1
0
ファイル: admin.py プロジェクト: itkinside/ufs
    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)
コード例 #2
0
ファイル: admin.py プロジェクト: itkinside/ufs
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)
コード例 #3
0
ファイル: admin.py プロジェクト: michaeltoohig/ufs
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)
コード例 #4
0
ファイル: admin.py プロジェクト: sarkartanzil/ufs
    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)