Skip to main content
Django Dynamic Finder
=====================
A Django version of the Rails Dynamic Finder, using Django Managers.


# Install
```sh
$ pip install django-dynamic-finder
```

# Setup
```python
# settings.py

INSTALLED_APPS = (
...
'django_dynamic_finder',
...
)
```

```python
# project/app/models.py

from django.db import models

from django_dynamic_finder import DynamicFinderManager

class Model(models.Model):
name = models.CharField(max_length=50)

objects = DynamicFinderManager()
```

# Usage
```python
>>> Model.objects.get_by_name('Jonh')
# >>> Model.objects.get(name='Jonh')
<Model: #1 - Jonh>

>>> Model.objects.filter_by_name('Jonh')
# >>> Model.objects.filter(name='Jonh')
["<Model: #1 - Jonh>"]

>>> Model.objects.exclude_by_name('Jonh')
# >>> Model.objects.exclude(name='Jonh')
["<Model: #2 - Alice>", "<Model: #3 - Bob>"]

>>> Model.objects.filter_by_name_or_name('Jonh', 'Alice')
# >>> Model.objects.filter(Q(name='Jonh') | Q(name='Alice'))
["<Model: #1 - Jonh>", "<Model: #2 - Alice>"]

>>> Model.objects.exclude_by_name_or_id('Jonh', 3)
# >>> Model.objects.exclude(Q(name='Jonh') | Q(id=3))
["<Model: #2 - Alice>"]

>>> Model.objects.filter_by_name_or_id_or_name('Jonh', 3, 'Alice')
# >>> Model.objects.filter(Q(name='Jonh') | Q(id=3) | Q(name='Alice'))
["<Model: #1 - Jonh>", "<Model: #2 - Alice>", "<Model: #3 - Bob>"]
```

Metadata

Release files for django-dynamic-finder 0.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-dynamic-finder 0.2
File Size Uploaded Provenance
django-dynamic-finder-0.2.tar.gz 2.0 kB Without provenance Details

Release files / django-dynamic-finder-0.2.tar.gz

Download URL django-dynamic-finder-0.2.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9d3580bd3bd300b612795ee0d3763c0be6782d25592f782609ccb42abc455487
BLAKE2b-256 checksum
How to use checksums
d2afdd494bee1f527bfd72fc61ab8cc0acf3d0c206de38b6aa7fe482ee9a13ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-dynamic-finder 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

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