Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of LageApplication


Ignore:
Timestamp:
04/22/06 20:10:21 (13 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LageApplication

    v3 v4  
    33= Designing for a 'Large' Application = 
    44 
    5 The default TG setup is a little more Pythonic than some web developers are used to, and doesn't lend well to a collaborative development environment that uses SVN for different permissions based on directory structure. 
     5The default TG setup is a little more Pythonic than some web developers are used to, and doesn't lend itself well to a collaborative development environment that uses Subversion to enforce different permissions based on directory structure. 
    66 
    77Most of this can be quickly alleviated with some design ideas. 
     
    1414Introduced in TG 0.9a2 , the tgbig template adds a controllers package to the template. 
    1515 
    16 the single file controllers.py is then replaced with a controllers directory/package that consolidates the root level controllers to controllers/root.py 
    17  {{{ 
     16The single file controllers.py is then replaced with a controllers directory/package that consolidates the root level controllers intto controllers/root.py: 
     17 
     18{{{ 
    1819        tg-admin quickstart -t tgbig  
    19  }}} 
     20}}} 
    2021 
    2122creates 
     
    2627 
    2728=== The Other ways === 
    28 Some people prefer an alternal approach.  Several on the Newsgroup seemed to have implemented variations on the tgbig behaviour 
     29Some people prefer an alternate approach.  Several on the Newsgroup seemed to have implemented variations on the tgbig behaviour. 
    2930         
    3031==== The FastTrack way ==== 
     
    4344}}} 
    4445  
    45 Note that model needs to be specifically addressed in regards to namespace when being imported 
     46Note that model needs to be specifically addressed by namespace when being imported. 
    4647 
    4748==== Another way ==== 
     
    5253which contains things like:  
    5354controllers/  
    54     blog_controller.py  
    55     forum_controller.py  
    56     login_controller.py  
    57     json_api_controller.py  
    58     ...  
     55    blog_controller.py  
     56    forum_controller.py  
     57    login_controller.py  
     58    json_api_controller.py  
     59    ...  
    5960For controller.py then:  
    6061from controllers.blog_controller import BlogController  
     
    6364from controllers.json_api_controller import JsonApiController  
    6465class Root(controllers.RootController):  
    65     blog = BlogController()  
    66     forum = ForumController()  
    67     login = LoginController()  
    68     json_api = JsonApiController()  
     66    blog = BlogController()  
     67    forum = ForumController()  
     68    login = LoginController()  
     69    json_api = JsonApiController()  
    6970}}} 
    7071 
    71 if this method is used, the start-APPNAME.py script must be altered to reference controller.py 
     72If this method is used, the start-APPNAME.py script must be altered to reference controller.py. 
    7273  
    7374=== The Difference Between the Two Approaches === 
    7475 
    75 The main difference between the approaches is that tgbig is more 'pythonic' -- controllers is a package, with root.py being the main controller.  the alternate methods are more simlar to other web frameworks, and keep controller(s).py as the main controller and mount a tree of controllers under it - much like a tree of directories on a web server. 
     76The main difference between the approaches is that tgbig is more 'pythonic' -- controllers is a package, with root.py being the main controller.  The alternate methods are more simlar to other web frameworks: they keep controller(s).py as the main controller and mount a tree of controllers under it, much like a tree of directories on a web server. 
    7677 
    7778=== Related Newsgroup Postings: === 
     
    8182== The Templates == 
    8283 
    83 The way to get templates into subdirectories seems to change based on TG revisions - I tried some tricks from the newsgroup ( Some people said import each template directly, others created controllers to juggle namspace issues ) but none worked on .09a4.   
     84The way to get templates into subdirectories seems to change based on TG revisions - I tried some tricks from the newsgroup (some people said import each template directly, others created controllers to juggle namspace issues) but none worked on 0.9a4.   
    8485 
    85 What does work on 0.9a4 , is this: 
     86What does work on 0.9a4 is this: 
    8687 
    87  *  For any subdirectory in templates, 'touch __init__.py' - TG/Kid/Cherrypy needs it (all versions) 
    88  *  For any template that inherits , use relative urls to the inherited document -- ie: py:extends="'master.kid'" should be py:extends="'../master.kid'" 
     88 *  For any subdirectory in templates, 'touch {{{__init__.py}}}' - TG/Kid/Cherrypy needs it (all versions) 
     89 *  For any template that inherits, use relative urls to the inherited document -- ie: {{{py:extends="'master.kid'"}}} should be {{{py:extends="'../master.kid'"}}}. 
    8990 
    9091== The Benefits == 
    91 Aside from cleaning up the files and letting a team work on components seperately, you get the benefit of using SVN to indpendantly manage permissions 
     92Aside from cleaning up the files and letting a team work on components separately, you get the benefit of using SVN to indpendently manage permissions. 
    9293 
    9394Example: