Untitled
unknown
plain_text
a year ago
1.3 kB
3
Indexable
from django.db import models from products.models import Category, Product from suppliers.models import Supplier # Create your models here. class Prices(models.Model): ean = models.CharField( max_length=13, blank=True, null=True, unique=True ) wic = models.CharField( max_length=255, unique=True ) description = models.TextField() supplier_name = models.CharField( max_length=255 ) vpf_name = models.CharField( max_length=255, blank=True, null=True ) currency_code = models.CharField( max_length=3 ) availability = models.CharField( max_length=255 ) retail_price = models.DecimalField( max_digits=10, decimal_places=2 ) my_price = models.DecimalField( max_digits=10, decimal_places=2 ) warranty_term = models.PositiveIntegerField() category_id = models.ForeignKey( Category, on_delete=models.CASCADE ) supplier_id = models.ForeignKey( Supplier, on_delete=models.CASCADE ) image = models.URLField() product = models.ForeignKey( Product, on_delete=models.CASCADE ) def __str__(self): return self.description
Editor is loading...
Leave a Comment