django-orchestra-test/orchestra/apps/prices/admin.py

24 lines
526 B
Python
Raw Normal View History

2014-05-27 15:55:09 +00:00
from django.contrib import admin
2014-07-16 15:20:16 +00:00
from orchestra.admin.utils import insertattr
2014-07-17 16:09:24 +00:00
from orchestra.apps.accounts.admin import AccountAdminMixin
2014-07-16 15:20:16 +00:00
from orchestra.apps.orders.models import Service
2014-05-27 15:55:09 +00:00
2014-07-16 15:20:16 +00:00
from .models import Pack, Rate
2014-05-27 15:55:09 +00:00
2014-07-17 16:09:24 +00:00
class PackAdmin(AccountAdminMixin, admin.ModelAdmin):
list_display = ('name', 'account_link')
list_filter = ('name',)
2014-07-16 15:20:16 +00:00
admin.site.register(Pack, PackAdmin)
2014-05-27 15:55:09 +00:00
2014-07-16 15:20:16 +00:00
class RateInline(admin.TabularInline):
model = Rate
ordering = ('pack', 'quantity')
2014-05-27 15:55:09 +00:00
2014-07-16 15:20:16 +00:00
insertattr(Service, 'inlines', RateInline)