Django Image Helper
Provides a model mixin that has 'image' and 'thumbnail' fields.
The uploaded image will be scaled to the model's 'IMAGE_SIZE' and
a thumbnail will be scaled and saved to the model's 'THUMBNAIL_SIZE'.
Additionally, there is an admin mixin to help you display an image's thumbnail
when in the admin's listview.
RELEASE NOTES:
version 0.1.0
-------------
Added SizedImageField. This lets you do the same thing the ``ImageMixin``
was used for, but isolates all the work to the model's field. It should
work with any storage backend.
See the example project for a working sample. The basics:
class MyModel(models.Model):
image = fields.SidedImageField(upload_to="the_directory", size=(500, 500), thumbnail_size=(200, 200))
Then you can access both the image and thumbnail in code or templates by:
model.image.url
model.image.thumbnail.url
Provides a model mixin that has 'image' and 'thumbnail' fields.
The uploaded image will be scaled to the model's 'IMAGE_SIZE' and
a thumbnail will be scaled and saved to the model's 'THUMBNAIL_SIZE'.
Additionally, there is an admin mixin to help you display an image's thumbnail
when in the admin's listview.
RELEASE NOTES:
version 0.1.0
-------------
Added SizedImageField. This lets you do the same thing the ``ImageMixin``
was used for, but isolates all the work to the model's field. It should
work with any storage backend.
See the example project for a working sample. The basics:
class MyModel(models.Model):
image = fields.SidedImageField(upload_to="the_directory", size=(500, 500), thumbnail_size=(200, 200))
Then you can access both the image and thumbnail in code or templates by:
model.image.url
model.image.thumbnail.url
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-image-helper-0.1.0.tar.gz.
File metadata
- Download URL: django-image-helper-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b94b0f213645a10340ddabc6e532ddda986ee6c91d2f3028790f32d19bd67eb7
|
|
| MD5 |
71ba5a7ad5d71fde29325f269b11ebe9
|
|
| BLAKE2b-256 |
1b57be9666a6c41d203d64034643011939a4a6126b19cea8c2abc10166b67ae7
|