An extension to the Django web framework that provides database and form color fields
Project description
An extension to the Django web framework that provides a database and form field to accept and store colors in the RGB format.
Installation
>>> pip install django-colorful
Make sure 'colorful' is in your INSTALLED_APPS:
INSTALLED_APPS.append('colorful')
Usage
In order to use a color field you just have to add it to your model definition:
from django.db import models
from colorful.fields import RGBColorField
class Tag(models.Model):
color = RGBColorField()
The RGBColorField class also accepts a color keyword argument which can be set to a list of colors that should be visible as preset color palette:
color = RGBColorField(colors=['#FF0000', '#00FF00', '#0000FF'])
The ColorFieldWidget should take care of providing a JavaScript based shim on browsers that don’t support the HTML5 color input.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-colorful-1.3.tar.gz.
File metadata
- Download URL: django-colorful-1.3.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd246f2fb297ed074dc4349966d33a1c82d0308b7fb0d6ef6e2e76b90cefffb7
|
|
| MD5 |
4ac83283bd4f0344ed2f6a77d023fe80
|
|
| BLAKE2b-256 |
b79f3e19b35b6d85ec5b6cffde8533b6a0fca5d435b278c6537428c32e1ab6b5
|
File details
Details for the file django_colorful-1.3-py2.py3-none-any.whl.
File metadata
- Download URL: django_colorful-1.3-py2.py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49d3feefdabdf6a22931c12ce1ed0cbb4596e7754e66bd55c0f362c0a369e5cb
|
|
| MD5 |
3feab43376563fd10dadb8873a497cd0
|
|
| BLAKE2b-256 |
1c32e8014523bdb2b70519df084ead00043cf409551494d26a41d477ae33248c
|