[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7333 - trunk/gnue-forms/src/GFObjects
From: |
reinhard |
Subject: |
[gnue] r7333 - trunk/gnue-forms/src/GFObjects |
Date: |
Mon, 11 Apr 2005 13:48:33 -0500 (CDT) |
Author: reinhard
Date: 2005-04-11 13:48:32 -0500 (Mon, 11 Apr 2005)
New Revision: 7333
Modified:
trunk/gnue-forms/src/GFObjects/GFBlock.py
Log:
Use GCexist for query by detail. This makes query by detail work again, but now
even with non-SQL backends.
Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFBlock.py 2005-04-11 18:47:47 UTC (rev
7332)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py 2005-04-11 18:48:32 UTC (rev
7333)
@@ -667,8 +667,16 @@
if hasattr(entry._field,'sloppyQuery') and
block._queryValues.has_key(entry._field):
block._queryValues[entry._field] = "%"+
string.join(list(block._queryValues[entry._field]),"%")+"%"
- # Build the sql required by the detail blocks
- SQL = ""
+ # Find root block
+ for block in self._logic._blockList:
+ if maxList[-1] == block._dataSourceLink._dataObject:
+ break
+ rootBlock = block
+
+ # Condition for the master block
+ conditions = _generateConditional(rootBlock)
+
+ # Conditions for the detail block
for dataobject in maxList[:-1]:
for block in self._logic._blockList:
@@ -679,17 +687,16 @@
for field in block._fieldList:
field.processTrigger('PRE-QUERY')
- conditions = _generateConditional(block)
- SQL = self._dataSourceLink.getQueryString(conditions,1,SQL)
+ c = _generateConditional(block)
+ exist = GConditions.GCexist()
+ exist.table = dataobject.table
+ exist.masterlink = string.join (dataobject._masterfields, ', ')
+ exist.detaillink = string.join (dataobject._detailfields, ', ')
+ exist._children = [c]
+ conditions = GConditions.combineConditions (conditions, exist)
- for block in self._logic._blockList:
- if maxList[-1] == block._dataSourceLink._dataObject:
- break
- rootBlock = block
+ rootBlock._dataSourceLink.createResultSet(conditions)
- conditions = _generateConditional(rootBlock)
- rootBlock._dataSourceLink.createResultSet(conditions, sql=SQL)
-
rootBlock._recordCount = rootBlock._resultSet.getRecordCount()
for block in self._logic._blockList:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7333 - trunk/gnue-forms/src/GFObjects,
reinhard <=