#1640: Refactor and improve quickstart templates
------------------------------------------+---------------------------------
 Reporter:  chrisz                        |        Owner:  Chris Arndt 
     Type:  task                          |       Status:  assigned    
 Priority:  normal                        |    Milestone:  1.1.x bugfix
Component:  TurboGears                    |      Version:  1.0.4b3     
 Severity:  normal                        |   Resolution:              
 Keywords:  quickstart templates tempita  |  
------------------------------------------+---------------------------------
Changes (by Chris Arndt):

  * owner:  anonymous => Chris Arndt
  * status:  new => assigned

Old description:

> The quickstart templates of TG 1.0 should be refactored and improved in
> TG 1.1.
>
> The problem is that some templates are duplicating others (e.g.
> root._py_tmpl in tgbig is a copy of controllers.py_tmpl,
> and the external tggenshi package also copies several templates) which is
> violating DRY and led to several bugs in the past because people forgot
> to update the copies (see also ticket #1457). We probably need to change
> the quickstart template hierarchy to use multiple inheritance for the
> different aspects of a project (model, view, controller, directory layout
> etc.).
>
> When the project templates for the views will be properly separated from
> the rest of the project, it will be also easier to support more than one
> templating language (e.g. Kid for backward compatibility or Mako for
> performance).
>
> Another problem is that the choice of names for the quickstart templates,
> packages and directories in TG 1.0 is very  inconsistent and obscuring
> the connections between them. Currently we have the following mess:
>
> || '''template''' || '''package''' || '''directory''' ||
> || `BaseTemplate` || qsbase || tgbase ||
> || `TurbogearsTemplate` || quickstart || turbogears ||
> || `TGBig` || quickstartbig || tgbig ||
> || `TGWidgetTemplate` || widget || tgwidget ||
>
> Another idea is to replace the use of Cheetah in the quickstart templates
> with [http://pythonpaste.org/tempita/ Tempita] which is pure Python and
> more lightweight than Cheetah, integrates well with Paste and will
> probably be required by TG 2.0 anyway, since it is needed by weberror.
> Then those who don't use Cheetah for web templating will not need to
> install Cheetah for TG any more.
>
> There are also a lot of DRY issues in the quickstart/update command
> classes (and probably the other tg-admin commands too) and the template
> classes are misplaced in quickstart.py, they should live in the
> qstemplates package. The `command.quickstart` module should be refactored
> to amend this.
>
> We also need automated tests for the quickstart command with all its
> options (this is #792). These tests should not only verify that
> quickstart creates the proper project layout, but also run the unit tests
> of the quickstarted projects.
>
> Summary of the suggested tasks:
>
>  * create a better quickstart template hierarchy separating model, view
> and controller files as well as the project directory layout (small, big)
>  * use consistent names for these templates
>  * use Tempita instead of Cheetah in all quickstart template
>  * maybe support more than one templating engine (e.g. Kid, Genshi, Mako)
>  * refactor `command.quickstart` (and maybe other modules in the
> `command` package as well)
>  * automated tests for quickstart and quickstarted templates

New description:

 The quickstart templates of TG 1.0 should be refactored and improved in TG
 1.1.

 The problem is that some templates are duplicating others (e.g.
 root._py_tmpl in tgbig is a copy of controllers.py_tmpl,
 and the external tggenshi package also copies several templates) which is
 violating DRY and led to several bugs in the past because people forgot to
 update the copies (see also ticket #1457). We probably need to change the
 quickstart template hierarchy to use multiple inheritance for the
 different aspects of a project (model, view, controller, directory layout
 etc.).

 When the project templates for the views will be properly separated from
 the rest of the project, it will be also easier to support more than one
 templating language (e.g. Kid for backward compatibility or Mako for
 performance).

 Another problem is that the choice of names for the quickstart templates,
 packages and directories in TG 1.0 is very  inconsistent and obscuring the
 connections between them. Currently we have the following mess:

 || '''template''' || '''package''' || '''entry point name''' ||
 || `BaseTemplate` || qsbase || tgbase ||
 || `TurbogearsTemplate` || quickstart || turbogears ||
 || `TGBig` || quickstartbig || tgbig ||
 || `TGWidgetTemplate` || widget || tgwidget ||

 Another idea is to replace the use of Cheetah in the quickstart templates
 with [http://pythonpaste.org/tempita/ Tempita] which is pure Python and
 more lightweight than Cheetah, integrates well with Paste and will
 probably be required by TG 2.0 anyway, since it is needed by weberror.
 Then those who don't use Cheetah for web templating will not need to
 install Cheetah for TG any more.

 There are also a lot of DRY issues in the quickstart/update command
 classes (and probably the other tg-admin commands too) and the template
 classes are misplaced in quickstart.py, they should live in the
 qstemplates package. The `command.quickstart` module should be refactored
 to amend this.

 We also need automated tests for the quickstart command with all its
 options (this is #792). These tests should not only verify that quickstart
 creates the proper project layout, but also run the unit tests of the
 quickstarted projects.

 Summary of the suggested tasks:

  * create a better quickstart template hierarchy separating model, view
 and controller files as well as the project directory layout (small, big)
  * use consistent names for these templates
  * use Tempita instead of Cheetah in all quickstart template
  * maybe support more than one templating engine (e.g. Kid, Genshi, Mako)
  * refactor `command.quickstart` (and maybe other modules in the `command`
 package as well)
  * automated tests for quickstart and quickstarted templates

-- 
Ticket URL: <http://trac.turbogears.org/ticket/1640#comment:6>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to