On 7 Aug 2006, at 04:45, bernie2004 wrote:

    def _save_FIELD_file( self, field, filename, raw_contents ):
        try:
            oldEntry = MyTable.objects.get( uid=self.uid )
            from os import remove
            from django.conf import settings
            remove( settings.MEDIA_ROOT + oldEntry.image )
        except:
            pass
        filename = '%s-%s.jpg' % ( self.title, self.uid )
        super( Feature, self )._save_FIELD_file( field, filename,
raw_contents )


Hmmmm, why not just use save method?

def save(self):
  oldname = self.file_field
  # rename & move file to new name if needed
  self.file_field = newname
  super(Class, self).save()

--
Nebojša Đorđević - nesh
Studio Quattro - Niš - Serbia
http://studioquattro.biz/ |  http://trac.studioquattro.biz/djangoutils/
Registered Linux User 282159 [http://counter.li.org]

What is the sound of one backpack EMP weapon discharging? -- Joe Thompson
"Clickety-click" -- Charles Cazabon


Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to