假设我有这样的模型
class modelEmployee(models.Model):
employee = models.ForeignKey(modelEmployee, on_delete=models.CASCADE,null=True,default=None,blank=True)
introduction = models.CharField(max_length=1000, unique=False,default="")
imageA = models.ImageField(upload_to='images/', default='images/patient_images/blank.jpeg')
我知道我可以像这样调用imageA字段
inst = modelEmployee.objects.get(id=12)
inst.imageA.save(content = someContent,name=someName)
现在假设我动态地收到了imageA字段 有没有办法让我像这样调用字段imageA
field = "imageA"
inst.[field].save(content = someContent,name=someName) #Access field using string