possibly fixed issue 1637:when trying to use IS_IN_DB with a composite reference key, there is a no _id error reported
This commit is contained in:
1 parent
ac3e1fc84d
commit
6097a00bf1
2 files changed
+6
-2
No files matched your search
@@ -1 +1 @@
|
|||||||
Version 2.6.0-development+timestamp.2013.09.01.08.06.40
|
Version 2.6.0-development+timestamp.2013.09.01.09.34.39
|
||||||
+5
-1
@@ -690,7 +690,11 @@ class BaseAdapter(ConnectionPool):
|
|||||||
return isinstance(exception, self.driver.ProgrammingError)
|
return isinstance(exception, self.driver.ProgrammingError)
|
||||||
|
|
||||||
def id_query(self, table):
|
def id_query(self, table):
|
||||||
return table._id != None
|
pkeys = getattr(table,'_primarykey',None)
|
||||||
|
if pkeys:
|
||||||
|
return table[pkeys[0]] != None
|
||||||
|
else:
|
||||||
|
return table._id != None
|
||||||
|
|
||||||
def adapt(self, obj):
|
def adapt(self, obj):
|
||||||
return "'%s'" % obj.replace("'", "''")
|
return "'%s'" % obj.replace("'", "''")
|
||||||
|
|||||||
Reference in new issue
Block a user