[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r6289 - trunk/gnue-appserver/src
From: |
reinhard |
Subject: |
r6289 - trunk/gnue-appserver/src |
Date: |
Wed, 15 Sep 2004 14:21:32 -0500 (CDT) |
Author: reinhard
Date: 2004-09-15 14:21:31 -0500 (Wed, 15 Sep 2004)
New Revision: 6289
Modified:
trunk/gnue-appserver/src/geasSession.py
Log:
Allow for conditions in dictionary notation; raise better error message if
condition is invalid datatype.
Modified: trunk/gnue-appserver/src/geasSession.py
===================================================================
--- trunk/gnue-appserver/src/geasSession.py 2004-09-15 17:03:48 UTC (rev
6288)
+++ trunk/gnue-appserver/src/geasSession.py 2004-09-15 19:21:31 UTC (rev
6289)
@@ -26,15 +26,17 @@
import string
import whrandom
+from gnue.common.apps import errors, i18n
+from gnue.common.datasources import GConditions
+
from gnue import appserver
-from gnue.appserver import data
+from gnue.appserver import data, geasList, geasInstance
from gnue.appserver.geasAuthentication import AuthError
-import geasList, geasInstance
-from gnue.common.datasources import GConditions
-from gnue.common.apps import i18n
-from mx import DateTime
+# =============================================================================
+# Exceptions
+# =============================================================================
class InstanceNotFoundError (appserver.Error):
def __init__ (self, classname, objectId):
@@ -53,7 +55,12 @@
msg = u_ ("Cannot find a list with ID '%s'") % listId
appserver.Error.__init__ (self, msg)
+class ConditionDataTypeError (errors.ApplicationError):
+ def __init__ (self, condition):
+ msg = u_("Invalid condition data type '%s'") % type (condition)
+ errors.ApplicationError.__init__ (self, msg)
+
# =============================================================================
# Session class
# =============================================================================
@@ -530,8 +537,12 @@
if isinstance (condition, ListType):
cTree = GConditions.buildTreeFromList (condition)
+ elif isinstance (condition, DictType):
+ cTree = GConditions.buildConditionFromDict (condition)
+ elif isinstance (condition, GConditions.GCondition):
+ cTree = condition
else:
- cTree = condition
+ raise ConditionDataTypeError, condition
dbTrees = []
asTrees = []
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r6289 - trunk/gnue-appserver/src,
reinhard <=