Re: models.py general help

2009-05-04 Thread sanket agarwal
The solution to the problem was to extend the Python's save method... here's a snippet of the following: def save(self, force_insert=False, force_update=False): """Update the size field and save the record""" if self.filepath: self.filesize=os.path.getsize(self.fil

Re: models.py general help

2009-05-03 Thread Michael
On Sun, May 3, 2009 at 9:15 AM, Sanket Agarwal wrote: > > > class Files(models.Model): > >"""Uploads area, all files to be ready for user use are put here""" > > >filepath = models.FilePathField(_('Choose File'),path="/home/sanket/ > Music") >filedescription = models.Cha

models.py general help

2009-05-03 Thread Sanket Agarwal
Hey, I am trying to do something very simple I have a downloads app in my django project. It has some fields like file name, file path, file type and file size. What I wish is to take the file path and get the file size via maybe getsize function in os, but how can I write equivalent code for