From: Brad B. <br...@bb...> - 2003-07-24 18:16:59
|
On Thu, Jul 17, 2003 at 01:41:02PM -0500, Ian Bicking wrote: > On Thu, 2003-07-17 at 11:09, Fran?ois Girault wrote: > > Hi all, > > > > here's another feature I need for my project : I have several tables > > whose primary key is composed of two or three columns. > > Well, if there's going to be composite keys, that might as well be > generalized to all the columns (i.e., any attribute could be a composite > of several columns). What's the use case for this? Composition seems fairly specific to primary key definitions; I don't see it useful as a general purpose thing that belongs in SQLObject column definition semantics. I would have thought it preferable to define columns as normal, and then create another property to abstract them. e.g. (slightly contrived, and totally untested) class Date(SQLObject): day = IntCol() month = IntCol() year = IntCol() def get_date(self): return "%d/%02d/%02d" % (self.year, self.month, self.day) def set_date(self, value): self.year, self.month, self.day = [int(x) for x in value.split("-")] date = property(get_date, set_date) -- Brad Bollenbach BBnet.ca |