Skip to main content

Making a Time Tracker in TurboGears

· 2 min read

2006/30/7 Since may people may come from 42, I suggest you to download the full instruction at TurboGears Trac, you'll see full instruction to make it.

This article is motivate by the framework comparison screencast performed by Sean Kelly. I found this screencast from TurboGears group. the screencast compare J2EE , Rails ,Zope ,TurboGears ,and Django. TurboGears did fairly well. but Sean Kelly wasn't using the latest version(~0.9) during his tests.Thus I try to re-imlement the demo by using bunch of exciting new features (Model Designer, CatWalk, DataController...) introduced in the latest TurboGears version.

Origin version in ScreenCast

The screencast implement page like this, there is a add only interface, no editing.

And it cost 2 python source files 49 lines of code, 2 page of templates, 53 lines of code, not a hundred lines of code.

Re-Implement version with latest svn(#885)

Its time catch up with Sean Kelly's demo in latest TurboGears version. The re-implement with latest Turbogears svn like this. TurboGears > 0.9 provide autogenerate Editor(Catwalk) in Admin Panel(Toolbox)

We can get another running mode editor(much usefull for real app) with DataController by several lines of code.

the re-implement version cost 2 python source files (now Turbogears config file is in python) 6 lines of code, 0 page of templates, not a ten lines of code. The re-implement version also include a full-functional database-relation editor.

Turbogears automatically generate pages for you both in admin and practice perspective. In Turbogears you can customize DataController and other widgets' looking and feel to fit your layout style.