In my model I have :
class Alias(MyBaseModel):
remote_image = models.URLField(max_length=500, null=True, help_text=\"A URL that is downloaded and cached
Best way is with a pre_save
signal. May not have been an option back in '09 when this question was asked and answered, but anyone seeing this today should do it this way:
@receiver(pre_save, sender=MyModel)
def do_something_if_changed(sender, instance, **kwargs):
try:
obj = sender.objects.get(pk=instance.pk)
except sender.DoesNotExist:
pass # Object is new, so field hasn't technically changed, but you may want to do something else here.
else:
if not obj.some_field == instance.some_field: # Field has changed
# do something