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

21 lines
383 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
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-16 15:20:16 +00:00
class PackAdmin(admin.ModelAdmin):
pass
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)