✨ Add product images and basic nav
This commit is contained in:
1 parent
350d31d8d8
commit
d86afd9392
16 files changed
+385
-42
No files matched your search
@@ -20,6 +20,7 @@ class ProductFilter:
|
||||
class Product:
|
||||
id: auto
|
||||
name: auto
|
||||
image_url: str
|
||||
sale_price_int: auto
|
||||
sale_price_ext: auto
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ from datetime import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.templatetags.static import static
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
@@ -43,6 +44,10 @@ class Product(models.Model):
|
||||
def wholesale_value(self):
|
||||
return self.wholesale_unit_price * self.inventory_amount
|
||||
|
||||
@property
|
||||
def image_url(self):
|
||||
return self.image.url if self.image else ""
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
Reference in new issue
Block a user