Skip to content

SQLObject Woes

Don’t get me wrong, I still love SQLObject. The way it abstractifies database engines is very nice, and the way it treats SQL code in a pythonic way is absolute poetry. But it doesn’t seem ready for primetime.

Two things that have been painful this last week:

  • Evidently, you can’t have a boolean table column named “dirty” in SQLObject, because it uses it for internal voodoo. I was getting recursion errors for a couple hours that I couldn’t trace down this weekend until I guessed about the “dirty” flag. They do the same black magic with their “id” table column. Now, there has to be a better way of implementing their code so there’s no overlaps. Private variables? Namedspaced variables? compile-time warnings?
  • No way to do orderBy=RAND() in SQLObject queries. I would think this is a common feature people would want. Google yielded no attempts at solutions, and the SQLObject discussion forums had a thread full of suggestions that don’t work

Sigh.

Also on a pythonic note, our benevolent dictator Guido had a good post today requesting advice on python web frameworks. Reading the quite-good comments-discussion that ensued, this just reaffirms my belief that there are many, many options for python web development platforms/frameworks, but no one real good ones. In the gamut between painfully feature-lacking to woefully overcomplicated, there are plenty of options on the peripheries… but nothing in the sweet spot. Where is the Rails of the Python world?
A few notes on the comments:

  • It looks like Aaron finally released webpy a week ago. It looks a little feature-lacking still, but definitely going in the right direction. Need to check that out. I respect the zen-like simplicity/usefulness of Aaron’s code, and his coding philosophy.
  • I need to buckle down and try out paste someday too.
  • TurboGears might probably be very good when it makes it to 1.0

</nerdery>

2 Comments

  1. bacid

    Have you tried Ruby language? It has quite good database object system.

    Posted on 09-Mar-06 at 08:04 | Permalink
  2. mote

    Yes, I love Ruby’s approach–in fact, IIRC, SQLObject was inspired by the Ruby mindset.

    Posted on 05-Apr-06 at 22:07 | Permalink