> because an attribute can be mapped to multiple columns, > i.e.http://www.sqlalchemy.org/docs/orm/mapper_config.html#mapping-a-class....
Ahh... thanks. > as I did this example and thought back upon how often people want to poke > around the mapper configuration, i started trying to think of how to turn the > mapper hierarchy into a more of a well described DOM-type of system. In > this case one thing I thought of would be to add a "first_column" accessor to > ColumnProperty. > because an attribute can be mapped to multiple columns, > i.e.http://www.sqlalchemy.org/docs/orm/mapper_config.html#mapping-a-class.... Ah... thanks. > as I did this example and thought back upon how often people want to poke > around the mapper configuration, i started trying to think of how to turn the > mapper hierarchy into a more of a well described DOM-type of system. In > this case one thing I thought of would be to add a "first_column" accessor to > ColumnProperty. Allowing multiple columns does make it more DOM-like. But once you know ColumnProperty.columns is a sequence (eg: I didn't), columns[0] is just as good as "first_column". I know very little about your internal implementation, but I might as well toss a thought out there on navigating a mapper configuration... it would be more intuitive/explicit to me if there were a DbColumnProperty base class, and two derived classes: SingleDbColumnProperty and MultiDbColumnProperty (and I guess you would need RelationProperty, and probably more). The former with a simple .column attribute, and the latter with your current .columns sequence attribute. The current situation of checking for the existence of a ".columns" attribute to find real persistent data is not that intuitive. It would be nicer to look through the mapper properties for DbColumn instances. Also, I would bet that the vast majority of implementations would be SingleColumnProperty, so the niggly detail of columns[0] wouldn't exist (although that would obviously break a lot of existing code, unless SingleColumnProperty always had single entry .columns... but then that is what you have now). Overall it is great right now and my commentary is probably pointless and/or naive. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.