It is necessary in Django, in which django-tables2 is connected, to output a field with a link to a page with data about this field by get_absolute_url().

To do this, I need to use Accessors, but how???

class GostTable(tables.Table):
     # get_absolute_url() I need on field 'name'!

    class Meta:
        model = Gost
        template_name = "django_tables2/bootstrap.html" 
        fields = ('name', 'short_name')

I haven't any ideas about using Accessors...

0

There are 0 best solutions below