diff options
Diffstat (limited to 'app/products/models.py')
-rw-r--r-- | app/products/models.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/products/models.py b/app/products/models.py index bf33db4..d4dd5a8 100644 --- a/app/products/models.py +++ b/app/products/models.py @@ -10,6 +10,7 @@ from django.utils.html import format_html from django.conf import settings from django.template.defaultfilters import slugify +from photos.models import PhotoGallery, LuxImage, LuxImageSize from photos.utils import resize_image from utils.util import render_images, render_products, parse_video, markdown_to_html @@ -32,15 +33,20 @@ class Product(models.Model): pub_date = models.DateTimeField() body_markdown = models.TextField(blank=True) body_html = models.TextField(null=True, blank=True) - primary_offer_retailer = models.CharField(max_length=400) + RETAILER = ( + (0, 'Amazon'), + (1, 'REI'), + (2, 'eBay'), + ) + primary_offer_retailer = models.IntegerField(choices=RETAILER, default=0) primary_offer_url = models.CharField(max_length=400) primary_offer_price = models.IntegerField() - secondary_offer_retailer = models.CharField(max_length=400) + secondary_offer_retailer = models.IntegerField(choices=RETAILER, default=0) secondary_offer_url = models.CharField(max_length=400, blank=True, null=True) secondary_offer_price = models.IntegerField(blank=True, null=True) rating = models.IntegerField() is_public = models.BooleanField(default=True) - image = models.FileField(upload_to=get_upload_path, null=True, blank=True) + featured_image = models.ForeignKey(LuxImage, on_delete=models.CASCADE, null=True, blank=True) class Meta: ordering = ('-pub_date',) |