#88 Use sets instead of dicts for used tables.

closed-accepted
Oleg Broytman
None
5
2008-03-03
2007-03-03
No

Since dicts are used as plain sets there, why not to just use sets? Yeah, I know, because of Python 2.2 compatibility :)

Maybe some day...

Discussion

  • Logged In: YES
    user_id=240225
    Originator: YES

    File Added: tablesdict.str.set-trunk.patch

     
  • Oleg Broytman
    Oleg Broytman
    2007-03-27

    • assigned_to: nobody --> phd
    • status: open --> open-later
     
  • Oleg Broytman
    Oleg Broytman
    2007-03-27

    Logged In: YES
    user_id=4799
    Originator: NO

    Will be applied after SQLObject would have switched to Python 2.3.

     
  • Oleg Broytman
    Oleg Broytman
    2008-03-03

    • status: open-later --> open-invalid
     
  • Oleg Broytman
    Oleg Broytman
    2008-03-03

    Logged In: YES
    user_id=4799
    Originator: NO

    Please recreate the patch against the 0.10 branch: tablesUsedDict() has an additional parameter 'db'.

     
  • Logged In: YES
    user_id=240225
    Originator: YES

    Patch agains 0.10 attached.
    File Added: tablesdict.str.set-0.10.patch

     
  • Oleg Broytman
    Oleg Broytman
    2008-03-03

    Logged In: YES
    user_id=4799
    Originator: NO

    Thank you. There is also a tables dict in the method Select.__sqlrepr__(). Can you update it, too? (sqlbuilder.py, lines 622-632).

     
  • Logged In: YES
    user_id=240225
    Originator: YES

    Sure, sorry about that...
    File Added: tablesdict.str.set-0.10.patch

     
  • Oleg Broytman
    Oleg Broytman
    2008-03-03

    Logged In: YES
    user_id=4799
    Originator: NO

    There were these small problems:

    1. E if t1 in tables: tables.remoce(t1)
    > AttributeError: 'set' object has no attribute 'remoce'

    [sqlobject/sqlbuilder.py:635]

    2. E assert tablesUsedDict(x, None).keys() == ['not_yet_imported4 y']
    > NameError: global name 'tablesUsedDict' is not defined

    [sqlobject/tests/test_sqlbuilder_importproxy.py:50]

    3. E return d
    > NameError: global name 'd' is not defined

    [sqlobject/inheritance/__init__.py:21]

    I fixed them myself. Committed in the revisions 3281-3282 (0.10 and the trunk). Thank you!

     
  • Oleg Broytman
    Oleg Broytman
    2008-03-03

    • status: open-invalid --> closed-accepted
     
  • Logged In: YES
    user_id=240225
    Originator: YES

    ups! Sorry again, I'm at work and didn't had the time to test it. Maybe I should waited to get home and do it right then =/

    Thanks.