[SQL-CVS] SQLObject/SQLObject Col.py,1.17,1.18
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <ian...@us...> - 2003-05-05 17:37:23
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv2632/SQLObject Modified Files: Col.py Log Message: Added sqlType argument to Col Index: Col.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/Col.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Col.py 29 Apr 2003 09:37:06 -0000 1.17 --- Col.py 5 May 2003 17:37:19 -0000 1.18 *************** *** 18,26 **** class Col(object): ! def __init__(self, name=None, dbName=None, default=NoDefault, foreignKey=None, ! alternateID=False, alternateMethodName=None, ! constraints=None, notNull=False, ! unique=NoDefault): # This isn't strictly true, since we *could* use backquotes # around column names, but why would anyone *want* to --- 18,32 ---- class Col(object): ! def __init__(self, ! name=None, ! dbName=None, ! default=NoDefault, foreignKey=None, ! alternateID=False, ! alternateMethodName=None, ! constraints=None, ! notNull=False, ! unique=NoDefault, ! sqlType=None): # This isn't strictly true, since we *could* use backquotes # around column names, but why would anyone *want* to *************** *** 49,52 **** --- 55,59 ---- self.soClass = None self._default = default + self.customSQLType = sqlType def setClass(self, soClass): *************** *** 117,121 **** def _sqlType(self): ! raise ValueError, "Col cannot be used for automatic schema creation (too abstract)" def _mysqlType(self): --- 124,131 ---- def _sqlType(self): ! if self.customSQLType is None: ! raise ValueError, "Col cannot be used for automatic schema creation (too abstract)" ! else: ! return self.customSQLType def _mysqlType(self): |