1👍
I just finished similar project and I guess your solution is:
class InstrumentEquipmentType(models.Model):
manufacturer_model_type = models.ForeignKey(InstrumentModelType)
instrument_manufacturer = ChainedForeignKey(InstrumentManufactuer,
chained_field='instrument_model_type',
chained_model_field='manufacturer_model_type',
auto_choose = True,
show_all = False)
equipment_type = models.CharField(max_length=100)
def __unicode__(self): # Python 3: def __str__(self):
return unicode(self.equipment_type)
Let me know if it did not work to send you my example
0👍
Try Django Clever Selects
https://github.com/PragmaticMates/django-clever-selects
I use it in my Django 1.6 project. It is more usefull to operate chains in views and forms (in clever selects), not in models (like smart selects do).
👤Y.N
Source:stackexchange.com