Latest Version: 0.9.6.2

commands

Paster Commands, for use with paster in your project

The command(s) listed here are for use with Paste to enable easy creation of various core Pylons templates.

Currently available commands are:

controller, restcontroller, shell

Classes

C ControllerCommand(...) ...

Create a Controller and accompanying functional test

The Controller command will create the standard controller template file and associated functional test to speed creation of controllers.

Example usage:

yourproj% paster controller comments
Creating yourproj/yourproj/controllers/comments.py
Creating yourproj/yourproj/tests/functional/test_comments.py

If you'd like to have controllers underneath a directory, just include the path as the controller name and the necessary directories will be created for you:

yourproj% paster controller admin/trackback
Creating yourproj/controllers/admin
Creating yourproj/yourproj/controllers/admin/trackback.py
Creating yourproj/yourproj/tests/functional/test_admin_trackback.py

This class contains 17 members.

C RestControllerCommand(...) ...

Create a REST Controller and accompanying functional test

The RestController command will create a REST-based Controller file for use with the map.resource REST-based dispatching. This template includes the methods that map.resource dispatches to in addition to doc strings for clarification on when the methods will be called.

The first argument should be the singular form of the REST resource. The second argument is the plural form of the word. If its a nested controller, put the directory information in front as shown in the second example below.

Example usage:

yourproj% paster restcontroller comment comments
Creating yourproj/yourproj/controllers/comments.py
Creating yourproj/yourproj/tests/functional/test_comments.py

If you'd like to have controllers underneath a directory, just include the path as the controller name and the necessary directories will be created for you:

yourproj% paster restcontroller admin/tracback admin/trackbacks
Creating yourproj/controllers/admin
Creating yourproj/yourproj/controllers/admin/trackbacks.py
Creating yourproj/yourproj/tests/functional/test_admin_trackbacks.py

This class contains 17 members.

C ShellCommand(...) ...

Open an interactive shell with the Pylons app loaded

The optional CONFIG_FILE argument specifies the config file to use for the interactive shell. CONFIG_FILE defaults to 'development.ini'.

This allows you to test your mapper, models, and simulate web requests using paste.fixture.

Example:

$ paster shell my-development.ini

This class contains 17 members.

See the source for more information.

Top