]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
raise exception if invalid collection class used
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 24 Jan 2007 19:57:02 +0000 (19:57 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 24 Jan 2007 19:57:02 +0000 (19:57 +0000)
lib/sqlalchemy/orm/attributes.py

index 651436a9703f951bcc276f59772a3a4aa9a938e3..398cdde6c5ba1bdced0e2e531ec5fb50eca2f5bd 100644 (file)
@@ -6,7 +6,7 @@
 
 from sqlalchemy import util
 from sqlalchemy.orm import util as orm_util
-from sqlalchemy import logging
+from sqlalchemy import logging, exceptions
 import weakref
 
 class InstrumentedAttribute(object):
@@ -331,6 +331,8 @@ class InstrumentedList(object):
         elif hasattr(self.data, 'add'):
             self._data_appender = self.data.add
             self._clear_data = self._clear_set
+        else:
+            raise exceptions.ArgumentError("Collection type " + repr(type(self.data)) + " has no append() or add() method")
         if isinstance(self.data, dict):
             self._clear_data = self._clear_dict