[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7086 - in trunk/gnue-appserver: . src/classrep src/language
From: |
johannes |
Subject: |
[gnue] r7086 - in trunk/gnue-appserver: . src/classrep src/language |
Date: |
Thu, 3 Mar 2005 05:17:33 -0600 (CST) |
Author: johannes
Date: 2005-03-03 05:17:32 -0600 (Thu, 03 Mar 2005)
New Revision: 7086
Modified:
trunk/gnue-appserver/BUGS
trunk/gnue-appserver/src/classrep/Base.py
trunk/gnue-appserver/src/language/Session.py
Log:
session.get () raises an InstanceNotFoundError if called with a non-existing id
Modified: trunk/gnue-appserver/BUGS
===================================================================
--- trunk/gnue-appserver/BUGS 2005-03-03 11:08:01 UTC (rev 7085)
+++ trunk/gnue-appserver/BUGS 2005-03-03 11:17:32 UTC (rev 7086)
@@ -24,7 +24,3 @@
* In a language.App application, iterating over an ObjectList and inserting
multiple new instances per item, gets slower with every iteration-step.
-* gnue-gsdgen shouldn't rescan the module path
-
-* session.get () from the language interface does not properly raise an
- exception when the requested instance does not exist.
Modified: trunk/gnue-appserver/src/classrep/Base.py
===================================================================
--- trunk/gnue-appserver/src/classrep/Base.py 2005-03-03 11:08:01 UTC (rev
7085)
+++ trunk/gnue-appserver/src/classrep/Base.py 2005-03-03 11:17:32 UTC (rev
7086)
@@ -389,7 +389,7 @@
"""
if self.__object is None:
- self.__object = self._session.get (self.classname, self.gnue_id)
+ self.__object = self._session._get (self.classname, self.gnue_id)
result = self.__object
Modified: trunk/gnue-appserver/src/language/Session.py
===================================================================
--- trunk/gnue-appserver/src/language/Session.py 2005-03-03 11:08:01 UTC
(rev 7085)
+++ trunk/gnue-appserver/src/language/Session.py 2005-03-03 11:17:32 UTC
(rev 7086)
@@ -280,13 +280,40 @@
gBeginFunc (6)
- result = self.get (classname)
+ result = self._get (classname)
gEndFunc (6, result)
return result
+ # ---------------------------------------------------------------------------
+ # Get an instance of a class with a given object Id
+ # ---------------------------------------------------------------------------
+
+ def _get (self, classname, objectId = None):
+ """
+ This function returns an instance of a given class having the specified
+ objectId. If the objectId is None, a new one will be generated.
+ If the objectId does not exist nothing happens.
+
+ @param classname: name of the class to create an instance for
+ @param objectId: gnue_id of the instance or None to create a new one
+
+ @return: Object instance of the requested class
+ """
+
+ gBeginFunc (6)
+
+ name = self.qualify (classname)
+ cDef = self.getClassDefinition (name)
+ result = Object (self, name, objectId, cDef)
+
+ gEndFunc (6, result)
+
+ return result
+
+
# -------------------------------------------------------------------------
# Get an instance of a class having a given objectId
# -------------------------------------------------------------------------
@@ -295,6 +322,8 @@
"""
This function returns an instance of a given class having the specified
objectId. If the objectId is None, a new one will be generated.
+ If the objectId does not exist in the backend, an InstanceNotFoundError
+ will be raised.
@param classname: name of the class to create an instance for
@param objectId: gnue_id of the instance or None to create a new one
@@ -305,8 +334,9 @@
gBeginFunc (6)
name = self.qualify (classname)
- cDef = self.getClassDefinition (name)
+ self.__sm.load (self.__session_id, name, [objectId], [u'gnue_id'])
+ cDef = self.getClassDefinition (name)
result = Object (self, name, objectId, cDef)
gEndFunc (6, result)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7086 - in trunk/gnue-appserver: . src/classrep src/language,
johannes <=