InheritableSQLObject.addColumn is not updating sqlmeta.columns, meaning that
you cannot use sqlbuilder to access this column.

FWIW here's the patch.

Admittedly, I don't understand why childUpdate is set, but when it's set it
prevents the class from chaining up which is necessary, or sqlmeta.columns
will not be updated.

Johan
Index: sqlobject/inheritance/tests/test_inheritance.py
===================================================================
--- sqlobject/inheritance/tests/test_inheritance.py     (revisão 3983)
+++ sqlobject/inheritance/tests/test_inheritance.py     (cópia de trabalho)
@@ -73,3 +73,9 @@
 
     person = Employee.byLastName("Leader")
     assert person.firstName == "Project"
+
+    InheritablePerson.sqlmeta.addColumn(IntCol('runtime', default=None))
+
+    assert hasattr(InheritablePerson.q, 'runtime')
+    assert hasattr(Employee.q, 'runtime')
+
Index: sqlobject/inheritance/__init__.py
===================================================================
--- sqlobject/inheritance/__init__.py   (revisão 3983)
+++ sqlobject/inheritance/__init__.py   (cópia de trabalho)
@@ -93,7 +93,7 @@
         #DSM: Update each child class if needed and existing (only for new
         #DSM: dynamic column as no child classes exists at object creation)
         for c in sqlmeta.childClasses.values():
-            c.sqlmeta.addColumn(columnDef, connection=connection, 
childUpdate=True)
+            c.sqlmeta.addColumn(columnDef, connection=connection)
 
     addColumn = classmethod(addColumn)
 
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to