#89 DatabaseIndex.get() fix and simplification.

closed-accepted
Oleg Broytman
None
5
2007-03-14
2007-03-06
No

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:
1) Simpler.
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.

Discussion

  • Object passing testcase.

     
    Attachments
  • Logged In: YES
    user_id=240225
    Originator: YES

    File Added: test.ids.py

     
  • Logged In: YES
    user_id=240225
    Originator: YES

    File Added: test.inherit.py

     
  • Inheritance testcase.

     
    Attachments
  • Logged In: YES
    user_id=240225
    Originator: YES

    File Added: DatabaseIndex.get-selectBy.getOne.patch

     
  • Oleg Broytman
    Oleg Broytman
    2007-03-14

    Logged In: YES
    user_id=4799
    Originator: NO

    Applied in the revisions 2407-2410. Thank you!

     
  • Oleg Broytman
    Oleg Broytman
    2007-03-14

    • assigned_to: nobody --> phd
    • status: open --> closed-accepted