[Sqlalchemy-tickets] [sqlalchemy] #750: Way to use in_ clause
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2007-08-20 18:07:18
|
Izc1MDogV2F5IHRvIHVzZSBpbl8gY2xhdXNlDQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQogUmVwb3J0 ZXI6ICBndWVzdCAgICAgICAgICAgIHwgICAgICAgICAgT3duZXI6ICB6enplZWsgICAgICAgICAg ICAgICAgDQogICAgIFR5cGU6ICBlbmhhbmNlbWVudCAgICAgIHwgICAgICAgICBTdGF0dXM6ICBu ZXcgICAgICAgICAgICAgICAgICAgDQogUHJpb3JpdHk6ICBtZWRpdW0gICAgICAgICAgIHwgICAg ICBNaWxlc3RvbmU6ICAgICAgICAgICAgICAgICAgICAgICAgDQpDb21wb25lbnQ6ICBzcWwgICAg ICAgICAgICAgIHwgICAgICAgU2V2ZXJpdHk6ICBubyB0cmlhZ2Ugc2VsZWN0ZWQgeWV0DQogS2V5 d29yZHM6ICBTZWxlY3Qgd2hlcmUgaW4gIHwgICBTdGF0dXNfZmllbGQ6ICBhd2FpdGluZyB0cmlh Z2UgICAgICAgDQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQogc2VlbXMgSXQncyBub3QgcG9zc2libGUg dG8gcGFzcyBhIHZhcmlhYmxlIHdpdGggbXkgSU4gd2hlcmVjbGF1c2UgdG8gc3FsDQogYWxjaGVt eSBUYWJsZSBvYmplY3QNCiBJIGhhdmUgYSBzaG9ydCBleGFtcGxlIGFuZCBhIGNvZGUgc29sdXRp b24gZm9yIHRoaXMuLg0KDQogSW4gdGhlIGNvZGUgYmVsbG93IEkgaGFkIHRvIHVzZSB3aGVyZWNs YXVzZToNCiB3a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w0KICAgICAgICAgZWxzZToN CiAgICAgICAgICAgICAgICAgX3Jlc3VsdHMgPSBzZWxlY3QoIGNvbHVtbnM9Y29sc0xpc3QsDQog d2hlcmVjbGF1c2U9KChpbWFnZVRhYmxlLmMuaWRfaW1hZ2UuaW5fKGlkX2ltYWdlLA0KICJsaXN0 IikpKSkuZXhlY3V0ZSgpLmZldGNoYWxsKCkNCiAgICAgICAgICAgICAgICAgcmVzdWx0cyA9IFtd DQogICAgICAgICAgICAgICAgICNjb252ZXJ0aW5nIHRvIHNvbWV0aGluZyBKU09OIGNhbiB1bmRl cnN0YW5kDQogICAgICAgICAgICAgICAgIGZvciB4IGluIHJhbmdlKGxlbihfcmVzdWx0cykpOg0K ICAgICAgICAgICAgICAgICAgICAgICAgIHJlcyA9IFsgc3RyKF9yZXN1bHRzW3hdW3ldKS5zdHJp cCgpIGZvciB5IGluDQogcmFuZ2UobGVuKF9yZXN1bHRzW3hdKSkgXQ0KICAgICAgICAgICAgICAg ICAgICAgICAgIHJlc3VsdHMuYXBwZW5kKHJlcykNCiAgICAgICAgICAgICAgICAgICAgICAgICBy ZXN1bHRzWy0xXVswXSA9IHJlc1swXS5zcGxpdCgnLycpWzVdDQogICAgICAgICAgICAgICAgIHJl dHVybiB7ICJyZXN1bHRzIjp0dXBsZShyZXN1bHRzKSB9DQoNCi0tIA0KVGlja2V0IFVSTDogPGh0 dHA6Ly93d3cuc3FsYWxjaGVteS5vcmcvdHJhYy90aWNrZXQvNzUwPg0Kc3FsYWxjaGVteSA8aHR0 cDovL2V4YW1wbGUuY29tLz4NCk15IGV4YW1wbGUgcHJvamVjdA== |