Django Postgresql ColorField
Inspired by Utsob Roy(Codesign)[https://gitlab.com/codesigntheory/django-postgresql-rgb-colorfield]
Requirements
- Python 3.X
- Postgresql database in django.
Installation
pip install django-pg-colorfield
Quick start
- Add colorfield to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'colorfield',
]
- Import and Use ColorField:
To get search features you have to add ColorManager with your model.
from django.db import models
from colorfield_lib.colorfield import fields
class ColorManager(fields.ColorManager, models.Manager):
# You can put your queryset staff
pass
class ColorModel(models.Model):
color = fields.ColorField(null=True, blank=True)
objects = ColorManager()
- Filtering field.
- field="color" filed that you want to search.
- You can also pass as color="[1, 100, 200]" ro color="#0164C8".
- radius=10 is a margin you consider to search.
queryset = ColorModel.objects.by_radius(
...
field="color",
color=[1, 100, 200],
radius=10,
)
Metadata
Release files for django-pg-colorfield 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-pg-colorfield-1.0.tar.gz | 4.0 kB | Without provenance | Details for django-pg-colorfield-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_pg_colorfield-1.0-py3-none-any.whl | Python 3 | none | any | Details for django_pg_colorfield-1.0-py3-none-any.whl |
Total release size: 8.4 kB
Release files / django-pg-colorfield-1.0.tar.gz
| Download URL | django-pg-colorfield-1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a7a013fe3d5425639f8282563b85043819b1fc65bb304574ba4502b2b785fa8
|
|
BLAKE2b-256 checksum How to use checksums |
348c5da6239504c4f9a6603fce3a0211f692f5e61450f1918130deffb94eab28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Release files / django_pg_colorfield-1.0-py3-none-any.whl
| Download URL | django_pg_colorfield-1.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95bfa05ff31f23e21d5fbc3260433a6794808c10dbe680e722e5c8cad2721e9f
|
|
BLAKE2b-256 checksum How to use checksums |
89320624115490f445e1b403f8155f9924b8033c529b75ee14d0a6b72282b073
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Security for django-pg-colorfield 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.