[Checkins] SVN: z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/model.py additional checks for 'relations'

Andreas Jung andreas at andreas-jung.com
Thu May 10 11:37:48 EDT 2007


Log message for revision 75672:
  additional checks for 'relations'
  

Changed:
  U   z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/model.py

-=-
Modified: z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/model.py
===================================================================
--- z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/model.py	2007-05-10 15:37:25 UTC (rev 75671)
+++ z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/model.py	2007-05-10 15:37:47 UTC (rev 75672)
@@ -65,9 +65,13 @@
             raise TypeError("'mapper_class' must be a subclass of MappedClassBase")
         
         if relations is not None:
+
+            if not isinstance(relations, (tuple, list)):
+                    raise TypeError('relations must be specified a sequence of strings')    
+
             for r in relations:
                 if not isinstance(r, str):
-                    raise TypeError('relations must be specified as sequence of strings')    
+                    raise TypeError('relations must be specified a sequence of strings')    
 
         if relations is not None and autodetect_relations == True:
             raise ValueError("'relations' and 'autodetect_relations' can't be specified at the same time")



More information about the Checkins mailing list