Skip to main content

Django lookup extensions use NOT query.

Project description

Django lookup extensions

https://travis-ci.org/uncovertruth/django-lookup-extensions.svg?branch=master https://api.codacy.com/project/badge/Grade/d5a64517be0d49b6bf2f41c11df77730 https://codebeat.co/badges/20da13a3-e873-412a-89b1-1a02bba47a23 https://www.codefactor.io/repository/github/uncovertruth/django-lookup-extensions/badge https://codecov.io/gh/uncovertruth/django-lookup-extensions/branch/master/graph/badge.svg Documentation Status Updates Python 3 https://img.shields.io/pypi/v/django-lookup-extensions.svg

Django lookup extensions use NOT query.

Installation

To install Django lookup extensions, run this command in your terminal:

$ pip install django-lookup-extensions

This is the preferred method to install Django lookup extensions, as it will always install the most recent stable release.

If you don’t have pip installed, this Python installation guide can guide you through the process.

Usage

Setup

Add ‘lookup_extensions’ to your INSTALLED_APPS setting.:

INSTALLED_APPS = [
    ...
    'lookup_extensions',
    ...
]

AppConfig.ready imports lookups and register them using django.db.models.fields.Field.register_lookup.

Making queries

Use lookup like Django standard lookups.

ModelA.objects.filter(name__neexact='test name')

Supported lookup types

Negaetes

neexact is negate exact, neiexact is negate iexact, others are similar.

  • neexact

  • neiexact

  • necontains

  • neicontains

  • nestartswith

  • neendswith

  • neistartswith

  • neiendswith

  • neregex

  • neiregex

Complement

  • complement

Extra regexes

These regex lookups support metacharacters \d, \D, w, \W, \s, \S.

MySQL, PostgreSQL and Redshift also support \<, \>.

Prefix follows the previous section.

  • exregex

  • exiregex

  • neexregex

  • neexiregex

Supported vendor types

  • MySQL

  • PostgreSQL

  • sqlite

    • lookups using LIKE aren’t case sensitive.

      • necontains

      • nestartswith

      • neendswith

  • Redshift

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.2.0

  • Add support for Django 2.1

  • Add support for Python 3.7

  • Migrate to complement from exists and neexists

0.1.0

  • Migrate installation to backend settings

  • Support exists and neexists lookups

0.0.1 - 0.0.2

  • Support extra regex lookups

  • Support negaete lookups

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-lookup-extensions-0.2.0.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

django_lookup_extensions-0.2.0-py2.py3-none-any.whl (19.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-lookup-extensions-0.2.0.tar.gz.

File metadata

  • Download URL: django-lookup-extensions-0.2.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for django-lookup-extensions-0.2.0.tar.gz
Algorithm Hash digest
SHA256 37e7cb7f4e14ac202722647e1026673b347e280f8b0ad0b4b1cb5c3c1e290f07
MD5 507fb9335385fff0b24dbaeb7d90d1cd
BLAKE2b-256 c81d93dc844bf93e8eaa51b1a9911542b23197e3775b3a9943280dd6d9920af7

See more details on using hashes here.

File details

Details for the file django_lookup_extensions-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_lookup_extensions-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.2 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.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for django_lookup_extensions-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 705e87e7734fc999e01c161be99236bbb657a607ab8ed6c55a2ccdb7ca5c0467
MD5 22623c05def5012ebb6f5fb9846e62a9
BLAKE2b-256 003efc0f9fe0a8d47fd80b1df50f4219f844baddeb723f76908b50460d2b346e

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