1.1 --- a/WebStack/Generic.py Mon Nov 21 12:59:14 2005 +0000
1.2 +++ b/WebStack/Generic.py Fri Nov 25 16:51:54 2005 +0000
1.3 @@ -627,6 +627,26 @@
1.4 else:
1.5 return real_path_info[:i]
1.6
1.7 + def get_attributes(self):
1.8 +
1.9 + """
1.10 + An application-specific method which obtains a dictionary mapping names
1.11 + to attribute values that can be used to store arbitrary information.
1.12 +
1.13 + Since the dictionary of attributes is retained by the transaction during
1.14 + its lifetime, such a dictionary can be used to store information that an
1.15 + application wishes to communicate amongst its components and resources
1.16 + without having to pass objects other than the transaction between them.
1.17 +
1.18 + The returned dictionary can be modified using normal dictionary-like
1.19 + methods. If no attributes existed previously, a new dictionary is
1.20 + created and associated with the transaction.
1.21 + """
1.22 +
1.23 + if not hasattr(self, "_attributes"):
1.24 + self._attributes = {}
1.25 + return self._attributes
1.26 +
1.27 # Utility methods.
1.28
1.29 def update_path(self, path, relative_path):