[Grok-dev] traject, megrok.traject released

Martijn Faassen faassen at startifact.com
Mon Nov 16 07:23:05 EST 2009


Hi there,

I've just released megrok.traject and traject:

http://pypi.python.org/pypi/megrok.traject

http://pypi.python.org/pypi/traject

Traject is inspired by various routing systems (such as bobo) and 
megrok.trails by Brandon Rhodes. It provides a routing system for Grok.

Traject is different from most routing-systems in some ways:

* the route goes to a model, not a view. You just declare the views
   on the model. In this is it similar to megrok.trails.

* the system is aware of locations (__name__ and __parent__) meaning
   that urls and security can be made to work for objects that are
   published on a traject.

traject is a framework independent Python library, and megrok.traject 
integrates it into Grok. The idea is that you can turn your application 
root (or any other object) into a jump-off point for trajects.

Traject is especially useful for integrating relational databases in 
Grok. It is an alternative for the megrok.rdb approach. With megrok.rdb, 
the developer is required to provide a relational database model that 
can be traversed by Grok. This slightly extends normal SQLAlchemy pattenrs.

With traject, the developer can publish any relational database model to 
the web (or anything else) - the model itself doesn't have to know 
anything about Grok. Traject may therefore better fit a development 
model where the relational model is more separate from the applications 
that use it. SQLAlchemy can still be used (that's what I use with 
traject), but the models can be "pure" and unaware of the web.

I believe traject is interesting as it still supports declarative 
model-driven development and all the Grok functionalities for URL 
generation and security, while fitting that into a routing approach.

Regards,

Martijn



More information about the Grok-dev mailing list