[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r5770 - in trunk: gnue-appserver/src gnue-common/src/datasources
From: |
johannes |
Subject: |
r5770 - in trunk: gnue-appserver/src gnue-common/src/datasources |
Date: |
Fri, 30 Apr 2004 01:40:22 -0500 (CDT) |
Author: johannes
Date: 2004-04-30 01:40:21 -0500 (Fri, 30 Apr 2004)
New Revision: 5770
Modified:
trunk/gnue-appserver/src/data.py
trunk/gnue-appserver/src/geasInstance.py
trunk/gnue-common/src/datasources/GConditions.py
Log:
Removed obsolete code, data._createResultSet uses condition trees only
Modified: trunk/gnue-appserver/src/data.py
===================================================================
--- trunk/gnue-appserver/src/data.py 2004-04-29 17:57:46 UTC (rev 5769)
+++ trunk/gnue-appserver/src/data.py 2004-04-30 06:40:21 UTC (rev 5770)
@@ -298,23 +298,8 @@
datasource = _createDatasource (connections, database, content, order)
- if isinstance (conditions, DictType):
- condition_tree = GConditions.buildConditionFromDict (conditions)
+ return datasource.createResultSet (conditions)
- elif isinstance (conditions, ListType):
- condition_tree = GConditions.buildTreeFromPrefix (conditions)
-
- elif conditions is None:
- condition_tree = None
-
- else:
- condition_tree = conditions
-
- # else:
- # raise GConditions.ConditionError, _("Invalid condition format")
-
- return datasource.createResultSet (condition_tree)
-
# -----------------------------------------------------------------------------
# Create a result set containing only one row, identified by the gnue_id
# -----------------------------------------------------------------------------
@@ -322,10 +307,7 @@
def _find (connections, database, table, row, fields):
content = {None: (table, None, None, fields)}
- condition = GConditions.GCondition ()
- eq = GConditions.GCeq (condition)
- GConditions.GCField (eq, 'gnue_id')
- GConditions.GCConst (eq, row)
+ condition = GConditions.buildConditionFromDict ({'gnue_id': row})
resultSet = _createResultSet (connections, database, content, condition, [])
resultSet.firstRecord ()
return resultSet
Modified: trunk/gnue-appserver/src/geasInstance.py
===================================================================
--- trunk/gnue-appserver/src/geasInstance.py 2004-04-29 17:57:46 UTC (rev
5769)
+++ trunk/gnue-appserver/src/geasInstance.py 2004-04-30 06:40:21 UTC (rev
5770)
@@ -192,7 +192,9 @@
propertydef = classdef.properties [e]
if not propertydef.isReference:
raise gException, u_("Cannot resolve property name '%(name)s' because "
- "'%(part)s' is not a reference property")
+ "'%(part)s' is not a reference property") \
+ % {'name': propertyname,
+ 'part': propertydef.fullName}
classdef = propertydef.referencedClass
key = record.getField (propertydef.column)
# if any reference on the way through the property name is None, assume
@@ -317,6 +319,9 @@
raise PropertyValueError (prop.fullName, None)
+ # ---------------------------------------------------------------------------
+ # Dictionary-like access methods
+ # ---------------------------------------------------------------------------
def __getitem__ (self, key):
return self.__getValue (key)
Modified: trunk/gnue-common/src/datasources/GConditions.py
===================================================================
--- trunk/gnue-common/src/datasources/GConditions.py 2004-04-29 17:57:46 UTC
(rev 5769)
+++ trunk/gnue-common/src/datasources/GConditions.py 2004-04-30 06:40:21 UTC
(rev 5770)
@@ -672,9 +672,6 @@
return parent[0];
-def newbuildPrefixFromTree (element):
- pass
-
def buildPrefixFromTree(conditionTree):
if type(conditionTree) != types.InstanceType:
tmsg = u_("No valid condition tree")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r5770 - in trunk: gnue-appserver/src gnue-common/src/datasources,
johannes <=