django-beautifulpredicates 0.0.1

Library to provide a predicate dispatch for Django's generic views.

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
MIT License

Author

Hiroki KIYOHARA

Pip

django-beautifulpredicates==0.0.1

Classifiers

  • Framework :: Django
  • Intended Audience :: Developers
  • License :: OSI Approved :: MIT License
  • Programming Language :: Python
  • Topic :: Software Development :: Libraries :: Python Modules
  • Environment :: Plugins
  • Development Status :: 1 - Planning
File Type Python Version Uploaded On Downloads
django_beautifulpredicates-0.0.1-py2.7.egg Egg 2.7 Jan. 13, 2013 2,012
django-beautifulpredicates-0.0.1.tar.gz Source Jan. 13, 2013 2,140
Version Release Date
0.0.1 Jan. 13, 2013
Date Package Version Action
Aug. 24, 2015, 10:58 p.m. django-beautifulpredicates 0.0.1 Release Created
Aug. 24, 2015, 10:58 p.m. django-beautifulpredicates Package Created