1.1 --- a/WebStack/Resources/Selectors.py Sat Dec 01 00:33:36 2007 +0000
1.2 +++ b/WebStack/Resources/Selectors.py Thu Dec 06 23:38:37 2007 +0000
1.3 @@ -107,16 +107,18 @@
1.4 a DB-API connection object or any object providing a 'rollback' method.
1.5 """
1.6
1.7 - def __init__(self, resource, store):
1.8 + def __init__(self, resource, store, attribute_name="store"):
1.9
1.10 """
1.11 Initialise the selector with a 'resource' (to which all requests shall
1.12 be forwarded), providing a 'store' which shall be maintained as an
1.13 - attribute.
1.14 + attribute. The optional 'attribute_name' can be used to define the name
1.15 + of the attribute employed - it is set to "store" by default.
1.16 """
1.17
1.18 self.resource = resource
1.19 self.store = store
1.20 + self.attribute_name = attribute_name
1.21
1.22 def respond(self, trans):
1.23
1.24 @@ -130,7 +132,7 @@
1.25 unfinished, uncommitted transactions.
1.26 """
1.27
1.28 - trans.get_attributes()["store"] = self.store
1.29 + trans.get_attributes()[self.attribute_name] = self.store
1.30 try:
1.31 self.resource.respond(trans)
1.32 finally: