add row.extract() feature

Issue #699 resolved
Mike Bayer repo owner created an issue

given a regular use_labels style query, or actually just any ClauseElement? based query since its given a map of Column objects which it can use; just to provide:

segregated_row = row.extract(users)

The ORM does make a lot of use out of "converted" rows so it might even be nice to make it do:

ua = users.alias("F5B5")
row = row.extract(users, ua)

which pulls from its columns every column from the alias "F5B5" that it can tie down to the "users" table, returning a new row object. we do a lot of this "row adaptation" right now...the biggest need is to convert from an aliased version of a table down to the original table.

if you think you dont have the Alias object lying around (which you probably should...its best to think in terms of Selectable/Columns rather than strings), we can also add:

row = row.extract(users, prefix="F5B5_")

this for #627.

converts things like F5B5_user_id into "user_id" / users.c.user_id.

Comments (2)

  1. Log in to comment