Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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
Release History

Release History

This version
History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_beautifulpredicates-0.0.1-py2.7.egg (8.2 kB) Copy SHA256 Checksum SHA256 2.7 Egg Jan 13, 2013
django-beautifulpredicates-0.0.1.tar.gz (2.8 kB) Copy SHA256 Checksum SHA256 Source Jan 13, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting