def render(self, context): obj = self.obj.resolve(context) if obj is None: return '' value = ugettext_field(obj, self.field_name) if not value: value = getattr(obj, self.field_name, '') value = unicode(value) if self.safe: value = mark_safe(value) if self.title: value = title(value) if self.linebreaks: value = linebreaks(value) if self.upper: value = value.upper() if self.escape: value = escape(value) return value
def render(self, context): from djangoplus.translation import ugettext_field content = ugettext_field(self, 'content') return template.Template(content).render(template.Context(context))