Campo de escolhas dinâmicas no Django Models
My models.py
SHOP1_CHOICES = (
('Food Court', 'Food Court'),
('KFC', 'KFC'),
)
SHOP2_CHOICES = (
('Sports Arena', 'Sports Arena'),
('Disco D', 'Disco D'),
)
SHOP3_CHOICES = (
('Bowling Arena', 'Bowling Arena'),
('Cinemax', 'Cinemax'),
)
class Feed(models.Model):
gender = models.CharField(max_length=5, choices=GENDER_CHOICES, default='girl')
name =models.CharField(max_length=25)
shop=models.CharField(max_length=20)
location=models.CharField(max_length=25, choices=SHOP1_CHOICES)
Aqui seFeed.shop == 'shop1'
Eu quero carregarSHOP1_CHOICES
emFeed.location
. Atualmente, independentemente de qual loja, ele apenas exibe oSHOP1_CHOICES
(sem surpresa) .Como posso implementá-lo? Estou preso, por favor me ajud