On 3/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I would like to see various examples of how multiple controller files > are used in the real world within TG. This thread has grown so large > and no one has shared any concrete examples yet. :) Anyone? Anyone?
I see that you have already gotten much advice, let me share my setup which is slightly different. I have been using it to develop a javascript web application for handing job applications. There is only one controllers.py which contain: RootController PersonController DocumentController CompanyController ContractController I dont know if there is a right way to divide your functionality into controllers. In my case, each controller (except for the RootController) maps to a database table. The controllers are used by the javascript frontend to send and receive JSON:ified XmlHttpRequests and they basically only acts as a thin layer doing validation and smoothing out the ugly realities of the database so that the javascript doesn't see it. The javascript application is written using qooxdoo which is a totally kickass web gui toolkit. > I have a controllers.py that must be 1000 lines now, and it is just > getting a bit long. I need to cut it up, but am not sure of the best > way. I know I need to create some "helper classes" to separate out > certain functionality that is not related to url-mapping, but as far as > having controllers.py as: > controllers/ > __init__.py > detail_controller.py > add_entry_controller.py > etc... As I said, I don't know the right way to create controllers. But an "add_entry_controller" doesn't make any sense to me. IMHO controllers are classes and as such they should be subjects and represent some kind of object. "add entry" is more of a verb and sounds like a name I would give a method instead. -- mvh Björn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

