This site is an archive; learn more about 8 years of OpenHatch.

[OH-Dev] helpers vs. controllers

Asheesh Laroia asheesh at asheesh.org
Thu Mar 21 18:48:23 UTC 2013


On Wed, 20 Mar 2013, Nathan Yergler wrote:

> This is an excellent idea. Explicit is better than implicit.

Okay! Then let it be decided:

<decided>

Code style guideline:

If you are adding a function that assists with calculating a view, but it 
is not a view itself, you should generally put it in a file called 
view_helpers.py.

</decided>

There's a lot of code moving that switching to this will entail.

The best way to find code that should change is to:

* Open up a views.py file, and look for where it uses something from a 
file callled 'controllers'. Any such use is one that should change.

* Open up that 'controllers.py' file, and find (or create) a corresponding 
'view_helpers.py' file. Move the code from controllers.py into 
view_helpers.py.

* Adjust all the imports you can find, and then run the test suite. 
Commit!!!

* Repeat.

Do submit pull requests/patches for these changes as soon as possible!!

These code rework projects can affect other people as they make their own 
changes, so synchronizing sooner rather than later is extremely a good 
idea.

-- Asheesh.


More information about the Devel mailing list