On Sep 17, 2007, at 9:53 AM, Barry Hart wrote: > I've started using add_column() as needed to work around this. Our > application tends to have a single, fairly generic filter_sort > function for each class. Some use cases of this function require > add_column() and some don't. From the caller's perspective, the > filter_sort() function is poorly encapsulated because sometimes it > sometimes returns objects and sometimes tuples. > > It'd be very helpful if the add_column() function took an optional > parameter 'omit_from_results' telling whether the column should be > included in the results, then our filter_sort() functions could > always return objects. >
alternatively, ORM can ensure columns are present in the columns clause when used with DISTINCT/ORDER BY. we're trying not to complicate the public API with arbitrary switches and flags. ticket #786 added, as an interim, your filter_sort() can either detect the tuples, or if its just returning the Query object itself, can perhaps patch the individual Query object to not return the tuples (i.e. wrap its instances() method with a de-tupleizer). --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---