Re: [Tutor] when is object relational mapping for Python warranted?
Thank you both to Tim Golden and Jeff Younker for your helpful responses last week [see archive] about ORMs in Python/SQLite. Very helpful, and I'll get around to giving it a try one of these days... Che From: [EMAIL PROTECTED] To: tutor@python.org Subject: when is object relational mapping for Python warranted? Date: Wed, 11 Jun 2008 02:23:13 -0400 (tried to write a descriptive subject line) I'm curious whether I should consider learning either SQLObject or SQLAlchemy, and whether my needs would be worth it. I am learning to use SQlite databases for fairly simple storage and later search, and have only recently learned about object relational mapping (ORM). "Fairly simple" = 4-6 tables with no more than 2-10 fields each, 100-5,000 records, with queries doing basic LIKE and other matches, nothing fancy. I'd like to hear opinions on when it is worth it to use these ORM tools for a Python database application, that is, in terms of the complexity of the database or queries or the application, or when basic Python and SQL is sufficient. It's a personal preference, I'm sure, but I just wanted to get some opinions. Also, if there is an opinion about either of these two ORMs in terms of learning curve, quality, etc. Thanks, Che It’s easy to add contacts from Facebook and other social sites through Windows Live™ Messenger. Learn How. _ Need to know now? Get instant answers with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] when is object relational mapping for Python warranted?
Yes, it's worth it. It makes it trivial to write simple database applications. The smaller the program, the more useful they are. Both SQLObject and SQLAlchemy have their strengths and weaknesses. SQLObject will get you and going up really fast. Its really simple to create a schema and to start working on a project. The most recent version is also acquiring a revision system. SQLAlchemy has a little more overhead, but it ultimately allows you to perform much more sophisticated operations. It also serves as a simpler DBI. My personal take is that SQLAchemy gives you much more growing room, and that this is well worth the initial investment. The documentation for SQLAlchemy tends to be better too. (That said I work primarily with SQLObject, and the addition of a revision system will keep me from switching our product to SQLAlchemy for a while longer.) - Jeff Younker - [EMAIL PROTECTED] - ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] when is object relational mapping for Python warranted?
Che M wrote: I'm curious whether I should consider learning either SQLObject or SQLAlchemy, and whether my needs would be worth it. I am learning to use SQlite databases for fairly simple storage and later search, and have only recently learned about object relational mapping (ORM). "Fairly simple" = 4-6 tables with no more than 2-10 fields each, 100-5,000 records, with queries doing basic LIKE and other matches, nothing fancy. I'd like to hear opinions on when it is worth it to use these ORM tools for a Python database application, that is, in terms of the complexity of the database or queries or the application, or when basic Python and SQL is sufficient. It's a personal preference, I'm sure, but I just wanted to get some opinions. Also, if there is an opinion about either of these two ORMs in terms of learning curve, quality, etc. Good question, I think. My answer would be: pick an ORM to learn anyway. You can't go far wrong knowing what's there and the learning curves are not steep. You've mentioned sqlalchemy and SQLObject. There are also Storm, MotherDb and Elixir (which is an easier layer over sqlalchemy). SQLObject is more mature but sqlalchemy is quite popular and has a lot of community support. The others are relatively new and I don't know too much about them. But the other side of the coin is: when do you need an ORM at all? I'm a professional SQL programmer so I tend to find extra tools getting in the way. If I'm dealing with relational data, I think in SQL and, no matter how good the ORM's syntax, I find it a distraction. But where I *do* find an ORM useful is in dealing with very simple interactions with one or two joins which are handled automatically and which save me writing fairly tedious boilerplate. In short, I use ORMs for small projects, but not for big ones. So far. TJG ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] when is object relational mapping for Python warranted?
(tried to write a descriptive subject line) I'm curious whether I should consider learning either SQLObject or SQLAlchemy, and whether my needs would be worth it. I am learning to use SQlite databases for fairly simple storage and later search, and have only recently learned about object relational mapping (ORM). "Fairly simple" = 4-6 tables with no more than 2-10 fields each, 100-5,000 records, with queries doing basic LIKE and other matches, nothing fancy. I'd like to hear opinions on when it is worth it to use these ORM tools for a Python database application, that is, in terms of the complexity of the database or queries or the application, or when basic Python and SQL is sufficient. It's a personal preference, I'm sure, but I just wanted to get some opinions. Also, if there is an opinion about either of these two ORMs in terms of learning curve, quality, etc. Thanks, Che _ It’s easy to add contacts from Facebook and other social sites through Windows Live™ Messenger. Learn how. https://www.invite2messenger.net/im/?source=TXT_EML_WLH_LearnHow___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor