[CalendarServer-changes] [9663] CalendarServer/branches/users/glyph/q

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 11 01:55:34 PDT 2012


Revision: 9663
          http://trac.macosforge.org/projects/calendarserver/changeset/9663
Author:   glyph at apple.com
Date:     2012-08-11 01:55:34 -0700 (Sat, 11 Aug 2012)
Log Message:
-----------
Same for `.__txn__`/`.transaction`

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/q/twext/enterprise/dal/record.py
    CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/q/

Modified: CalendarServer/branches/users/glyph/q/twext/enterprise/dal/record.py
===================================================================
--- CalendarServer/branches/users/glyph/q/twext/enterprise/dal/record.py	2012-08-11 08:55:33 UTC (rev 9662)
+++ CalendarServer/branches/users/glyph/q/twext/enterprise/dal/record.py	2012-08-11 08:55:34 UTC (rev 9663)
@@ -128,13 +128,13 @@
 
     __metaclass__ = _RecordMeta
 
-    __txn__ = None
+    transaction = None
     def __setattr__(self, name, value):
         """
         Once the transaction is initialized, this object is immutable.  If you
         want to change it, use L{Record.update}.
         """
-        if self.__txn__ is not None:
+        if self.transaction is not None:
             raise ReadOnly(self.__class__.__name__, name)
         return super(Record, self).__setattr__(name, value)
 
@@ -198,7 +198,7 @@
             # FIXME: better error reporting
             colmap[attrtocol[attr]] = k[attr]
         yield Insert(colmap).on(txn)
-        self.__txn__ = txn
+        self.transaction = txn
         returnValue(self)
 
 
@@ -211,7 +211,7 @@
         """
         return Delete(From=self.table,
                       Where=self._primaryKeyComparison(self._primaryKeyValue())
-                      ).on(self.__txn__)
+                      ).on(self.transaction)
 
 
     @inlineCallbacks
@@ -227,7 +227,7 @@
             colmap[self.__attrmap__[k]] = v
         yield (Update(colmap,
                       Where=self._primaryKeyComparison(self._primaryKeyValue()))
-                .on(self.__txn__))
+                .on(self.transaction))
         self.__dict__.update(kw)
 
 
@@ -297,7 +297,7 @@
             for (column, value) in zip(list(cls.table), row):
                 name = cls.__colmap__[column]
                 setattr(self, name, value)
-            self.__txn__ = txn
+            self.transaction = txn
             selves.append(self)
         returnValue(selves)
 

Modified: CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py
===================================================================
--- CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py	2012-08-11 08:55:33 UTC (rev 9662)
+++ CalendarServer/branches/users/glyph/q/twext/enterprise/queue.py	2012-08-11 08:55:34 UTC (rev 9663)
@@ -63,7 +63,7 @@
         def doWork(self):
             purchases = yield Select(schema.PURCHASE,
                                      Where=schema.PURCHASE.CUSTOMER_ID
-                                     == self.customerID).on(self.__txn__)
+                                     == self.customerID).on(self.transaction)
             couponAmount = yield doSomeMathThatTakesAWhile(purchases)
             yield Coupon.create(customerID=self.customerID,
                                 amount=couponAmount)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120811/bb4309a5/attachment.html>


More information about the calendarserver-changes mailing list