我有两个模型,我想在numero
模型中搜索Ramal
的{{1}}。我如何以简单的方式做到这一点?
Model1
Avaria
Model2
class Avaria(models.Model):
.....
.....
Model1admin
class Ramal(models.Model):
numero = models.PositiveIntegerField(blank=True,verbose_name="Numero do ramal", primary_key=True, null=False)
avaria = models.ForeignKey(Avaria,on_delete=models.CASCADE,related_name='RamalObjects',)