haikal/inventory/tables.py
2024-12-17 16:29:10 +03:00

22 lines
544 B
Python

from django.utils.html import format_html
from django.conf import settings
from . import models
from django_tables2.utils import A
import django_tables2 as tables
from django import forms
from inventory.models import Car, SaleQuotation, SaleQuotationCar
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()