Update of /cvsroot/sqlobject/SQLObject/SQLObject
In directory sc8-pr-cvs1:/tmp/cvs-serv14448
Modified Files:
Col.py
Log Message:
Made *ID keys names more permissive -- if you don't add the ID,
it gets added for you.
Index: Col.py
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/Col.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Col.py 26 May 2003 21:48:54 -0000 1.22
--- Col.py 31 May 2003 02:00:27 -0000 1.23
***************
*** 89,94 ****
self.foreignKey = foreignKey
if self.foreignKey:
! assert self.name.upper().endswith('ID'), "All foreign key columns must end with 'ID' (%s)" % repr(self.name)
! self.foreignName = self.name[:-2]
else:
self.foreignName = None
--- 89,98 ----
self.foreignKey = foreignKey
if self.foreignKey:
! #assert self.name.upper().endswith('ID'), "All foreign key columns must end with 'ID' (%s)" % repr(self.name)
! if not self.name.upper().endswith('ID'):
! self.foreignName = self.name
! self.name = self.name + "ID"
! else:
! self.foreignName = self.name[:-2]
else:
self.foreignName = None
|