Re: Overriding the model's save() method

2007-07-23 Thread Nic James Ferrier
Chris Hoeppner <[EMAIL PROTECTED]> writes: > If I get this right, you're saving the original file, and a separate > thumb file. While this seems interesting, it's not what I want to > implement. It's more of a bit of catching the incoming data and > transforming it before it gets saved in the mod

Re: Overriding the model's save() method

2007-07-23 Thread Chris Hoeppner
Nic James Ferrier escribió: > Chris Hoeppner <[EMAIL PROTECTED]> writes: > >> Maybe something like >> >> def save(self): >> self.imageField = pil.thumbnail(self.imageField) >> >> Can't really tell if I'm on the right track here. > > Search the list... I've got this from the list: > > > I

Re: Overriding the model's save() method

2007-07-23 Thread Nic James Ferrier
Chris Hoeppner <[EMAIL PROTECTED]> writes: > Maybe something like > > def save(self): > self.imageField = pil.thumbnail(self.imageField) > > Can't really tell if I'm on the right track here. Search the list... I've got this from the list: IMAGE_SIZE = [300, 300] THUMBNAIL_SIZE = [100

Re: Overriding the model's save() method

2007-07-23 Thread Sydney Weidman
On Jul 23, 11:07 am, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > Hi there! > > I haven't been able to find this documented anywhere (and I'll kindly > apologize if there actually *is* some doc about it), and thought I'd > turn to you guys ;) > > I'd like to override a model's save() method in orde

Re: Overriding the model's save() method

2007-07-23 Thread John Shaffer
There are short docs here: http://www.djangoproject.com/documentation/model-api/#overriding-default-model-methods That's really all you need to know. Just manipulate your fields and then call the original save method (through super). Another simple example. This save method emulates the behavior

Overriding the model's save() method

2007-07-23 Thread Chris Hoeppner
Hi there! I haven't been able to find this documented anywhere (and I'll kindly apologize if there actually *is* some doc about it), and thought I'd turn to you guys ;) I'd like to override a model's save() method in order to "thumbnailize" the data from an image field. Users are able to upload i