The RestControllerCommand class is accessible via the pylons.commands module.
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
"\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 "
See the source for more information.