This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SQLObject development repository".
The branch, master has been updated
via 0af67f5973c8c43d4fb67239779008701a30955a (commit)
via fe9120a39dc2ee8ed2dc3d355f86f8c2c6bcce89 (commit)
via 197ef89ef7a3b29a85e4fcb3a1c88324ad71756d (commit)
via f8143e32c03c327481177c50da656ddbdfdb28aa (commit)
from a6c00c586d136ba5621810ac0a68a93ab63709b1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/0af67f5973c8c43d4fb67239779008701a30955a
commit 0af67f5973c8c43d4fb67239779008701a30955a
Merge: a6c00c5 fe9120a
Author: Ian Cordasco <sig...@us...>
Date: Sun Dec 21 20:05:06 2014 -0600
Merge pull request #2 from sqlobject/feature/use-sorted-list
Sort the column items in DBAPI
http://sourceforge.net/p/sqlobject/sqlobject/ci/fe9120a39dc2ee8ed2dc3d355f86f8c2c6bcce89
commit fe9120a39dc2ee8ed2dc3d355f86f8c2c6bcce89
Author: Ian Cordasco <gra...@gm...>
Date: Sun Dec 21 19:58:05 2014 -0600
Further simplify how we construct our data in DBAPI
This is a result of Oleg's feedback on pull request #2
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index cebe2a1..8593f4b 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -640,23 +640,22 @@ class DBAPI(DBConnection):
def _SO_columnClause(self, soClass, kw):
ops = {None: "IS"}
- data = {}
+ data = []
if 'id' in kw:
- data[soClass.sqlmeta.idName] = kw.pop('id')
+ data.append((soClass.sqlmeta.idName, kw.pop('id')))
for soColumn in soClass.sqlmeta.columnList:
key = soColumn.name
- col = soClass.sqlmeta.columns[key]
if key in kw:
- value = kw.pop(key)
- if col.from_python:
- value = col.from_python(value, sqlbuilder.SQLObjectState(soClass, connection=self))
- data[col.dbName] = value
- elif col.foreignName in kw:
- obj = kw.pop(col.foreignName)
+ val = kw.pop(key)
+ if soColumn.from_python:
+ val = soColumn.from_python(val, sqlbuilder.SQLObjectState(soClass, connection=self))
+ data.append((soColumn.dbName, val))
+ elif soColumn.foreignName in kw:
+ obj = kw.pop(soColumn.foreignName)
if isinstance(obj, main.SQLObject):
- data[col.dbName] = obj.id
+ data.append((soColumn.dbName, obj.id))
else:
- data[col.dbName] = obj
+ data.append((soColumn.dbName, obj))
if kw:
# pick the first key from kw to use to raise the error,
raise TypeError, "got an unexpected keyword argument(s): %r" % kw.keys()
@@ -667,7 +666,7 @@ class DBAPI(DBConnection):
['%s %s %s' %
(dbName, ops.get(value, "="), self.sqlrepr(value))
for dbName, value
- in data.items()])
+ in data])
def sqlrepr(self, v):
return sqlrepr(v, self.dbName)
http://sourceforge.net/p/sqlobject/sqlobject/ci/197ef89ef7a3b29a85e4fcb3a1c88324ad71756d
commit 197ef89ef7a3b29a85e4fcb3a1c88324ad71756d
Author: Ian Cordasco <gra...@gm...>
Date: Sun Dec 21 15:00:03 2014 -0600
Use columnList instead of sorting alphabetically
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 5fad639..cebe2a1 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -643,7 +643,9 @@ class DBAPI(DBConnection):
data = {}
if 'id' in kw:
data[soClass.sqlmeta.idName] = kw.pop('id')
- for key, col in sorted(soClass.sqlmeta.columns.items()):
+ for soColumn in soClass.sqlmeta.columnList:
+ key = soColumn.name
+ col = soClass.sqlmeta.columns[key]
if key in kw:
value = kw.pop(key)
if col.from_python:
http://sourceforge.net/p/sqlobject/sqlobject/ci/f8143e32c03c327481177c50da656ddbdfdb28aa
commit f8143e32c03c327481177c50da656ddbdfdb28aa
Author: Ian Cordasco <gra...@gm...>
Date: Sun Dec 21 13:37:18 2014 -0600
Sort the column items in DBAPI
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 1ec8aea..5fad639 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -643,7 +643,7 @@ class DBAPI(DBConnection):
data = {}
if 'id' in kw:
data[soClass.sqlmeta.idName] = kw.pop('id')
- for key, col in soClass.sqlmeta.columns.items():
+ for key, col in sorted(soClass.sqlmeta.columns.items()):
if key in kw:
value = kw.pop(key)
if col.from_python:
-----------------------------------------------------------------------
Summary of changes:
sqlobject/dbconnection.py | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
hooks/post-receive
--
SQLObject development repository
|