# HG changeset patch # User Marcin Kuzminski # Date 2017-03-13 20:33:52 # Node ID f94cdb1c53e333fe1eff9f4feac5c7c5812740cc # Parent 1f65595182f895d2c2ceb5b573baeb610e516414 pyramid: base view improvements diff --git a/rhodecode/apps/_base/__init__.py b/rhodecode/apps/_base/__init__.py --- a/rhodecode/apps/_base/__init__.py +++ b/rhodecode/apps/_base/__init__.py @@ -40,7 +40,7 @@ class BaseAppView(object): self.request = request self.context = context self.session = request.session - self._rhodecode_user = request.user + self._rhodecode_user = request.user # auth user def _get_local_tmpl_context(self): c = TemplateArgs() @@ -64,3 +64,15 @@ class BaseAppView(object): 'errors': {}, } + def load_default_context(self): + """ + example: + + def load_default_context(self): + c = self._get_local_tmpl_context() + c.custom_var = 'foobar' + self._register_global_c(c) + return c + """ + raise NotImplementedError('Needs implementation in view class') +