Show "buttons" when viewing an object, with forms2

also tweak logic when creating a batch..we'll see if it works..
This commit is contained in:
Lance Edgar 2018-01-26 19:04:34 -06:00
parent 580f817dd9
commit efdbc3c5b5
2 changed files with 6 additions and 4 deletions

View file

@ -2,7 +2,7 @@
<div class="form"> <div class="form">
${form.render_deform(readonly=True)|n} ${form.render_deform(readonly=True)|n}
## % if buttons: % if buttons:
## ${buttons|n} ${buttons|n}
## % endif % endif
</div><!-- form --> </div><!-- form -->

View file

@ -120,9 +120,11 @@ class BatchMasterView3(MasterView3, BatchMasterView2):
# current user is batch creator # current user is batch creator
batch.created_by = self.request.user or self.late_login_user() batch.created_by = self.request.user or self.late_login_user()
# TODO: is this still necessary with colander?
# destroy initial batch and re-make using handler # destroy initial batch and re-make using handler
kwargs = self.get_batch_kwargs(batch) kwargs = self.get_batch_kwargs(batch)
self.Session.expunge(batch) # if batch in self.Session:
# self.Session.expunge(batch)
batch = self.handler.make_batch(self.Session(), **kwargs) batch = self.handler.make_batch(self.Session(), **kwargs)
self.Session.flush() self.Session.flush()