Update of /cvsroot/sqlobject/SQLObject/SQLObject
In directory sc8-pr-cvs1:/tmp/cvs-serv21226/SQLObject
Modified Files:
SQLObject.py
Log Message:
Failed alternateID calls will raise SQLObjectNotFound
Index: SQLObject.py
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** SQLObject.py 17 Apr 2003 07:22:51 -0000 1.23
--- SQLObject.py 19 Apr 2003 01:04:18 -0000 1.24
***************
*** 33,36 ****
--- 33,38 ----
NoDefault = SQLBuilder.NoDefault
+ class SQLObjectNotFound(LookupError): pass
+
True, False = 1==1, 0==1
***************
*** 747,750 ****
--- 749,754 ----
dbIDName,
value)
+ if not result:
+ raise SQLObjectNotFound, "The %s by alternateID %s=%s does not exist" % (cls.__name__, dbIDName, repr(value))
obj = cls(result[0])
if not obj._SO_autoInitDone:
***************
*** 1105,1107 ****
__all__ = ['NoDefault', 'SQLObject',
! 'MultipleJoin', 'RelatedJoin', 'getID', 'getObject']
--- 1109,1112 ----
__all__ = ['NoDefault', 'SQLObject',
! 'MultipleJoin', 'RelatedJoin', 'getID', 'getObject',
! 'SQLObjectNotFound']
|