def exports(self): ExportDefinition = namedtuple( 'ExportDefinition', ('url', 'title', 'description') ) exports = [] for provider in self.providers: url = provider.url or ''.join( (self.url(), '?export-id=', provider.id) ) exports.append( ExportDefinition( url=url, title=utils.translate( self.context, self.request, provider.title ), description=utils.translate( self.context, self.request, provider.description ) ) ) return exports
def custom_label_widgets(self): """Goes throught he custom labels and applies them. """ for field, label in self.custom_labels.items(): if field in self.form.widgets: self.form.widgets[field].label = utils.translate( self.context, self.request, label )
def exports(self): ExportDefinition = namedtuple('ExportDefinition', ('url', 'title', 'description')) exports = [] for provider in self.providers: url = provider.url or ''.join( (self.url(), '?export-id=', provider.id)) exports.append( ExportDefinition( url=url, title=utils.translate(self.context, self.request, provider.title), description=utils.translate(self.context, self.request, provider.description))) return exports
def title(field): return utils.translate(self.context, self.request, IRoadworksDirectoryItem[field].title)