Skip to main content

A switchable ImageField for third party Django applications

Project description

django-any-imagefield

This module offers a abstraction over the various image fields, so allow third party applications can provide an imagefield at the project choice.

Supported image fields:

Installation

First install the module, preferably in a virtual environment. It can be installed from PyPI:

pip install django-any-imagefield

Configuration

Add the module to the installed apps:

INSTALLED_APPS += (
    'any_imagefield',
)

Usage

In a Django model, the field can be included:

from django.db import models
from any_imagefield.models import AnyImageField

class Article(models.Model):
    title = models.CharField("Title", max_length=200)
    image = AnyImageField("Image", upload_to='images')

    class Meta:
        verbose_name = "Article"
        verbose_name_plural = "Articles"

    def __unicode__(self):
        return self.title

By default, the AnyImageField displays a standard ImageField with a preview thumbnail. When django-filebrowser-no-grappelli is installed, it will use the FileBrowseField from that package to display the file/image browser. When your package has it’s own ImageField variant/subclass, please consider to add support for it in this package.

Contributing

This module is designed to be generic. In case there is anything you didn’t like about it, or think it’s not flexible enough, please let us know. We’d love to improve it!

If you have any other valuable contribution, suggestion or idea, please let us know as well because we will look into it. Pull requests are welcome too. :-)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-any-imagefield-1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

django_any_imagefield-1.0-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-any-imagefield-1.0.tar.gz.

File metadata

  • Download URL: django-any-imagefield-1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/38.5.2 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.6.1

File hashes

Hashes for django-any-imagefield-1.0.tar.gz
Algorithm Hash digest
SHA256 6f91a9cddbfd852b0168f62c3fba616194f76f7f9c5edbf841f3e95295d2899b
MD5 ad02b8d7e8bbd56580cb086e2d118efa
BLAKE2b-256 c2b3c96ae16ee05b367f127d1033d1b7691eaef8f05222633253749b6fa0763d

See more details on using hashes here.

File details

Details for the file django_any_imagefield-1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_any_imagefield-1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/38.5.2 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.6.1

File hashes

Hashes for django_any_imagefield-1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b22a74423fb748cd3fda3f29f926c2dee20a848d0aae09a6362bd66ada595ae0
MD5 3f00d2e7c86981bfc46d6f075e716e61
BLAKE2b-256 f06613d133ec9adda8ac010400b153232d385caf7b29d263b18f696ed6dabb04

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page