#41 selectBy patch for accepting object values

closed-accepted
nobody
General (126)
5
2004-09-27
2004-09-24
David M. Cook
No

This patch allows you to use selectBy with foreignKeys

c = Composer.get(1)
Work.selectBy(composer=c, ...)

instead of

Work.selectBy(composerID=c.id, ...)

The method to convert from the object to the db column
is a bit tortured, and my error message if the object
doesn't match is a bit lame.

Discussion

  • David M. Cook
    David M. Cook
    2004-09-24

    Patch to allow object values in selectBy

     
    Attachments
  • Ian Bicking
    Ian Bicking
    2004-09-27

    • status: open --> closed-accepted
     
  • David M. Cook
    David M. Cook
    2005-04-04

    Logged In: YES
    user_id=668544

    While the new code is now there, the return at the top of
    dbconnection.DBAPI._SO_columnClause was left in place, which
    means that the new code never gets used.

    Also, I don't like that my code depends on a join being
    specified. It should work without them by looking up the
    foreignKeys. I'll work on a new patch.