7

Inline rules in the model admin

This commit is contained in:
Jasper Berghoef
2016-11-17 12:33:43 +01:00
parent 7ec039905d
commit 856992f987
4 changed files with 104 additions and 78 deletions

View File

@ -22,22 +22,12 @@ def register_admin_urls():
]
class SegmentCreateView(CreateView):
def get_context_data(self, **kwargs):
context = {
'additional_forms': (TimeRuleForm, ReferralRuleForm, VisitCountRuleForm),
}
context.update(kwargs)
return super(SegmentCreateView, self).get_context_data(**context)
class SegmentModelAdmin(ModelAdmin):
"""The base model for the Segments administration interface."""
model = Segment
menu_icon = 'group'
add_to_settings_menu = False
list_display = ('status', 'name', 'create_date', 'edit_date')
create_view_class = SegmentCreateView
index_view_extra_css = ['personalisation/segment/index.css']
form_view_extra_css = ['personalisation/segment/form.css']
inspect_view_enabled = True