Created
July 21, 2017 21:03
-
-
Save AhnSeongHyun/6f1ea0c6e8407989f1aab2e5092825bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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