class Product models Model Продукт title models CharField max_length 2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class Product(models.Model):
'''Продукт'''
title = models.CharField(max_length=250)
description = models.CharField(max_length=250, blank=True)
type = models.ForeignKey(ProductType)
sections = models.ManyToManyField(Section)
property_values = models.ManyToManyField(ProductProperty, through="ProductProperties")
def __unicode__(self):
return self.title
class Meta:
db_table = 'catalogue_products'