How to use the lino.api.dd.displayfield function in lino

To help you get started, we’ve selected a few lino examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lino-framework / lino / lino / modlib / polls / models.py View on Github external
    @dd.displayfield(_("Remark"))
    def remark(self, obj, ar):
        return obj.remark
github lino-framework / lino / lino / modlib / ledger / ui.py View on Github external
    @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]))
github lino-framework / lino / lino / modlib / families / models.py View on Github external
    @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 "?")
github lino-framework / lino / docs / tutorials / vtables / models.py View on Github external
    @dd.displayfield("City")
    def city(cls, row, ar):
        return row[1]
github lino-framework / lino / lino / modlib / courses / models.py View on Github external
    @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')])
github lino-framework / lino / lino / modlib / importfilters / models.py View on Github external
    @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)
github lino-framework / lino / lino / modlib / humanlinks / models.py View on Github external
    @dd.displayfield(_("Type"))
    def type_as_parent(self, ar):
        # print('20140204 type_as_parent', self.type)
        return self.type.as_parent(self.parent)
github lino-framework / lino / lino / modlib / auth / models.py View on Github external
    @dd.displayfield(_("Name"), max_length=15)
    def name_column(self, request):
        # return join_words(self.last_name.upper(),self.first_name)
        return str(self)
github lino-framework / lino / lino / modlib / countries / mixins.py View on Github external
    @dd.displayfield(_("Address"))
    def address_column(self, ar):
        return self.address_location(', ')
github lino-framework / lino / lino / modlib / clocking / ui.py View on Github external
    @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(