[gen] Changed the way to customize the Config in an app.

This commit is contained in:
Gaetan Delannay 2013-07-24 15:53:19 +02:00
parent 88bd5e5bce
commit 8833f7b0ae
12 changed files with 182 additions and 160 deletions

View file

@ -14,7 +14,7 @@ class TranslationWrapper(AbstractWrapper):
# either from the config object.
sourceLanguage = self.sourceLanguage
if not sourceLanguage:
sourceLanguage = self.o.getProductConfig().sourceLanguage
sourceLanguage = self.o.getProductConfig(True).sourceLanguage
sourceTranslation = getattr(tool.o, sourceLanguage).appy()
# p_field is the Computed field. We need to get the name of the
# corresponding field holding the translation message.
@ -43,7 +43,7 @@ class TranslationWrapper(AbstractWrapper):
if field.type == 'Computed': name = field.name[:-6]
else: name = field.name
# Get the source message
sourceLanguage = self.o.getProductConfig().sourceLanguage
sourceLanguage = self.o.getProductConfig(True).sourceLanguage
sourceTranslation = getattr(tool.o, sourceLanguage).appy()
sourceMsg = getattr(sourceTranslation, name)
if field.isEmptyValue(sourceMsg): return False

View file

@ -360,7 +360,7 @@ class AbstractWrapper(object):
obj = zobj and zobj.appy() or None;
showPortlet=ztool.showPortlet(zobj, layoutType);
dir=ztool.getLanguageDirection(lang);
discreetLogin=ztool.getAttr('discreetLogin', source='config');
discreetLogin=ztool.getProductConfig(True).discreetLogin;
dleft=(dir == 'ltr') and 'left' or 'right';
dright=(dir == 'ltr') and 'right' or 'left';
x=resp.setHeader('Content-type', ztool.xhtmlEncoding);
@ -879,7 +879,7 @@ class AbstractWrapper(object):
p_cfg is the product config that holds the default value.'''
res = klass._getParentAttr('creators')
# Return default creators if no creators was found.
if not res: res = cfg.defaultAddRoles
if not res: res = cfg.appConfig.defaultCreators
return res
@classmethod