Skip to main content

Django Postgresql ColorField

Inspired by Utsob Roy(Codesign)[https://gitlab.com/codesigntheory/django-postgresql-rgb-colorfield]

Requirements

  1. Python 3.X
  2. Postgresql database in django.

Installation

pip install django-pg-colorfield

Quick start

  1. Add colorfield to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
    ...
    'colorfield',
]
  1. 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() 
  1. 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)

Source distribution for django-pg-colorfield 1.0
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)

Table of built distributions (wheels) for django-pg-colorfield 1.0
File Interpreter ABI Platform Actions
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.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page