Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@dd.displayfield(_("Remark"))
def remark(self, obj, ar):
return obj.remark
@dd.displayfield(
_("Debts"), help_text=_("List of invoices in this match group"))
def debts(self, row, ar):
return E.span(*join_elems([ # E.p(...) until 20150128
ar.obj2html(i.voucher.get_mti_leaf()) for i in row.debts]))
@dd.displayfield(_('Family'))
def family(self, ar):
members = []
if self.father:
members.append(
[self.__class__.father.verbose_name, ': ', ar.obj2html(self.father)])
if self.mother:
members.append(
[self.__class__.mother.verbose_name, ': ', ar.obj2html(self.mother)])
return E.div(*members)
#~ return "%s & %s" % ar.obj2html(obj) or "?",self.mother or "?")
@dd.displayfield("City")
def city(cls, row, ar):
return row[1]
@dd.displayfield(_("Events"))
def events_text(self, ar=None):
return ', '.join([
config.day_and_month(e.start_date)
for e in self.events_by_course.order_by('start_date')])
@dd.displayfield(_("Description"))
def description(cls, obj, ar):
kw = dict()
flt = ar.param_values.filter
for item in flt.item_set.all():
kw[item.field] = getattr(obj, item.field)
return str(kw)
@dd.displayfield(_("Type"))
def type_as_parent(self, ar):
# print('20140204 type_as_parent', self.type)
return self.type.as_parent(self.parent)
@dd.displayfield(_("Name"), max_length=15)
def name_column(self, request):
# return join_words(self.last_name.upper(),self.first_name)
return str(self)
@dd.displayfield(_("Address"))
def address_column(self, ar):
return self.address_location(', ')
@dd.displayfield(_("Description"))
def my_description(cls, obj, ar):
mi = ar.master_instance
if mi is None:
return
lst = [obj.summary]
tpl = u"{0}: {1}"
# if obj.site is not None and obj.site == mi.interesting_for:
# lst.append(_("site-specific"))
if obj.site is not None: # and obj.site != mi.interesting_for:
lst.append(tpl.format(
unicode(_("Site")), unicode(obj.site)))
if obj.reporter is not None:
lst.append(tpl.format(
unicode(_("Reporter")), unicode(obj.reporter)))
if obj.project is not None:
lst.append(tpl.format(