A Django version of the Rails Dynamic Finder, using Django Managers.
Project description
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.managers import DynamicFinderManager
class Model(models.Model):
name = models.CharField(max_length=50)
objects DynamicFinderManager()
```
# Usage
```python
>>> Model.objects.get_by_name('Jonh') # Equivalent of Model.objects.get(name='Jonh')
<Model: #1 - Jonh>
>>> Model.objects.filter_by_name('Jonh') # Equivalent of Model.objects.filter(name='Jonh')
["<Model: #1 - Jonh>"]
>>> Model.objects.exclude_by_name('Jonh') # Equivalent of Model.objects.exclude(name='Jonh')
["<Model: #2 - Alice>", "<Model: #3 - Bob>"]
```
=====================
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.managers import DynamicFinderManager
class Model(models.Model):
name = models.CharField(max_length=50)
objects DynamicFinderManager()
```
# Usage
```python
>>> Model.objects.get_by_name('Jonh') # Equivalent of Model.objects.get(name='Jonh')
<Model: #1 - Jonh>
>>> Model.objects.filter_by_name('Jonh') # Equivalent of Model.objects.filter(name='Jonh')
["<Model: #1 - Jonh>"]
>>> Model.objects.exclude_by_name('Jonh') # Equivalent of Model.objects.exclude(name='Jonh')
["<Model: #2 - Alice>", "<Model: #3 - Bob>"]
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-dynamic-finder-0.1.tar.gz
.
File metadata
- Download URL: django-dynamic-finder-0.1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58603ee84ee0c5c7ae7f584bd71f25e0099c8b8bae43d1cc93c022bee72fb0dc |
|
MD5 | 8dc0fb74bf22d9b99b0e587d2ea2f566 |
|
BLAKE2b-256 | 3f284bc0c94932cbca1506b4518b44ad1e2412cad30aff20f69f6b56b56c6a1d |
File details
Details for the file django_dynamic_finder-0.1-py2.7.egg
.
File metadata
- Download URL: django_dynamic_finder-0.1-py2.7.egg
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad4840feab0f01d94b836c799acde5268516b1b60d7b7e8d7e788d9e9db38400 |
|
MD5 | a4b17ce17444affc177d2f322dce29c0 |
|
BLAKE2b-256 | b3bcaf6d15248ad72eec26bc91da45479e34e4af37397bd05487db62fa7fb84f |