On Jun 20, 2006, at 9:36 AM, Charles Duffy wrote: > Michael Bayer wrote: >> any chance we can see an example of what kind of usage youre >> looking for ? >> i thought we just were talking about adding an "order by" >> property to an >> ActiveMapper relation (which is pretty trivial) ? > > It's pretty trivial, except that the order_by value is expected to > be a > a table column (or a list of table columns) rather than a string -- so > it needs the same kind of logic that's done for resolving relations > (since using ActiveMapper allows classes to be specified before all > the > Table objects they refer to exist, parts of the class > initialization may > need to be deferred until the relevant tables are defined; the same > thing applies here, since the tables whose columns we're ordering > by may > not exist yet[*]). >
thats not very hard. when the activemapper turns its values into a Mapper/Table, it has to create the Table first; before the order_by property is needed. so the table is there with which to get the Column from. > Adding support for arbitrary additional values (as opposed to just > sort_order) is even more hairy, since we don't know which arguments > the > mapper may accept in the future -- hence, support for search-and- > replace > to find reference objects and replace them with actual tables or > columns > once the tables and their columns have been defined. well this would be dealt with on a case-by-case basis. at worst you can specify callables to defer their execution but i dont think that would usually be needed. this is where the example use cases would drive the implementation. if you truly want to send all kinds of customizing arguments to the underlying mapper/relation, that might be the point at which you start dealing with explicit mappers and tables anyway. activemapper objects should coexist very easily with explicitly mapped classes. _______________________________________________ Sqlalchemy-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

