Ticket #5063: models.py
File models.py, 393 bytes (added by , 17 years ago) |
---|
Line | |
---|---|
1 | from django.db import models |
2 | |
3 | class OptionGroup(models.Model): |
4 | name = models.CharField(maxlength=50) |
5 | |
6 | def __str__(self): |
7 | return self.name.encode() |
8 | |
9 | class Product(models.Model): |
10 | name = models.CharField(maxlength=50) |
11 | |
12 | class ConfigurableProduct(models.Model): |
13 | product = models.OneToOneField(Product) |
14 | option_groups = models.ManyToManyField(OptionGroup) |
15 |