Ticket #5063: models.py

File models.py, 393 bytes (added by John Shaffer <jshaffer2112@…>, 8 years ago)

The test case models file.

Line 
1from django.db import models
2
3class OptionGroup(models.Model):
4    name = models.CharField(maxlength=50)
5
6    def __str__(self):
7        return self.name.encode()
8
9class Product(models.Model):
10    name = models.CharField(maxlength=50)
11
12class ConfigurableProduct(models.Model):
13    product = models.OneToOneField(Product)
14    option_groups = models.ManyToManyField(OptionGroup)
15
Back to Top