From e01e323d3ee78113f1f814a06a65cbd4deabc185 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 19 Aug 2015 17:15:09 -0500 Subject: [PATCH] Tweak base `BatchRowCrud` view class, for fieldset customization. --- tailbone/views/batch.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tailbone/views/batch.py b/tailbone/views/batch.py index 849b2ba5..3224654d 100644 --- a/tailbone/views/batch.py +++ b/tailbone/views/batch.py @@ -1020,6 +1020,22 @@ class BatchRowCrud(BaseCrud): """ return self.batch_class.__name__ + def fieldset(self, row): + """ + Creates the fieldset for the view. Derived classes should *not* + override this, but :meth:`configure_fieldset()` instead. + """ + fs = self.make_fieldset(row) + self.configure_fieldset(fs) + return fs + + def configure_fieldset(self, fieldset): + """ + Derived classes can override this. Customizes a fieldset which has + already been created with defaults by the base class. + """ + fieldset.configure() + def template_kwargs(self, form): """ Add batch row instance etc. to template context.