2008/12/10 Christoph Zwerschke <[EMAIL PROTECTED]>:
>
> Mark Ramm schrieb:
>> If you're interested in joining this support team, please let us know.
>> If you think you can help get it organized and make sure that it
>> runs smoothly defintely let us know.
>
> It's good to see TG2 making progress. So far I've focused on TG 1.x
> which I'm using for my productive apps, but I'd also like to work
> with/on TG 2 in the future. I think the main reason why I didn't really
> look into TG 2 so far was that I never used Pylons, so I feel I first
> need to get aquainted with Pylons, but haven't found the time so far. It
> would be nice to have a kind of Pylons crash course available, or a
> "everything a TG user needs to know about Pylons" article. Maybe
> something like this already exist? Can you give a good starting point
> and roadmap for learning Pylons and TG 2?
Christoph,
I feel that my impressions of learning TG 2 are getting stale. I'm
going to share some random notes with you (and everybody else) before
it's to late... :) Sorry for long email.
Like you, I had been already using TG 1 for a while when I decided to
give TG 2 a try. This September I started working on a simple TG 2
application. It needs neither auth{entication,orization} nor database,
so I'm not discussing these here.
I would recommend starting from the official docs. In particular,
Getting Started with TurboGears and Tutorials were very helpful. There
were some example code snippets not working as is, but it was pretty
easy to figure out the problem and, probably, some or all of them are
fixed now.
Get familiar with WSGI if you aren't already. TG 2 was my first WSGI
framework. I tried looking at WSGI maybe few years ago. I read the PEP
(OK, everything looks pretty simple), took a look at pythonpaste.org
(what is this all about?!) ... and failed to get started with this
technology. But thanks to TG 2 now I have an idea how WSIG can be used
in practice.
Another good thing is that TG 2 has very small and code base written
in decent PEP 8 Python! I would recommend reading configuration.py
[1] first. This is the heart of the framework where all WSGI set up
happens. This module gives you a good idea of how TG 2 uses all
third-party components, and therefore how you can customize this in
your app. Other notable parts are controllers.py [2] and decorators.py
[3] telling you more details about object dispatch, validation,
rendering and some i18n.
Surprisingly, as of my impression TG 2 is not that much of Pylons from
application developer's perspective. TG 2 is more like a higher level
built *on top* of Pylons, so some concepts/recipes from the later are
not directly usable (decorators, for instance). And without looking at
the source code it's not always clear which things should be imported
from tg and which from pylons or somewhere else.
Decorators are *very* different from TG 1. Actually, now they are much
cleaner and use no magic — it's just hooks. To my knowledge, there's
no any examples in the official docs yet but I have some in my app
[4].
i18n tools are better and easier to use than in TG 1. However, in
general i18n still needs some workarounds [5].
I think the most difficult part of the learning process was
ToscaWidgets. This is a very powerful but complex framework, and when
you start using it, you quickly exhaust the material available on the
official site and in TG 2 docs. However, the source code is also
rather clean and reading some parts of it helped me a lot.
Best Regards,
Timur
[1] http://trac.turbogears.org/browser/trunk/tg/configuration.py
[2] http://trac.turbogears.org/browser/trunk/tg/controllers.py
[3] http://trac.turbogears.org/browser/trunk/tg/decorators.py
[4]
http://code.google.com/p/posy/source/browse/trunk/posy.tg/posy/tg/lib/decorators.py#23
[5] http://groups.google.com/group/turbogears-trunk/msg/21e0e32f43ea4e25
--
Timur Izhbulatov -- www.timka.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---