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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 176a68e728014d462ed4a1df92a92f06226bc6d135d513487e586f68789791e4 |
|
MD5 | dda0cf522b87194123b1535589dd0316 |
|
BLAKE2b-256 | 8f3f2cbce48283a4960da308a716203474e42e6bba71c2c3835e45c7dbbeb3df |
Close
Hashes for django_dynamic_image-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d286fdd427ee5993d1f125eaefc7779032c97d117737d156665f7566b04f727 |
|
MD5 | c08d8ca1ac40b915ecee6688cf588201 |
|
BLAKE2b-256 | bd1c7114f8a66a1f91214121996bc932b9a9c8837fc1e5c933a858d4460bbf86 |