django-iin-lookup 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.4
2
+ Name: django-iin-lookup
3
+ Version: 0.1.0
4
+ Summary: An implementation of case-insensitive IN lookup for Django queries
5
+ Author: blag
6
+ Author-email: blag <blag@users.noreply.github.com>
7
+ License-Expression: BSD-3-Clause
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Environment :: Web Environment
10
+ Classifier: Framework :: Django
11
+ Classifier: Framework :: Django :: 4.2
12
+ Classifier: Framework :: Django :: 5.0
13
+ Classifier: Framework :: Django :: 5.1
14
+ Classifier: Framework :: Django :: 5.2
15
+ Classifier: Framework :: Django :: 6.0
16
+ Classifier: Framework :: Django :: 6.1
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Programming Language :: Python :: 3.15
22
+ Requires-Dist: django>=4.2
23
+ Requires-Python: >=3.14
24
+ Project-URL: Repository, https://github.com/blag/django-iin-lookup
25
+ Project-URL: Issues, https://github.com/blag/django-iin-lookup/issues
26
+ Description-Content-Type: text/markdown
27
+
28
+ # django-iin-lookup
29
+
30
+ ### For Django
31
+
32
+ [![pypi](https://img.shields.io/pypi/v/django-iin-lookup.svg)](https://pypi.python.org/pypi/django-iin-lookup/)
33
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/blag/django-iin-lookup/main.svg)](https://results.pre-commit.ci/latest/github/blag/django-iin-lookup/main)
34
+ <!-- [![tests ci](https://github.com/blag/django-iin-lookup/workflows/tests/badge.svg)](https://github.com/blag/django-iin-lookup/actions) -->
35
+
36
+ **django-iin-lookup** provides a case-insensitive `IN` lookup (`.filter(myfield__iin=[...])`) for Django database queries
37
+
38
+
39
+ ## Compatibility
40
+
41
+ - Python: >= **3.14**
42
+ - Django: >= **4.2**
43
+
44
+
45
+ ## Installation
46
+
47
+ 1. Install the latest version:
48
+
49
+ ```sh
50
+ pip install django-iin-lookup
51
+ ```
52
+
53
+ ```sh
54
+ uv add django-iin-lookup
55
+ ```
56
+
57
+ 2. Add `iin` to `INSTALLED_APPS` in your project's `settings.py`.
@@ -0,0 +1,30 @@
1
+ # django-iin-lookup
2
+
3
+ ### For Django
4
+
5
+ [![pypi](https://img.shields.io/pypi/v/django-iin-lookup.svg)](https://pypi.python.org/pypi/django-iin-lookup/)
6
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/blag/django-iin-lookup/main.svg)](https://results.pre-commit.ci/latest/github/blag/django-iin-lookup/main)
7
+ <!-- [![tests ci](https://github.com/blag/django-iin-lookup/workflows/tests/badge.svg)](https://github.com/blag/django-iin-lookup/actions) -->
8
+
9
+ **django-iin-lookup** provides a case-insensitive `IN` lookup (`.filter(myfield__iin=[...])`) for Django database queries
10
+
11
+
12
+ ## Compatibility
13
+
14
+ - Python: >= **3.14**
15
+ - Django: >= **4.2**
16
+
17
+
18
+ ## Installation
19
+
20
+ 1. Install the latest version:
21
+
22
+ ```sh
23
+ pip install django-iin-lookup
24
+ ```
25
+
26
+ ```sh
27
+ uv add django-iin-lookup
28
+ ```
29
+
30
+ 2. Add `iin` to `INSTALLED_APPS` in your project's `settings.py`.
@@ -0,0 +1,40 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.11.8,<0.12.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "django-iin-lookup"
7
+ version = "0.1.0"
8
+ description = "An implementation of case-insensitive IN lookup for Django queries"
9
+ authors = [
10
+ { name = "blag", email = "blag@users.noreply.github.com" }
11
+ ]
12
+ license = "BSD-3-Clause"
13
+ readme = "README.md"
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Environment :: Web Environment",
17
+ "Framework :: Django",
18
+ "Framework :: Django :: 4.2",
19
+ "Framework :: Django :: 5.0",
20
+ "Framework :: Django :: 5.1",
21
+ "Framework :: Django :: 5.2",
22
+ "Framework :: Django :: 6.0",
23
+ "Framework :: Django :: 6.1",
24
+ "Intended Audience :: Developers",
25
+ "Operating System :: OS Independent",
26
+ "Programming Language :: Python",
27
+ "Programming Language :: Python :: 3.14",
28
+ "Programming Language :: Python :: 3.15",
29
+ ]
30
+ requires-python = ">=3.14"
31
+ dependencies = [
32
+ "django>=4.2",
33
+ ]
34
+
35
+ [project.urls]
36
+ Repository = "https://github.com/blag/django-iin-lookup"
37
+ Issues = "https://github.com/blag/django-iin-lookup/issues"
38
+
39
+ [tool.uv.build-backend]
40
+ module-name = "iin"
File without changes
@@ -0,0 +1,9 @@
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class IinConfig(AppConfig):
5
+ default_auto_field = 'django.db.models.BigAutoField'
6
+ name = 'iin'
7
+
8
+ def ready(self):
9
+ from . import lookups # noqa: F401
@@ -0,0 +1,21 @@
1
+ from django.db.models import CharField, TextField
2
+ from django.db.models.lookups import In
3
+
4
+
5
+ @CharField.register_lookup
6
+ @TextField.register_lookup
7
+ class IIn(In):
8
+ """
9
+ Case-insensitive version of the __in lookup
10
+ Usage: field_name__iin=[...]
11
+ """
12
+
13
+ lookup_name = "iin"
14
+
15
+ def process_lhs(self, compiler, connection, lhs=None):
16
+ lhs, params = super().process_lhs(compiler, connection, lhs=lhs)
17
+ return f"LOWER({lhs})", params
18
+
19
+ def process_rhs(self, compiler, connection):
20
+ rhs, params = super().process_rhs(compiler, connection)
21
+ return rhs, tuple(p.lower() if isinstance(p, str) else p for p in params)
File without changes