Inline rules in the model admin
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user