quickstart: tggenshi template overwrites the Elixir model

Description

tg-admin quickstart -i -e -t tggenshi starts an project with a standard SQLAlchemy model.py, rather than an Elixir model. Removing the tggenshi template from the quickstart sets up an Elixir model.py properly. It seems that the tggenshi template overwrites the Elixir model.

Change History

The model.py_tmpl file in the qsquickstart package - which provides the "tggenshi" template - is out of date, is does not contain support for Elixir yet.

Since the model.py in a project does not differ according to whether Kid or Genshi is used, we can just copy over the model.py_tmpl file from the quickstart template from the 1.0 branch. The attached patch does just that and also fixes an error in dev.cfg_tmpl and app.cfg_tmpl.

Ideally, gsquickstart should inherit from a template that contains the model.py_tmpl file, and not overwrite it, for example the "quickstart" template. But the "quickstart" template also contains the Kid templates, which are not needed for a project with Genshi templates. Maybe we need to restructure the template inheritance and provide a base template for TG application projects.

The tggenshi template should really inherit from the quickstart template and just overwrite the setup.py and the <package>/config/app.cfg file and add the genshi templates. The attached patch does that.

One problem with this approach: when you quickstart a project, the quickstart (paste) template will add some Kid template files and the tggenshi (paste) will delete them after it has created its Geshi templates. But when you run tg-admin update -t tggenshi in your project dir, the Kid templates will be created again. Now the tggenshi template can not just delete them again, because they might have been created eralier and on purpose by the developer.

What the new code does is: if it is an update command, prompt the user, if the files <package>/templates/{login,master,welcome}.kid should be removed (for each file). The default answer is 'n'.

Ultimately, as I said before, the template inheritance structure should be improved, but that will happen only in TG 1.1.