[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7208 - trunk/gnue-appserver/src
From: |
johannes |
Subject: |
[gnue] r7208 - trunk/gnue-appserver/src |
Date: |
Tue, 15 Mar 2005 13:24:32 -0600 (CST) |
Author: johannes
Date: 2005-03-15 13:24:31 -0600 (Tue, 15 Mar 2005)
New Revision: 7208
Modified:
trunk/gnue-appserver/src/repository.py
Log:
Added a dictionary of master-classes to the class-definition
Modified: trunk/gnue-appserver/src/repository.py
===================================================================
--- trunk/gnue-appserver/src/repository.py 2005-03-15 13:50:49 UTC (rev
7207)
+++ trunk/gnue-appserver/src/repository.py 2005-03-15 19:24:31 UTC (rev
7208)
@@ -369,7 +369,7 @@
if self.__object is None:
self.__object = self._session._get (self.classname, self.gnue_id)
- # Fetch
+ # Fetch the result of a given attribute and keep it cached for later reuse
result = getattr (self.__object, attr)
self.__dict__ [attr] = result
@@ -471,6 +471,7 @@
self.properties = CaselessDict (PropertyNotFoundError, self.fullName)
self.procedures = CaselessDict (ProcedureNotFoundError, self.fullName)
+ self.masters = CaselessDict (ClassNotFoundError)
self.OnInit = []
self.OnChange = []
@@ -542,6 +543,20 @@
# ---------------------------------------------------------------------------
+ # Add a given class as master of the class
+ # ---------------------------------------------------------------------------
+
+ def addMasterClass (self, aMaster):
+ """
+ This function adds a given class to the dictionary of master-classes.
+
+ @param aMaster: class wrapper instance to be added
+ """
+
+ self.masters [aMaster.fullName] = aMaster
+
+
+ # ---------------------------------------------------------------------------
# Update all links within a class wrapper
# ---------------------------------------------------------------------------
@@ -558,6 +573,8 @@
self.gnue_module = None
self.gnue_filter = None
+ self.masters.clear ()
+
del self.OnInit [:]
del self.OnChange [:]
del self.OnValidate [:]
@@ -647,8 +664,13 @@
self.isReference = r is not None
self.referencedClass = r
+ # If the property is a reference to another class, the referenced class
+ # is a master of this class
+ if r is not None:
+ classes [self.gnue_class].addMasterClass (r)
+
# =============================================================================
# This class wraps a calculated property (= special procedures)
# =============================================================================
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7208 - trunk/gnue-appserver/src,
johannes <=