Various tweaks for sake of forms2 refactor
This commit is contained in:
parent
43ce0fb44f
commit
ac733ae6ea
|
@ -38,7 +38,7 @@
|
|||
</select>
|
||||
<input type="hidden" name="__end__" value="${name}:sequence"
|
||||
tal:condition="multiple" />
|
||||
<script type="text/javascript">
|
||||
<script tal:condition="not multiple" type="text/javascript">
|
||||
deform.addCallback(
|
||||
'${oid}',
|
||||
function(oid) {
|
||||
|
|
|
@ -250,6 +250,8 @@ class MasterView(View):
|
|||
# let save_create_form() return alternate object if necessary
|
||||
obj = self.save_create_form(form) or form.fieldset.model
|
||||
self.after_create(obj)
|
||||
# TODO: ugh, avoiding refactor for now but it's needed
|
||||
self.after_create_form(form, obj)
|
||||
self.flash_after_create(obj)
|
||||
return self.redirect_after_create(obj)
|
||||
context = {'form': form}
|
||||
|
@ -1623,6 +1625,11 @@ class MasterView(View):
|
|||
Event hook, called just after a new instance is saved.
|
||||
"""
|
||||
|
||||
def after_create_form(self, form, obj):
|
||||
"""
|
||||
Event hook, called just after a new instance is saved.
|
||||
"""
|
||||
|
||||
def editable_instance(self, instance):
|
||||
"""
|
||||
Returns boolean indicating whether or not the given instance can be
|
||||
|
@ -1636,6 +1643,11 @@ class MasterView(View):
|
|||
Event hook, called just after an existing instance is saved.
|
||||
"""
|
||||
|
||||
def after_edit_form(self, form, obj):
|
||||
"""
|
||||
Event hook, called just after an instance is updated.
|
||||
"""
|
||||
|
||||
def deletable_instance(self, instance):
|
||||
"""
|
||||
Returns boolean indicating whether or not the given instance can be
|
||||
|
|
|
@ -166,4 +166,6 @@ class MasterView3(MasterView2):
|
|||
def save_edit_form(self, form):
|
||||
obj = form.schema.objectify(self.form_deserialized, context=form.model_instance)
|
||||
self.after_edit(obj)
|
||||
# TODO: ugh, this is to avoid refactor for the moment..but it's needed..
|
||||
self.after_edit_form(form, obj)
|
||||
self.Session.flush()
|
||||
|
|
Loading…
Reference in a new issue