[orm-devel] forignKey->foreignKey spelling fix
Ross J. Reedstrom
orm-devel@mailman.tux4web.de
Wed, 27 Nov 2002 16:49:00 -0600
--2B/JsCI69OhZNC5r
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Here's a patch to fix the spelling of ForeignKey.
Ross
--
Ross Reedstrom, Ph.D. reedstrm@rice.edu
Executive Director phone: 713-348-6166
Gulf Coast Consortium for Bioinformatics fax: 713-348-6182
Rice University MS-39
Houston, TX 77005
--2B/JsCI69OhZNC5r
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="foreignkey.diff"
Index: relationships.py
===================================================================
RCS file: /var/data/public_cvs/orm/relationships.py,v
retrieving revision 2.2
diff -u -r2.2 relationships.py
--- relationships.py 2002/11/25 22:45:13 2.2
+++ relationships.py 2002/11/27 22:46:43
@@ -170,7 +170,7 @@
fmt = data.primaryKeyValue().format()
self.ds().update(self._dbObj, self._columnName, fmt)
- # if there is a column Object representing the forign key column
+ # if there is a column Object representing the foreign key column
# set it to the value of the newly inserted object
if self._columnName != self._attributeName and \
self._dbObj.columns.has_key(self._columnName):
@@ -206,41 +206,41 @@
The one2many relationship corespondes to a Python list. You can
store many child objects as an attribute of one parent object.
"""
- def __init__(self, childClass, forignKeyColumn=None):
+ def __init__(self, childClass, foreignKeyColumn=None):
"""
:childClass: dbclass descendant that represents the children's
class
- :forignKeyColumn: column name in childClass's table that has
+ :foreignKeyColumn: column name in childClass's table that has
our parent's class primaryKey in it
There is no column in the parent's table which this class
corresponds to, so we do not take it as an argument.
"""
relationship.__init__(self, childClass, None)
- self._forignKeyColumn = forignKeyColumn
+ self._foreignKeyColumn = foreignKeyColumn
def column(self, dbobj, attributeName):
- if self._forignKeyColumn:
- forignKeyColumn = self._forignKeyColumn
+ if self._foreignKeyColumn:
+ foreignKeyColumn = self._foreignKeyColumn
else:
- forignKeyColumn = dbobj.relation() + "_id"
+ foreignKeyColumn = dbobj.relation() + "_id"
return one2manyColumn(self, dbobj, attributeName,
- self._childClass, forignKeyColumn)
+ self._childClass, foreignKeyColumn)
def selectThisColumn(self): return 0
def format(self, data, datasource): return None
class one2manyColumn(relationshipColumn):
def __init__(self, datatype, dbObj, attributeName, childClass,
- forignKeyColumn):
+ foreignKeyColumn):
"""
There is no column in the parent's table which this class
corresponds to, so we do not take it as an argument.
"""
relationshipColumn.__init__(self, datatype, dbObj, attributeName,
childClass, None)
- self._forignKeyColumn = forignKeyColumn
+ self._foreignKeyColumn = foreignKeyColumn
def set(self, data):
if type(data) != types.ListType:
@@ -273,7 +273,7 @@
updateCommand = "UPDATE %s SET %s=%s WHERE %s IN (%s)" % \
(self._childClass.relation(),
- self._forignKeyColumn,
+ self._foreignKeyColumn,
self._dbObj.primaryKey,
self._dbObj.primaryKeyValue().format(),
join(newKeys, ", "))
@@ -292,8 +292,8 @@
def set_from_result(self, data):
self._data = None
- def forignKeyColumn(self):
- return self._forignKeyColumn
+ def foreignKeyColumn(self):
+ return self._foreignKeyColumn
class relationList(list):
"""
@@ -360,7 +360,7 @@
for a in objects:
list.append(self, a)
else:
- where = "%s=%s" % (self._column.forignKeyColumn(),
+ where = "%s=%s" % (self._column.foreignKeyColumn(),
self._column.dbObj().primaryKeyValue().format())
result = self.ds().selectByClauses(self._column.childClass(),
where=where)
@@ -397,7 +397,7 @@
cmd = "UPDATE %s SET %s=%s WHERE %s=%s" % \
(self._column.childClass().relation(),
- self._column.forignKeyColumn(),
+ self._column.foreignKeyColumn(),
self._column.dbObj().primaryKeyValue().format(),
dbobj.primaryKey, dbobj.primaryKeyValue().format())
self.ds().execute(cmd)
--2B/JsCI69OhZNC5r--