Huy wrote:
IMO Python does not have a powerful enough ORM. Although most of these solutons provide the simple selects, updates, inserts and joins none of them provide good handling of legacy databases or flexibility of using the sql of your choosing (which I think is crucial, there is no point doing certain things one way and other things another way).

I think in all of them you can use your own SQL, to a degree. In SQLObject the limit is usually in *what* you select, not *how* you select it, so everything after WHERE is up for grabs.


The only ORM tool I know of which provides a good solution to ORM is a java product called ibatis sqlmaps. Any python ORM would do well to have a similar design.

In fact I rolled my own ORM for a client which provides pretty much the same as the ORMs above (although I think it's nicer because it has a beautiful metadata model which can be accessed for generating guis, code etc. and has not restriction of database schema, can handle multi key joins) and after using it for a while I still prefer ibatis for more complex applications.

I think any ORM which enforces a database design (eg. key has to be integer id etc.) is of no use except for the simplest applications.

Well, to the degree that ORMs imply certain conventions, they are usually good conventions, and if you are starting from scratch or have the ability to refactor your database then those conventions aren't that burdensome. And in most cases (at least for SQLObject) there are ways to deal with legacy databases, or ways to create a heterogeneous system where you use an ORM for some tables, and custom SQL for other situations.


If you are thinking in terms of heavily relational queries -- lots of joins, subselects, aggregating, etc -- an ORM generally will feel clunky. Many relational concepts don't map well to Python ORMs. Some of those concepts could be represented in an ORM (but just aren't currently), and some are very difficult to represent.

Looking just briefly at sqlmaps, it looks like a thin object interface on top of custom SQL queries. I'd find that tedious, but if you are going to write custom SQL then I'm sure that's a helpful way to organize the SQL. It's a lot different from Python ORMs, and I think I'd find it a bit clunky. In a way it almost reminds me of Zope's Z SQL Methods, which I hate.

--
Ian Bicking  /  [EMAIL PROTECTED]  / http://blog.ianbicking.org


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Webware-discuss mailing list Webware-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to