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

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

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

  • neexact

  • neiexact

  • necontains

  • neicontains

  • nestartswith

  • neendswith

  • neistartswith

  • neiendswith

  • neregex

  • neiregex

Extra regex lookup types

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

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.0.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

django_lookup_extensions-0.0.1-py2.py3-none-any.whl (9.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-lookup-extensions-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bec7152d3022be7672721a842d42ff98a74438b773bef7d2214a34addb79e1d4
MD5 50c33f8e50492d65076ac90f02fb12b8
BLAKE2b-256 3c7f527cca7fdf5ebb9693d7985f7d5714d4cd77c5c64af7ed8a54a3d721953e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_lookup_extensions-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e634e369250cc36e93884391f61cc0d8bbe98c427a89e577ada79d181c98f447
MD5 0065b8114e3492668a1cfdb6a776124e
BLAKE2b-256 a3dd6cabbc5018b00bbb3c64363914cf5b3f09e544c15f1041631e2756a2288d

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