Skip to content

Instantly share code, notes, and snippets.

@AhnSeongHyun
Created July 21, 2017 21:03
Show Gist options
  • Save AhnSeongHyun/6f1ea0c6e8407989f1aab2e5092825bf to your computer and use it in GitHub Desktop.
Save AhnSeongHyun/6f1ea0c6e8407989f1aab2e5092825bf to your computer and use it in GitHub Desktop.
class WebRenderTemplateBase(RenderTemplateBase):
base_template_path = 'web'
def render(self):
return self._render_template()
def _render_template(self):
return render_template(self.template_path, **vars(self))
class WebRenderCardViewTemplate(WebRenderTemplateBase):
def __init__(self, common_params, **kwargs):
super(WebRenderCardViewTemplate, self).__init__(
template_path='web.html',
common_params=AttrDict(common_params)
)
self.color = self.common_params.COLOR
self.title = 'test_page'
for k, v in kwargs.items():
setattr(self, k, v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment