On Wed, 2008-07-09 at 17:02 +0200, KONTRA, Gergely wrote: > > Could you override the save method and remove the file from the > > filesystem prior to saving? > > That's what I'm attempting to. > BUT: > the question is: how can I figure out the database-saved value of the photo > > class MyModel(models.Model): > photo = ImageField(upload_to='temp') > def save(self): > if self.id: > # now self.photo points to the requested image being > uploaded in the admin, not the previously saved one
You'll have to ask the database for the previous value. Django doesn't store the "changed value" like this. One day, maybe. Right now, no. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---