Skip to main content

Django Lookup Property

Coverage Status GitHub Workflow Status PyPI GitHub GitHub Last Commit GitHub Issues Downloads Python Version

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)

Source distribution for django-lookup-property 0.2.2
File Size Uploaded
django_lookup_property-0.2.2.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-lookup-property 0.2.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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