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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | da07f4068eb29985cc6778557d8e695420c0c9cc41a2cca4f46c0a0f12c7e9d3 |
|
MD5 | a7938e12e2c7bd3ff09aea85faa88e6d |
|
BLAKE2b-256 | 07a549b0529493e9e83624c10ca1a40b17b4a22ef9d2e9139d68dabb5d0d3280 |
Close
Hashes for django_dynamic_image-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c276925add55457a966dbc656b126c6871c8a4685f231575addb2518f451698 |
|
MD5 | b0e93cb8fad36564cd1ba9acd00f0cb8 |
|
BLAKE2b-256 | eb63b2f0c53040dce558468416de9103824d114bb3570b13282a7300dfbe236c |