From: Mike Bayer Date: Wed, 24 Jan 2007 19:57:02 +0000 (+0000) Subject: raise exception if invalid collection class used X-Git-Tag: rel_0_3_5~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25c149b693b3c0fc89949460b14f518a4b0604d5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git raise exception if invalid collection class used --- diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index 651436a970..398cdde6c5 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -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