Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#236 delColumn removes to many properties

closed-fixed
Oleg Broytman
General (125)
5
2008-03-10
2008-02-22
Anonymous
No

# After deleting one column other columns are not accessible

# It seems that the unmakeProperties method removes all properties
# but should only remove the property from the delete column call

# Python 2.5.1
# SQLObject 0.10.0b2
from sqlobject import *

sqlhub.processConnection = connectionForURI('postgres://test:test@localhost/test')

class Author(SQLObject):
name = StringCol()
xyz = StringCol(default = 'Unused') # This column should be deleted

Author.createTable()

# Insert some authors
Author(name = 'Schiller')
Author(name = 'Goethe')

# Delete the unnecessary column
Author.sqlmeta.delColumn('xyz', changeSchema = True)

# ERROR: Can not access the name column
print [ author.name for author in Author.select()]

# Traceback (most recent call last):
# File "delcol-bug.py", line 19, in <module>
# print [ author.name for author in Author.select()]
# AttributeError: 'Author' object has no attribute 'name'

Discussion

  • Oleg Broytman
    Oleg Broytman
    2008-03-10

    • assigned_to: nobody --> phd
    • status: open --> closed-fixed
     
  • Oleg Broytman
    Oleg Broytman
    2008-03-10

    Logged In: YES
    user_id=4799
    Originator: NO

    Fixed in the revision 3309-3311 (branches 0.9, 0.10 and the trunk).