From: Ian B. <ia...@co...> - 2003-05-05 18:03:51
|
On Wed, 2003-04-30 at 16:11, Nick wrote: > On Wed, 2003-04-30 at 15:46, Ian Bicking wrote: > > I would subclass RelatedJoin, changing the performJoin method. In > > general I think any table that doesn't have a key should be represented > > with a join, and rows in that table won't be turned into full objects. > > That means they won't be mutable, but it shouldn't be a problem to just > > add and delete rows instead of changing them. > > Yes, that's pretty much how I did it with my old framework. However, > this can create a *lot* of write queries if you're changing a bunch of > different columns. Which goes back to the whole transaction discussion. Another option might be an extend method for joins, e.g., addAddress() and extendAddress(). That could be turned into a single INSERT. For deleting, I'm less sure. Though clearAddresses() might be a possibility. There's also the possibility of making the (example) .addresses into an object more like what you get from .select(). That is, it would allow list operations, and batch them. So you'd get somePerson.addresses.extend(addressList), and somePerson.addresses would be an iterator that also had list-like methods (but you'd have to use list() to actually get a list from it). Ian |