djangosnippets.org: Latest snippets tagged with 'ImageField'https://djangosnippets.org/tags/imagefield_1/2011-04-01T12:03:29.628763-05:00Human readable file names decorator
2011-04-01T12:03:29.628763-05:00maxkhttps://djangosnippets.org/snippets/2403/<p>This is extremely simple decorator to add possibility to upload files with name specific in some object field. For example image with same name as object slug.</p>
<p>Sample <strong>model</strong>:</p>
<pre><code>class Test(models.Model):
image = models.ImageField(\
upload_to=upload_to_dest(path='pics/', \
human_readable_field='hrname'))
hrname = models.CharField( \
max_length=128, \
blank=True, default='')
</code></pre>
<p>Sample <strong>form</strong> for admin: …</p>
Freely redistributableResizeImageField
2010-09-29T17:49:55.335600-05:00wimhttps://djangosnippets.org/snippets/2212/<h1>ResizeImageField</h1>
<h1>(extension of RemovableImageField)</h1>
<p>by Wim Feijen, Go2People.</p>
<h2>What does it do?</h2>
<p>ResizeImageField is a replacement for django's ImageField. It has two major benefits:
1. Creation of thumbnails and scaled images.
1. Extends the image upload form and adds a preview and a checkbox to remove the existing image.</p>
<p>It's …</p>
Freely redistributable