Django Lookup Property
pip install django-lookup-property
Documentation: https://mrthearman.github.io/django-lookup-property/
Source Code: https://github.com/MrThearMan/django-lookup-property/
Contributing: https://github.com/MrThearMan/django-lookup-property/blob/main/CONTRIBUTING.md
Django model properties that are also lookup expressions.
from lookup_property import lookup_property
from django.db import models
from django.db.models import Value
from django.db.models.functions import Concat
class Student(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
@lookup_property
def full_name():
return Concat("first_name", Value(" "), "last_name")
>>> from myapp.models import Student
>>> from lookup_property import L
>>>
>>> Student.objects.create(first_name="John", last_name="Doe")
>>> student = Student.objects.filter(L(full_name="John Doe")).first()
>>>
>>> student.full_name
'John Doe'
Metadata
Release files for django-lookup-property 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_lookup_property-0.2.2.tar.gz | 20.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_lookup_property-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.0 kB
Release files / django_lookup_property-0.2.2.tar.gz
| Download URL | django_lookup_property-0.2.2.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c979ecb01f3c1435ca55665c6de7fe70a891db980bd6c5ad40d8a7b7ba7d29aa
|
|
BLAKE2b-256 checksum How to use checksums |
550eb595d0e04290566fd3c3329ff2155f004608fd6064d1ea20ed216b772c4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Linux/6.11.0-1018-azure
|
Release files / django_lookup_property-0.2.2-py3-none-any.whl
| Download URL | django_lookup_property-0.2.2-py3-none-any.whl |
|---|---|
| Size | 26.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d79e639a588abe3322825af8cf44991f80943bd9affb4ff00017c3ca5e8ae75
|
|
BLAKE2b-256 checksum How to use checksums |
92a8407e67e829ba23824c20a0e95cd03271dd1daf43869441c26745c3ff7cbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Linux/6.11.0-1018-azure
|