A django ImageField whose upload_to value is generated from the modal instance method get_upload_to
Project description
Django Dynamic Image
Description
A django ImageField whose upload_to value is generated from the modal instance method get_upload_to.
Installation
pip install django-dynamic-image
Usage
from django.db import models
from dynamic_image.fields import DynamicImageField
class ExampleModel(models.Model):
name = models.CharField(max_length=56)
image = DynamicImageField()
def get_upload_to(self, field_name):
class_name = self.__class__.__name__.lower()
instance_name = self.name
return "{}/{}".format(class_name, instance_name)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-dynamic-image-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d92b6d64f2e0774b722256ab76408c0983bf6b3f82bd890a3072b74ef655e552 |
|
MD5 | 98e78a03dcace049f85a30e05728e19e |
|
BLAKE2b-256 | f679e7a416fa7ac192c93b2c922e5ae038e8405ad6453b9f0f32a83ce128badc |
Close
Hashes for django_dynamic_image-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b37c12f8906924a1e3cc5a6d57b43473db97f65040d444efcae2b5d43774c4d7 |
|
MD5 | 48a54dc0cd44475965aa5d9fb5dddabc |
|
BLAKE2b-256 | 592d22d9098ebad48920a2fe8f9d73ee57d4d1554cbc16b4afb88388f9693ef5 |