[CalendarServer-changes] [8773] CalendarServer/branches/users/glyph/case-insensitive-uid
source_changes at macosforge.org
source_changes at macosforge.org
Wed Feb 29 10:14:51 PST 2012
Revision: 8773
http://trac.macosforge.org/projects/calendarserver/changeset/8773
Author: glyph at apple.com
Date: 2012-02-29 10:14:50 -0800 (Wed, 29 Feb 2012)
Log Message:
-----------
Model data and method for 'check' constraint.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/case-insensitive-uid/twext/enterprise/dal/model.py
Property Changed:
----------------
CalendarServer/branches/users/glyph/case-insensitive-uid/
Modified: CalendarServer/branches/users/glyph/case-insensitive-uid/twext/enterprise/dal/model.py
===================================================================
--- CalendarServer/branches/users/glyph/case-insensitive-uid/twext/enterprise/dal/model.py 2012-02-29 18:10:44 UTC (rev 8772)
+++ CalendarServer/branches/users/glyph/case-insensitive-uid/twext/enterprise/dal/model.py 2012-02-29 18:14:50 UTC (rev 8773)
@@ -94,6 +94,21 @@
+class Check(Constraint):
+ """
+ A 'check' constraint, which evaluates an SQL expression.
+
+ @ivar expression: the expression that should evaluate to True.
+ @type expression: L{twext.enterprise.dal.syntax.ExpressionSyntax}
+ """
+ # XXX TODO: model for expression, rather than
+
+ def __init__(self, syntaxExpression):
+ self.expression = syntaxExpression
+ self.type = 'CHECK'
+
+
+
class ProcedureCall(object):
"""
An invocation of a stored procedure or built-in function.
@@ -290,6 +305,16 @@
self.constraints.append(Constraint(constraintType, affectsColumns))
+ def checkConstraint(self, protoExpression):
+ """
+ This table is affected by a 'check' constraint. (Should only be called
+ during schema parsing.)
+
+ @param protoExpression: proto expression.
+ """
+ self.constraints.append(Check(protoExpression))
+
+
def insertSchemaRow(self, values):
"""
A statically-defined row was inserted as part of the schema itself.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120229/eeb1351a/attachment.html>
More information about the calendarserver-changes
mailing list