25
保存时,如何检查字段是否已更改?
在我的模型中,我有: class Alias(MyBaseModel): remote_image = models.URLField(max_length=500, null=True, help_text="A URL that is downloaded and cached for the image. Only used when the alias is made") image = models.ImageField(upload_to='alias', default='alias-default.png', help_text="An image representing the alias") def save(self, *args, **kw): if (not self.image or self.image.name == 'alias-default.png') and self.remote_image : try : data …