[SQL-CVS] SQLObject/SQLObject Constraints.py,1.1,1.2
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <ian...@us...> - 2003-04-19 00:58:48
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv19773/SQLObject Modified Files: Constraints.py Log Message: Added isFloat constraint, which FloatCol already was expecting to exist. Index: Constraints.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/Constraints.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Constraints.py 14 Mar 2003 03:52:01 -0000 1.1 --- Constraints.py 19 Apr 2003 00:58:45 -0000 1.2 *************** *** 29,32 **** --- 29,36 ---- raise BadValue("only allows integers", obj, col, value) + def isFloat(obj, col, value): + if type(value) not in (type(1), type(1L), type(1.1)): + raise BadValue("only allows floating point numbers", obj, col, value) + class InList: |