Allow subclasses of CreateView/EditView to omit template_name

pull/1897/merge
Matt Westcott 2015-09-08 18:28:17 +01:00 zatwierdzone przez Karl Hobley
rodzic 8edfcc168f
commit 06f793a355
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -58,6 +58,8 @@ class IndexView(PermissionCheckedMixin, View):
class CreateView(PermissionCheckedMixin, View): class CreateView(PermissionCheckedMixin, View):
template_name = 'wagtailadmin/generic/create.html'
def get_add_url(self): def get_add_url(self):
return reverse(self.add_url_name) return reverse(self.add_url_name)
@ -87,6 +89,7 @@ class CreateView(PermissionCheckedMixin, View):
class EditView(PermissionCheckedMixin, View): class EditView(PermissionCheckedMixin, View):
page_title = __("Editing") page_title = __("Editing")
context_object_name = None context_object_name = None
template_name = 'wagtailadmin/generic/edit.html'
def get_page_subtitle(self): def get_page_subtitle(self):
return str(self.instance) return str(self.instance)