Suppose I have 3 fields of a Car Shop. those are Condition, Brand, Model .
class Car(models.Model):
ConditionType=(('1','New'),('2','Used'),('3','Reconditon'))
BrandType=(
('Toyota','Toyota'),('Honda','Honda'),('Mitsubishi','Mitsubishi'),
('Nissan','Nissan'),('Hyindai','Hyindai')
)
now model will depends on Brand user select . if user select Toyota as brand then >available model for toyota are (Axio,Premio ,Allion etc) ,for Honda carmodels are (civic >,vezel,Grace)
Brand=models.CharField(max_length=120,choices=BrandType,default=None)
Condition=models.CharField(max_length=120,choices=ConditionType,default='New')
CarModel=models.CharField(max_length=120,choices=ModelType,default=None)
Now how can I make carmodel dependent on Brand . Suppose if user choose Brand - Toyota >then user can only choose Carmodel of Toyota if user Choose Honda than he can choose >CarModel of Honda . which means how can I make my model selection dependent on Brand ? if no brand is selected than user won't able to choose CarModel .**