Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install rebecca.view

How to install rebecca.view

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install rebecca.view
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.2 Available View build log
 
License
MIT
Dependencies
Imports
Lastest release
version 0.2 on Sep 20th, 2013

rebecca.view

rebecca.view is helper classes for pyramid views.

BasicView methods and properties

properties

  • context view context passed to constructor
  • request request passed to constructor
  • response response attribute of request
  • body body attribute of request

methods

  • redirect(url) create HTTPFound object from url
  • redirect_route(route_name, **values) create HTTPFound object with route_url
  • action_dispatch call method named *_action with request param.
Softification

Softification is context manager to replace Exceptions to the other Exceptions.

with Softification(NoResultFound, HTTPNotFound):
    item = DBSession.query(Item).filter(Item.id==id).one()

If one() method raises NoResultFound exception, the context manager catch that and raises the HTTPNotFound exception. You can use tuple for target Exception classes.

USAGE
BasicView

To use BasicView, inherit that simply.:

class Greeting(BasicView):
    def __call__(self):
        return self.redirect_route('top', v=1)

Contributors

  • Atsushi Odagiri, Original Author

Changelog

0.2 (2013-03-11)
  • add softification API
0.1 (2013-03-10)
  • first release

Subscribe to package updates

Last updated Sep 20th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.