Latest Version: 0.9.6.2

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

Attributes

a description

None

a group_name

'pylons'

a hidden

False

a max_args

2

a max_args_error

'You must provide no more than %(max_args)s arguments'

a min_args

2

a min_args_error

'You must provide at least %(min_args)s arguments'

a parser

<paste.script.bool_optparse.BoolOptionParser instance at 0x241d5a8>

a summary

'Create a REST Controller and accompanying functional test'

a usage

"\nCreate a REST Controller and accompanying functional test\n\n    The RestController command will create a REST-based Controller file for use\n    with the map.resource REST-based dispatching. This template includes the\n    methods that map.resource dispatches to in addition to doc strings for\n    clarification on when the methods will be called.\n\n    The first argument should be the singular form of the REST resource. The\n    second argument is the plural form of the word. If its a nested controller,\n    put the directory information in front as shown in the second example\n    below.\n\n    Example usage::\n\n        yourproj% paster restcontroller comment comments\n        Creating yourproj/yourproj/controllers/comments.py\n        Creating yourproj/yourproj/tests/functional/test_comments.py\n\n    If you'd like to have controllers underneath a directory, just include\n    the path as the controller name and the necessary directories will be\n    created for you::\n\n        yourproj% paster restcontroller admin/tracback admin/trackbacks\n        Creating yourproj/controllers/admin\n        Creating yourproj/yourproj/controllers/admin/trackbacks.py\n        Creating yourproj/yourproj/tests/functional/test_admin_trackbacks.py\n    "

Methods

f __init__(self, name) ...

f command(self) ...

Main command to create controller

See the source for more information.

Top