tags:

views:

54

answers:

1

Is there an automatic way I can use to rename a pylons controller? If I have to rename the controller manually which all files and filenames do I have to change. Thank you much!

+1  A: 

You need to rename the file containing the controller, as well as the name of the controller class itself within the file. As far as I know there is no automatic way to do this, although if you have many controllers to rename it might be worth the time to write a special script to do it for you.

As discussed on the pylons-discuss group, it would be nice if the class within the controller file was generic, so it did not also have to be changed:

controllers/__init__.py
controllers/foo.py:
    class Controller...
controllers/bar.py:
    class Controller...
Justin Ethier
Thanks! Just another note for newbies like me, PLEASE REMEMBER TO CHANGE THE REFERENCES TO THE CONTROLLER FOR YOUR "TEMPLATES" AND "ROUTES".
Shao
Also the functional tests for the controller.
Shao