Added baseView.
All checks were successful
Build Base Application / Build (push) Successful in 2m5s

This commit is contained in:
retoor 2025-01-27 14:11:13 +01:00
parent 8e60d8f75e
commit 6e3a31f879

View File

@ -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):