From: Simon Cross <hodgestar@gm...> - 2006-01-20 12:35:05
I've been using SQLObject for awhile now and quite liking it, but
something which causes me a lot of pain is the way the
.dropJoinTables, .createJoinTables and .clearJoinTables methods of the
SQLObject class operate.
Currently all three methods decide whether to act on an intermediate
if join.soClass.__name__ > join.otherClass.__name__:
This works well if both tables in the join are being dropped, created
or cleared but causes all kinds of headaches if you're only acting on
one of the tables. For example, I currently have an application which
needs to clear all data from a table and associated intermediate
tables before reimporting data. I can't (at least not without writing
my own versions of the methods).
One possibility is to add another option to the methods which causes
them to act on all intermediateTables. This has the advantage of
being backwards compatible and solving the immediate problem.
However, I'd rather completely rewrite the methods so that they
default to acting on all intermediate tables and check to see whether
the tables exist before deciding on what to do. The reason I'm
advocating this more drastic action is that the current implementation
makes it possible to break an application which uses SQLObject by
changing the name of a class (which seems completely wacked :).
I'm happy to write the changes, but obviously that's pointless if no
one else wants them. :) Comments? Thoughts?
[ hodgestar.za.net ]
In the end, we all choose our own morality.