Library to provide a predicate dispatch for Django’s generic views.
Requirements
Python 2.7 or later (not support 3.x)
Django 1.4 or later
Features
Using this, You can create views call method in considering of value returned by predicate. For example folloing view calls method in considering of request parameter:
class PonyView(PredicateProcessView):
dispatch_config = (
('get_corn_1', (RequestParamPredicate('corn=1'),)),
('get_corn', (RequestParamPredicate('corn'),)),
)
def get_corn(self, request, *args, **kwargs):
return HttpResponse('pony with some corn')
def get_corn_1(self, request, *args, **kwargs):
return HttpResponse('pony with unicorn')
def get_default(self, request, *args, **kwargs):
return HttpResponse('pony')
In this case, It used:
beautifulpredicates.views.PredicateProcessView
beautifulpredicates.predicates.RequestParamPredicate
History
0.0.1 (2012-01-13)
first release
Metadata
Release files for django-beautifulpredicates 0.0.1
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-beautifulpredicates-0.0.1.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_beautifulpredicates-0.0.1-py2.7.egg | Legacy Egg format | - | - | Details |
Total release size: 10.9 kB
Release files / django-beautifulpredicates-0.0.1.tar.gz
| Download URL | django-beautifulpredicates-0.0.1.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f3edb22bcff7f5995a93187eb5ce7ffcf0fdc0b8a8b138b095674b4910a83e7
|
|
BLAKE2b-256 checksum How to use checksums |
c383eda30163c4de7a919b768280cb4f12c6b2acfa282731c7a8d7f3fdd42716
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_beautifulpredicates-0.0.1-py2.7.egg
| Download URL | django_beautifulpredicates-0.0.1-py2.7.egg |
|---|---|
| Size | 8.2 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
99bd3884beb76a85546028eb7f0c53eef57c6bd14c2d7102df17fbd6a9f7e6a1
|
|
BLAKE2b-256 checksum How to use checksums |
da987fd85a8f39fe776991727500937069830731958454f2f40bcf2921f477b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |