Hi all,
I think combining Subway and TG under the TG name would end the web
framework wars. As of right now (I haven't talked to anyone related to
TG about these ideas), I would propose the following:
- Do the merge as patches and changes to TG to integrate some of
Subway's features into TG rather than break complete TG compatibility
and use a new codebase, as TG is far more popular and as such should
not have any gigantic sweeping changes.
- Integrate Subway's form handling. I think Subway's form handling
system is innovative and a very productive way of validating forms. TG
seems to be a bit lacking in form validation, anyway, so I think this
won't be too controversial.
- CherryFlow would be a quick addition to TG that wouldn't require much
else other than some refactoring and some documentation.
- Change TG's controller style slightly. In Subway, we opted for
multiple .py files with functions rather than classes with methods.
This is _not_ the big picture, however. The important thing was that
Subway automatically assembled the tree of controllers rather than
forcing the user to add attributes to their root controller manually.
On my hacked up local SVN of TurboGears, I implemented a minor change
which allows the user to write classes like this:
class MyRoot(controllers.Controller):
mount_path = "/"
# methods would go here
and they would be automatically assembled via a metaclass. I'd also
propose making controllers a package and not a module, since a lot of
code will go in there and it would be easier to split up into multiple
.py files. In addition, using the new mount_path system would let us
just do a "from controllers import *" to set up the controller tree. I
can post my updated code if anyone's interested.
- Templating. I cannot stress enough how important it is for TG to
emphasize ONE and ONLY ONE templating language (we don't want another
templating war). I also feel that Cheetah is far superior to Kid in
terms of performance, extensibility, and the ability to process
malformed HTML documents and create non-XML formats such as CSS and
plaintext. That said, however, I think TG should stick with Kid, even
if we merge, because applications are already built with it and
changing the templating language at this stage would be a Bad Idea.
- Full integration with Python Paste could be a good idea, too. Subway
used to do it, but Paste was changing too quickly for us to keep up,
and we haven't had support for it for a while.
Alright, that's all I have for now for ideas with the merge. Thoughts?
Ruby books are now outselling Python books; let's do something about
it!
Peter Hunt