Pass form along to before_create_flush()
in master3
This commit is contained in:
parent
e283288a26
commit
8a945f8baf
|
@ -155,12 +155,12 @@ class MasterView3(MasterView2):
|
||||||
def save_create_form(self, form):
|
def save_create_form(self, form):
|
||||||
self.before_create(form)
|
self.before_create(form)
|
||||||
obj = form.schema.objectify(self.form_deserialized)
|
obj = form.schema.objectify(self.form_deserialized)
|
||||||
self.before_create_flush(obj)
|
self.before_create_flush(obj, form)
|
||||||
self.Session.add(obj)
|
self.Session.add(obj)
|
||||||
self.Session.flush()
|
self.Session.flush()
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
def before_create_flush(self, obj):
|
def before_create_flush(self, obj, form):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def save_edit_form(self, form):
|
def save_edit_form(self, form):
|
||||||
|
|
|
@ -303,7 +303,7 @@ class UpgradeView(MasterView):
|
||||||
def download_content_type(self, path, filename):
|
def download_content_type(self, path, filename):
|
||||||
return 'text/plain'
|
return 'text/plain'
|
||||||
|
|
||||||
def before_create_flush(self, upgrade):
|
def before_create_flush(self, upgrade, form):
|
||||||
upgrade.created_by = self.request.user
|
upgrade.created_by = self.request.user
|
||||||
upgrade.status_code = self.enum.UPGRADE_STATUS_PENDING
|
upgrade.status_code = self.enum.UPGRADE_STATUS_PENDING
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue