[Zope3-checkins] CVS: Zope3/src/zope/app/rdb - __init__.py:1.11

runyaga runyaga@thisbox.com
Sat, 7 Jun 2003 16:10:03 -0400


Update of /cvs-repository/Zope3/src/zope/app/rdb
In directory cvs.zope.org:/tmp/cvs-serv22636

Modified Files:
	__init__.py 
Log Message:
cast columns to tuple in GeneratedRowClass
tests were passing columns in as tuples
but queryForResults was pasing columns in as lists
with this you can access ResultSet's inside of ZPT


=== Zope3/src/zope/app/rdb/__init__.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/rdb/__init__.py:1.10	Sat Jun  7 15:18:16 2003
+++ Zope3/src/zope/app/rdb/__init__.py	Sat Jun  7 16:10:02 2003
@@ -385,9 +385,9 @@
     #<SteveA> (which is ropey when you're working with metatypes)
     #<SteveA> or, it really should be a descriptor that doesn't @#$% with the value on the class
     #
-    # I broke the tests.. the line below to made it work 
-    # klass_namespace['__Security_checker__'] = checker.NamesChecker(columns+['__bases__']) 
-    klass_namespace['__Security_checker__'] = checker.NamesChecker(columns)
+    #unit tests indicate columns will be tupled
+    #queryForResults indicate columns will be a list - so we cast to tuple
+    klass_namespace['__Security_checker__'] = checker.NamesChecker(tuple(columns)+('__bases__',))
     klass_namespace['__slots__'] = tuple(columns)
 
     return type('GeneratedRowClass', (Row,), klass_namespace)