我刚刚完成了类似的项目,我猜你的解决方案是:
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)
</code>
如果向我发送我的例子,请告诉我