This commit is contained in:
parent
8e60d8f75e
commit
6e3a31f879
@ -23,6 +23,21 @@ def get_timestamp():
|
|||||||
formatted_datetime = now.strftime("%Y-%m-%d %H:%M:%S")
|
formatted_datetime = now.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
return formatted_datetime
|
return formatted_datetime
|
||||||
|
|
||||||
|
class BaseView(web.View):
|
||||||
|
|
||||||
|
@property
|
||||||
|
def app(self):
|
||||||
|
return self.request.app
|
||||||
|
|
||||||
|
@property
|
||||||
|
def template_path(self):
|
||||||
|
return pathlib.Path(self.request.app.template_path)
|
||||||
|
|
||||||
|
async def render_template(self, name, context=None):
|
||||||
|
if not context:
|
||||||
|
context = {}
|
||||||
|
return await self.request.app.render_template(str(name), self.request, context)
|
||||||
|
|
||||||
|
|
||||||
class BaseApplication(RPCApplication):
|
class BaseApplication(RPCApplication):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user