kvesteri/wtforms-alchemy — pull request #72 by bmathieu33 (2014-07-02 16:20:12+00:00)
Title: fix find_entity not working when models has more than one primary key

In its current form find_entity work correctly only for objects with 1 primary key.

It's iterating over the column list to find a match, and if an object has a value that matches the column value in data it stops: match is done on only one column.

My patch essentially reverse that logic: iterate over the collection of object, and for each object see if all of its primary keys match.