google
yahoo
bing

TG2: after 3 and a half months and 6 beta releases

Last time I wrote about TG here I said I was committed to get  TGb1 out of the door and that was December 15th, 2008, wow time runs by when you are having fun. Lets see, today is March 1 that’s 3.5 months exactly or 76 days according to python.

>>> datetime.date.today()-datetime.date(2008,12,15)
datetime.timedelta(76)

Since then we have had TG2b1, TG2b2, TG2b3, TG2b4, TG2b5 and TG2b6 which averages us to one release every 12 days! that’s a lot of work!, to be fair it’s more like 15 days each as b4 was short lived due to …. that’s in the pass who cares :)

TG2b1 had 47 tickets It was basically a cleanup release and we applied a ton of patches from trac, the most notable thing is the upgrades for repoze.what, with Gustavo making a clear goal to get this package in shape for real world usage.

TG2b2 had 12 tickets Was mainly Marks work, He fixed our WebError to look nice and fixed the error controller (after I failed at understanding it) then he fixed tg.url to work with the newest pylons.url (pylons 0.9.7b4 I think) which was 15% faster (or some nice number) due to some optimizations from benbangert.

Tg2b3 had 16 tickets and was probably the most important of the betas, even though it had such a small ticket count, as it gave us a ton of features mostly from the hand of Christopher Perkins,

He gave us the very cool content type request dispatch, which despite the name it’s something not that scary and very powerful. You simply add .json to a url that’s behind a controller with @expose(’json’) and it will give you ‘application/json’, this works with minetypes so it will allow you to build any type of file on the fly. Or simply serve different requests from the same controller, for example .xml, .json and.html could serve as legacy API, ajax and  browser, all from the same controller!

The other very nice feature by Chris is the RestController (RC) and it’s extension CrudRestController (CRC) (in the package tgext.crud) which is the base for tgext.admin and Catwalk2. Wow that’s a lot of names. I saved this from IRC which I think explains it nicely.

1 percious_: Sprox = SA + TW
2 percious_: RC = Restful Dispatch
3 jon1012: hey guys
4 percious_: CRC = Forms/Fillers/Tables + RC
5 percious_: Admin = CRC + config + index page
6 elpargo: hi jon1012
7 percious_: Catwalk = Admin + TG-quickstart-specific Config
8 percious_: hi jon1012
9 elpargo: awesome I’ll turn that into a doc soon TM
10 percious_: catwalk is a dumb name we should probably eliminate…
11 pjenvey_: holy acronyms, batman
12 percious_: sounds awesome
13 percious_: AC = Admin Controller
14 percious_: CRC = CrudRestController
15 percious_: RC = RestController
16 percious_: SA = SqlAlchemy
17 percious_: TW = ToscaWidgets

still too cryptic? ok, here are some words. You start with the very basic SQLAlchemy definitions and ToscaWidgets then you have sprox which links one to the other with some very nice basic Widgets, then you take a rest controller and make available over the web as a resource, then you take a group of resources and transform it into a CRUD with CrudRestController, then you take a group of CRCs and transform them into an AdminController, or you could just skip all that and let Catwalk2 give you a very nice set of defaults. From all this I find CRC to be the best for most applications it’s a very nice sweet spot between fully automatic and fully by hand. And I strongly think this is the best tool TG2 has to offer for database driven applications (sorry Rum I know you are very good but I just can’t customize you)

The other important change in TGb3 was the new flash based on a cookie, instead of the session and this was done by Alberto Valverde (don’t be fool by his blog, he is very active coding). This is a rather interesting feature mainly because it will allow you to cache your application. And in the best of WSGI spirit this was released as a separate package.

