Library to provide a predicate dispatch for Django's generic views.
Project description
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
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-beautifulpredicates-0.0.1.tar.gz
.
File metadata
- Download URL: django-beautifulpredicates-0.0.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f3edb22bcff7f5995a93187eb5ce7ffcf0fdc0b8a8b138b095674b4910a83e7 |
|
MD5 | ad029bfa7f14e59e1c3b19d2935a5db3 |
|
BLAKE2b-256 | c383eda30163c4de7a919b768280cb4f12c6b2acfa282731c7a8d7f3fdd42716 |
File details
Details for the file django_beautifulpredicates-0.0.1-py2.7.egg
.
File metadata
- Download URL: django_beautifulpredicates-0.0.1-py2.7.egg
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99bd3884beb76a85546028eb7f0c53eef57c6bd14c2d7102df17fbd6a9f7e6a1 |
|
MD5 | 274b6b86301bc2a2c1a27c8ee9339d25 |
|
BLAKE2b-256 | da987fd85a8f39fe776991727500937069830731958454f2f40bcf2921f477b6 |