[CalendarServer-changes] [7147] CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/ model.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 7 19:06:31 PST 2011


Revision: 7147
          http://trac.macosforge.org/projects/calendarserver/changeset/7147
Author:   glyph at apple.com
Date:     2011-03-07 19:06:31 -0800 (Mon, 07 Mar 2011)
Log Message:
-----------
comparable model classes

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/model.py

Modified: CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/model.py
===================================================================
--- CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/model.py	2011-03-08 03:06:18 UTC (rev 7146)
+++ CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/model.py	2011-03-08 03:06:31 UTC (rev 7147)
@@ -18,6 +18,7 @@
 """
 Model classes for SQL.
 """
+from twisted.python.util import FancyEqMixin
 
 class SQLType(object):
     """
@@ -123,7 +124,7 @@
 
 
 
-class Column(object):
+class Column(FancyEqMixin, object):
     """
     A column from a table.
 
@@ -147,6 +148,8 @@
     @type cascade: C{bool}
     """
 
+    compareAttributes = 'table name'.split()
+
     def __init__(self, table, name, type):
         _checkstr(name)
         self.table = table
@@ -210,7 +213,7 @@
 
 
 
-class Table(object):
+class Table(FancyEqMixin, object):
     """
     A set of columns.
 
@@ -222,6 +225,8 @@
     @ivar schema: a reference to the L{Schema} to which this table belongs.
     """
 
+    compareAttributes = 'schema name'.split()
+
     def __init__(self, schema, name):
         _checkstr(name)
         self.descriptiveComment = ''
@@ -324,11 +329,13 @@
 
 
 
-class Sequence(object):
+class Sequence(FancyEqMixin, object):
     """
     A sequence object.
     """
 
+    compareAttributes = 'name'.split()
+
     def __init__(self, name):
         _checkstr(name)
         self.name = name
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110307/bb1735fd/attachment.html>


More information about the calendarserver-changes mailing list