Skip to content

Commit 47d95af

Browse files
committed
BaseView: expose template name calculation
I want to use dashed names not underscore in newer projects
1 parent 3e1375e commit 47d95af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

keg/web.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,13 @@ def process_auto_assign(self):
200200
for key in self.auto_assign:
201201
self.assign(key, getattr(self, key))
202202

203+
def calc_class_fname(self):
204+
return case_cw2us(self.__class__.__name__)
205+
203206
def calc_template_name(self):
204207
if self.template_name is not None:
205208
return self.template_name
206-
template_path = '{}.html'.format(case_cw2us(self.__class__.__name__))
209+
template_path = '{}.html'.format(self.calc_class_fname())
207210
blueprint_name = request.blueprint
208211
if blueprint_name:
209212
template_path = '{}/{}'.format(blueprint_name, template_path)

0 commit comments

Comments
 (0)