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 authors 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

Or the current folder can be installed:

pip install .

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-django14 or 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-0.8.2.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

django_any_imagefield-0.8.2-py2-none-any.whl (10.8 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django-any-imagefield-0.8.2.tar.gz
Algorithm Hash digest
SHA256 c023d9910092cbcc2b4d2bdb5c73745b9a65ef07db7d326d762067a2123324d2
MD5 4b542e263ecc482ebfcdaabb8ee3a7c5
BLAKE2b-256 730f8e97f380e0b5bdac1ee7059fa4378e9cf04ac9c754c726d24371360f389a

See more details on using hashes here.

File details

Details for the file django_any_imagefield-0.8.2-py2-none-any.whl.

File metadata

File hashes

Hashes for django_any_imagefield-0.8.2-py2-none-any.whl
Algorithm Hash digest
SHA256 a7f313802a15d49058d68f236112c32fba0161eced4f5b689d04c6f97d2897d1
MD5 47b1fd243ead798ee720b8f217c33450
BLAKE2b-256 0f7005eccc9088a7038712ebcab63e2732ee4ae551f93584313af4548ac009d9

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