#89 DatabaseIndex.get() fix and simplification.

closed-accepted
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

  • Leandro Lucarella

    Object passing testcase.

     
  • Leandro Lucarella

    Logged In: YES
    user_id=240225
    Originator: YES

    File Added: test.ids.py

     
  • Leandro Lucarella

    Logged In: YES
    user_id=240225
    Originator: YES

    File Added: test.inherit.py

     
  • Leandro Lucarella

    Inheritance testcase.

     
  • Leandro Lucarella

    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
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks