[CalendarServer-changes] [8779] CalendarServer/branches/users/glyph/case-insensitive-uid

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 29 10:15:13 PST 2012


Revision: 8779
          http://trac.macosforge.org/projects/calendarserver/changeset/8779
Author:   glyph at apple.com
Date:     2012-02-29 10:15:13 -0800 (Wed, 29 Feb 2012)
Log Message:
-----------
move responsibility for quoting decision into QueryGenerator

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/case-insensitive-uid/twext/enterprise/dal/syntax.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/case-insensitive-uid/

Modified: CalendarServer/branches/users/glyph/case-insensitive-uid/twext/enterprise/dal/syntax.py
===================================================================
--- CalendarServer/branches/users/glyph/case-insensitive-uid/twext/enterprise/dal/syntax.py	2012-02-29 18:15:10 UTC (rev 8778)
+++ CalendarServer/branches/users/glyph/case-insensitive-uid/twext/enterprise/dal/syntax.py	2012-02-29 18:15:13 UTC (rev 8779)
@@ -113,7 +113,11 @@
         return "genid_%d" % (self.generatedID(),)
 
 
+    def shouldQuote(self, name):
+        return (self.dialect == ORACLE_DIALECT and name.lower() in _KEYWORDS)
 
+
+
 class TableMismatch(Exception):
     """
     A table in a statement did not match with a column.
@@ -699,7 +703,7 @@
         # XXX This, and 'model', could in principle conflict with column names.
         # Maybe do something about that.
         name = self.model.name
-        if queryGenerator.dialect == ORACLE_DIALECT and name.lower() in _KEYWORDS:
+        if queryGenerator.shouldQuote(name):
             name = '"%s"' % (name,)
 
         if self._alwaysQualified:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120229/e7d88983/attachment.html>


More information about the calendarserver-changes mailing list