views:

34

answers:

1

Hi.

I have a following scenario:

A user fills in a URL to an image in a form (plain text field). In the form's model I also have ThumbnailField but it's hidden in the form.

image = ThumbnailField(editable=False, upload_to='media/images/products/', blank=True, null=True, size=(300, 300),
    extra_thumbnails={
        'icon': {'size': (32, 32), 'options': ['crop', 'upscale']},

When the form is processed I set the ThumbnailField to the URL the user entered and save the form.

That works, but not the way I expected. It saves the original URL in the database, where I expected it to save the image in specified size (300x300) locally and save its location to the database.

How can I achieve that?

A: 

Did you take a look at the this tutorial?

André Caron