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.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6558ecbce3f05451e8f58d30f717e4577afc9f3cfdc3c1dec18004224e9e11f |
|
MD5 | b15aa538e1015a9b509b3d050ad24fb7 |
|
BLAKE2b-256 | 557e6ba34aa91e7364262d387f100eba797f2db9373583cfdfd7eb16df4cb928 |
Close
Hashes for django_dynamic_image-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df07e38ade3ee94371ab4e32e306f1d5747656865c7db6bb130e5150d09752f |
|
MD5 | 64f48380add6dffcbe435eda506023d6 |
|
BLAKE2b-256 | dbdc9c4f3642fd7bdc5d05a758bb8d9accdb2b3276271c9b6ae470423fab9ed7 |