The last important change here was a small project started by Alberto and your trully, it’s a base class inside TurboGears named WSGIAppController and a package named tgext.wsgiapps (yet unreleased, although it’s hg is public). The idea behind WSGIAppController is to prepare TG to serve a downstream application. The purpose of wsgiapps is to make controllers for the most popular apps out there (we have Trac, Mercurial, Zine (no link as a vote of protest as it has no setup.py file), and TileCache) and fix all the small little details you will encounter. This is all heavily under-documented but I’ll get around to it ones I have a proper alpha for codemill (but codemill is another post).

The next feature (I believe this was here correct me if I’m wrong).  jon1012 and florent (hi french people) sat down and gave the TG quickstart a totally fresh look and not conformed with that they made a very nice tutorial for new people. The new CSS is very nice and clean and will serve as a nice base for any project.

TG2b4 was another bugfix release and it had a very small ticket count (just 2) this was because most of the work happen outside of TG, and it was a bugfix release, with so many feature in b3 we had to find some bugs didn’t we?

TG2b5 was another biggiee (21 tickets) and it saw many more enhancements to the auth & auth stack, with the last set of features from Gustavo to make this super configurable, we also had the __before__ added to TG which is a very nice feature from people comming from pylons and the error controller now has a nice styling (again thanks Mark!)

And last but not least TG2b6 which was a little overdue (mainly because mramm has a life and couldn’t cut us a release). This was another rather big release as everyone was rushing to get their fixes in before feature freeze and made a total ticket count of 27 I’m a little bias here so I’ll say what I did first. We now have a new (and awesome) default model unit test class which was originally given to me (for private code) by percious and I finally manage to sneak into TG2, it makes testing your model as simple as creating an instance of each class with such a nice api that it doesn’t even needs docs (yes I know I’ll write them), on top of that I commited a cleanup of the dependencies which makes the installer a lot smaller and made TG2 pip compatible, you know because everyone loves pip. On the auth front Gustavo’s work was so good that people from pylons wanted to use his repoze.what package so he split TG’s functionality into repoze.what-pylons and also enhanced the whole thing to look a little more like TG1 identity which allows a far better use with less surprises.

Also here (I believe) one of our ‘08 google summer of code students (now active contributor) all the way from India Mr. Sanjiv Singh (ok that was too much of an intro) , updated the tgext.geo package to be a flag in quickstart. So now you can enjoy all his geo goodness with 5 keystrokes (–geo)

So there you have it that’s the super small summary of what We (TurboGears people) have been up to in the last… wow I still can’t believe it’s been 3.5 months.

What’s next? of course TG2.1! We are already building up on tickets for that. But before we get our hands on the coding we need to get the rc and final out and write some documentation and some more documentation yes that is confusing we are moving from a “component documentation” to a “type documentation” but most tickets are still in the wrong slot. Anyway it’s all work to be done and needs reviews as well as comments from newbies and pros alike. TG2 is here and ready to rock now lets test it in the wild so we can write docs, posts and patches, to get a TG2.0!

Oh and see you at pycon!

5 comments ↓

#1 Sanjiv Singh on 03.02.09 at 9:16 am

Nice post Jorge. But did you miss a release here? TG2b5.1 :)

#2 mae on 03.02.09 at 4:28 pm

@Sanjiv, that was so bomb it didn’t even had a milestone.

#3 chuntley on 03.02.09 at 6:07 pm

Isn’t December 15 to March 1 two and a half months? Maybe that’s why it didn’t feel like three and a half. ;-)

#4 Florent on 03.03.09 at 4:30 am

Hey Jorge,

something that had a lot of work is the new renderer system:

http://trac.turbogears.org/ticket/2175
and
http://trac.turbogears.org/ticket/2192

where we not only fixed bugs, but also optimized greatly the rendering time for mako (50% less time) and others (~3%).

Cheers!

#5 mae on 03.11.09 at 12:22 am

@chuntley, ahhh right I asked for reviews on #turbogears before posting and you where not there to point this out :)

@Florent, yes sorry I totally forgot those sorry mate, I focus mostly on the features and stuff from the changelog (where those 2 on the changelog?)

Leave a Comment