def render(self, obj): text = helper.call_or_get(obj, self.attr) p_params = {} for key in self.params.keys(): p_params[key] = helper.call_or_get(obj, self.params[key]) return '<a href="%s">%s</a>' % (reverse('admin:%s_%s_changelist' % (self.app, self.model)) + '?' + urlencode(p_params), text)
def render(self, obj): text = helper.call_or_get(obj, self.attr) p_params = {} for key in self.params.keys(): p_params[key] = helper.call_or_get(obj, self.params[key]) return '<a href="%s">%s</a>' % ( reverse('admin:%s_%s_changelist' % (self.app, self.model)) + '?' + urlencode(p_params), text )
def render(self, obj): ref = helper.call_or_get(obj, self.attr, self.default) display = None if self.display: display = helper.call_or_get(obj, self.display, self.default) if isinstance(ref, Model): return '<a href="%s">%s</a>' % (reverse( admin_urlname(ref._meta, 'change'), args=(ref.pk, )), display or ref) return self.default
def render(self, obj): src = helper.call_or_get(obj, self.attr) if isinstance(src, ModelImageField): src = settings.MEDIA_URL + src p_params = {} for key in self.params.keys(): p_params[key] = helper.call_or_get(obj, self.params[key]) p_params['src'] = src return '<img%s/>' % (flatatt(p_params))
def render(self, obj): src = helper.call_or_get(obj, self.attr) if isinstance(src, ModelImageField): src = settings.MEDIA_URL + src p_params = {} for key in self.params.keys(): p_params[key] = helper.call_or_get(obj, self.params[key]) p_params['src'] = src return '<img%s/>' % ( flatatt(p_params) )
def render(self, obj): ref = helper.call_or_get(obj, self.attr, self.default) display = None if self.display: display = helper.call_or_get(obj, self.display, self.default) if isinstance(ref, Model): return '<a href="%s">%s</a>' % ( reverse( admin_urlname(ref._meta, 'change'), args=(ref.pk,) ), display or ref ) return self.default
def render(self, obj): return helper.call_or_get(obj, self.attr, self.default)