Hi everyone I have a simple question.
This is my model:
class book(models.Model):
title = models.CharField(max_length=50)
photo = models.ImageField(upload_to='images/avatar/')
thumb = models.ImageField(upload_to='images/thumb/')
I want in photo original photo and in thumb the same
You'll probably want to use one of Django's thumbnail apps. Here's the one I
recommend:
http://code.google.com/p/sorl-thumbnail/*
-*Chris
On Sat, Jan 2, 2010 at 9:48 AM, nameless wrote:
> Hi everyone I have a simple question.
> This is my model:
>
>
> class book(models.Model):
>title = mode
Thank you but I want to do that without external apps if possible :)
I am looking for a simplest way to create a thumbnail automatically
when a new book is created.
--
On Jan 2, 4:59 pm, Chris Moffitt wrote:
> You'll probably want to use one of Django's thumbnail apps. Here's th
/topics/db/models/#overriding-predefined-model-methods
Xia Kai(夏恺)
xia...@gmail.com
http://blog.xiaket.org
--
From: "Chris Moffitt"
Sent: Saturday, January 02, 2010 11:59 PM
To:
Subject: Re: Photo + thumbnail
---------
> From: "Chris Moffitt"
> Sent: Saturday, January 02, 2010 11:59 PM
> To:
> Subject: Re: Photo + thumbnail
>
> > You'll probably want to use one of Django's thumbnail apps. Here's the one
> > I
> > recommend:
> &
---------
> From: "Chris Moffitt"
> Sent: Saturday, January 02, 2010 11:59 PM
> To:
> Subject: Re: Photo + thumbnail
>
> > You'll probably want to use one of Django's thumbnail apps. Here's the one
> > I
> > recommend:
> >
ave method of the model and resize
> > the original photo using PIL. For the overriding part, you could consult the
> > documentation:http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-pre...
>
> >
> > Xia Kai(夏恺)
> > xia...@gm
ight be too fat for a minimalist like
> > > me. ^_^
>
> > > I would recommend override the default save method of the model and resize
> > > the original photo using PIL. For the overriding part, you could consult
> > > the
> > > doc
8 matches
Mail list logo