19 lines
452 B
Python
19 lines
452 B
Python
from django.utils.html import format_html
|
|
|
|
from django.conf import settings
|
|
from . import models
|
|
import django_tables2 as tables
|
|
from django_tables2.utils import A
|
|
|
|
|
|
class ImageColumn(tables.Column):
|
|
def render(self, value):
|
|
return format_html('<img src="{}{}" width="100" height="50" />', settings.MEDIA_URL, value)
|
|
|
|
|
|
class CustomerTable(tables.Table):
|
|
class Meta:
|
|
model = models.Customer
|
|
first_name = tables.Column()
|
|
|