Allow override of template for custom create views

This commit is contained in:
Lance Edgar 2018-11-17 18:23:07 -06:00
parent e3afb2c52a
commit e27debd452

View file

@ -653,7 +653,7 @@ class MasterView(View):
def render_mobile_row_listitem(self, obj, i):
return obj
def create(self, form=None):
def create(self, form=None, template='create'):
"""
View for creating a new model record.
"""
@ -670,7 +670,7 @@ class MasterView(View):
context = {'form': form}
if hasattr(form, 'make_deform_form'):
context['dform'] = form.make_deform_form()
return self.render_to_response('create', context)
return self.render_to_response(template, context)
def mobile_create(self):
"""