A django ImageField whose upload_to value is generated from a model method
Project description
Django Dynamic Image
Description
A django ImageField whose upload_to value is generated from a model method.
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
File details
Details for the file django-dynamic-image-1.4.0.tar.gz
.
File metadata
- Download URL: django-dynamic-image-1.4.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2665265b3d7af6620bd832c6ceae63ac52deab2634cdd47091738acc9a04efc1 |
|
MD5 | a54f2940088e6c1c916ad60acaa0a610 |
|
BLAKE2b-256 | db292d711439526cf4e3996dc6c5c1ee13d50679f03e702f61be33647687756e |
File details
Details for the file django_dynamic_image-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: django_dynamic_image-1.4.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 425b9e88852dee02b3416610a253804d51c26bc1e9d0983c8aa44e0abff3adae |
|
MD5 | 0a28e857d76a2326a7bfaeb7db4a9327 |
|
BLAKE2b-256 | c3efb9a630a0ec8067b945fa930dca49d37e3b193bfeffb8892f074fee2a03c2 |