from django db import models class Products models Model name models C

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
from django.db import models
class Products(models.Model):
name = models.CharField(max_length=40)
brand = models.ForeignKey(Brand)
tags = models.ForeignKey(Tags)
related = models.ManyToManyField('self',blank=True)
description = models.TextField()
price = models.IntegerField()
class Admin:
list_display = ('name',)
class Meta:
verbose_name = u'Product'
verbose_name_plural = u'Products'
def __unicode__(self):
return self.name