> >>> if u can make the a query( primary_mapper, select_table) > >>> somehow possible... i won't need separate NPs. Note this > >>> selecttable is not additional .select() off the query, it IS > >>> the starting query(), e.g. thepolymorphic union in a big case > >>> and > >>> base-class-only in a small case. > >> > >> query(class).from_statement(your select) ? > > > > i tried it, my_select would be something which the NP mapper does > > itself now, e.g. select( [class_join], > > base.c.type=='classname')... naah, as i see from srccode this > > misses the whole compile() stuff. i want to be able to do > > additional filtering, ordering, whatever a query can do. > > Note i said the starting query, not the final query... > > what part of the selecting from are you looking for to be replaced > ? the columns clause ? or the criterion ? compilation wants to > add all the columns from the mapper's table, want to make that > optional ?
hmm. i think need the compilation, while from_statement avoids it (in 0.3.9). i see 3 steps in executing a query: 1. get the mapper, which will be used to construct objects from raw column data 2. get the mapper's select_table (default or not) as starting point for the query clauses 3. (if any) add all other query.tweaks() - .filter, .order_by, .join, .whatever, which customize (and probably narrow) the query further and further. i want step 2's Selectable replaced with something else, columns and clause. e.g. primary mapper has a default select_table of polymunion over 20 subclasses, while i want a single base1.join(base2).join(my_table).select(base1.c.type='mytable') for just one of them. what i have dome with NPs is similar to your surrogate_mapper, but in opposite direction. If all this default-selection-aspect of the mapper can be overriden, NPs will be needed only in rare cases, e.g. different entities etc. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---