Hey Sandro, Ooh, that's what you meant by doubled rows.
You're just asking for users where the mail address matches the criteria. If you want to limit the mail entries then, for a given user, performing an additional select on the mail table backwards (i.e. supplying the limiting userid, or userids) is one possible way. The issue here is since you're asking for Users, you're going to get all the Users that match the criteria. There isn't any logic in place to then limit your exposure to properties (and, I'd think, would be difficult to implement, due to the need to then track in each object all the various conditions it was found under) of the User objects you find. If you want a straight list, then maybe stick with straight SQL? HTH, cheers! :) -G On Wednesday, May 10, 2006, 1:01:26 AM, you wrote: > On Wed, May 10, 2006 at 12:32:53AM +0300, Gambit wrote: >> Hey Sandro, >> >> My understanding is, the from_obj isn't necessary here. Regardless, though, >> it works fine with it (or without it) as the resulting query isn't >> substantially changed. Adding the missing comma from the sample code and >> fixing the print statement so that it iterates through the 'R.mail' property >> gives me the correct values for 1419. What build are you using? >> -G > I was using 1413, now I updated to 1431. > My result is as follows: > [2006-05-09 23:57:16,334] [engine]: SELECT user_tbl.user_last_name AS > user_tbl_user_last_name, mail_tbl_9859.user_id AS mail_tbl_9859_user_id, > mail_tbl_9859.mail_address AS mail_tbl_9859_mail_address, user_tbl.user_id > AS user_tbl_user_id, user_tbl.user_name AS user_tbl_user_name FROM mail_tbl, > user_tbl LEFT OUTER JOIN mail_tbl AS mail_tbl_9859 ON user_tbl.user_id = > mail_tbl_9859.user_id WHERE user_tbl.user_id = mail_tbl.user_id AND > mail_tbl.mail_address LIKE ? > [2006-05-09 23:57:16,334] [engine]: ['%a%'] > Sam [EMAIL PROTECTED] > Ted [EMAIL PROTECTED] > Ted [EMAIL PROTECTED] > As you can see [EMAIL PROTECTED] is not filtered throught > mail_tbl.mail_address LIKE 'a' > If you put more rows, you'll also see the doubled rows. > sandro > *:-) ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

