I have following django models:
SALAMI_TYPES = (
('S', 'Spicy'),
('R', 'Regular')
)
CHEESES = (
('P', 'Parmesan'),
('C', 'Cheddar')
)
class Pizza(models.Model):
size = models.IntegerField()
class Meta:
abstract = True
class Pepperoni(Pizza):
salami = models.CharField(max_length=1, choices=SALAMI_TYPES)
class ExtraCheese(Pizza):
cheese = models.CharField(max_length=1, choices=CHEESES)
And following questions:
- How to iterate thought different types of pizzas? For example in menu template.
- Where to store forms for each pizza type and how to connect them to a model.
Thanks.