This is a reimplementation of DatabaseIndex.get() using selectBy() + getOne().
The current implementation had some issues with inheritance and when passing objects if a member of the index was a ForeingKey (passing something=something fails where somethingID=something.id works).
This implementations is:
2) Smarter. Don't reinvent the wheel (uses existing, more tested and more robust functions).
3) Backward compatible.
Attached is the patch, and 2 testcases: one testing Inheritance and the other object arguments passing.