Set relevant 'index title' when viewing batch with rows

Also tweak 'Batch ID' field label.
This commit is contained in:
Lance Edgar 2016-08-20 21:03:30 -05:00
parent dce4972f0f
commit 340f02a3f2

View file

@ -192,7 +192,7 @@ class BatchMasterView(MasterView):
Apply some commonly-useful pre-configuration to the main batch
fieldset.
"""
fs.id.set(label="ID", readonly=True, renderer=forms.renderers.BatchIDFieldRenderer)
fs.id.set(label="Batch ID", readonly=True, renderer=forms.renderers.BatchIDFieldRenderer)
fs.created.set(readonly=True)
fs.created_by.set(label="Created by", renderer=forms.renderers.UserFieldRenderer,
@ -613,6 +613,9 @@ class BatchMasterView(MasterView):
'model_title_plural': self.get_row_model_title_plural(),
'batch_model_title': self.get_model_title(),
'index_url': self.get_action_url('view', row.batch),
'index_title': '{} {}'.format(
self.get_model_title(),
self.get_instance_title(row.batch)),
'form': form})
def get_row_instance(self):