[CalendarServer-changes] [10268] CalendarServer/branches/users/glyph/queue-locking-and-timing

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 4 16:39:34 PST 2013


Revision: 10268
          http://trac.calendarserver.org//changeset/10268
Author:   glyph at apple.com
Date:     2013-01-04 16:39:34 -0800 (Fri, 04 Jan 2013)
Log Message:
-----------
Make the test pass.

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

Property Changed:
----------------
    CalendarServer/branches/users/glyph/queue-locking-and-timing/

Modified: CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/dal/record.py
===================================================================
--- CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/dal/record.py	2013-01-05 00:39:32 UTC (rev 10267)
+++ CalendarServer/branches/users/glyph/queue-locking-and-timing/twext/enterprise/dal/record.py	2013-01-05 00:39:34 UTC (rev 10268)
@@ -26,6 +26,7 @@
 from twext.enterprise.dal.syntax import (
     Select, Tuple, Constant, ColumnSyntax, Insert, Update, Delete
 )
+from twext.enterprise.util import parseSQLTimestamp
 # from twext.enterprise.dal.syntax import ExpressionSyntax
 
 class ReadOnly(AttributeError):
@@ -229,7 +230,11 @@
         result = yield (Insert(colmap, Return=needsCols if needsCols else None)
                         .on(transaction))
         if needsCols:
-            for neededAttr, neededValue in zip(needsAttrs, result[0]):
+            for neededAttr, neededValue, neededColumn in zip(needsAttrs,
+                                                             result[0],
+                                                             needsCols):
+                if neededColumn.model.type.name == "timestamp":
+                    neededValue = parseSQLTimestamp(neededValue)
                 setattr(self, neededAttr, neededValue)
         self.transaction = transaction
         returnValue(self)
@@ -328,7 +333,8 @@
     @inlineCallbacks
     def _rowsFromQuery(cls, transaction, qry, rozrc):
         """
-        Execute the given query, and transform its results into rows.
+        Execute the given query, and transform its results into instances of
+        C{cls}.
 
         @param transaction: an L{IAsyncTransaction} to execute the query on.
 
@@ -338,8 +344,8 @@
 
         @param rozrc: The C{raiseOnZeroRowCount} argument.
 
-        @return: a L{Deferred} that succeeds with a C{list} or fails with an
-            exception produced by C{rozrc}.
+        @return: a L{Deferred} that succeeds with a C{list} of instances of
+            C{cls} or fails with an exception produced by C{rozrc}.
         """
         rows = yield qry.on(transaction, raiseOnZeroRowCount=rozrc)
         selves = []
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130104/585e8944/attachment-0001.html>


More information about the calendarserver-changes mailing list