我的models.py中有这个:
class MyModel(models.Model)
imgA = ThumbnailerImageField(upload_to="site_images/",
null=True, blank=True)
imgB = ThumbnailerImageField(upload_to="site_images/",
null=True, blank=True)
我想将 imgA 复制到 imgB 所以我尝试了:
def copy_thumbnailer():
obj = MyModel.objects.get(id=1)
obj.imgB = obj.imgA
obj.save()
该函数运行没有错误,但未复制 ThumbnailerImageField。有什么办法可以做到这一点?