- python < 2.4 does not support function decorators
authorMark Huang <mlhuang@cs.princeton.edu>
Mon, 8 Jan 2007 20:01:11 +0000 (20:01 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Mon, 8 Jan 2007 20:01:11 +0000 (20:01 +0000)
PLC/Table.py

index 1229007..60682ed 100644 (file)
@@ -64,7 +64,6 @@ class Row(dict):
             raise PLCInvalidArgument, "%s: date must be in the future"%human
        return human
 
-    @classmethod
     def add_object(self, classobj, join_table, columns = None):
         """
         Returns a function that can be used to associate this object
@@ -103,8 +102,9 @@ class Row(dict):
                 self.api.db.commit()
     
         return add
-    
-    @classmethod
+
+    add_object = classmethod(add_object)
+
     def remove_object(self, classobj, join_table):
         """
         Returns a function that can be used to disassociate this
@@ -138,6 +138,8 @@ class Row(dict):
 
         return remove
 
+    remove_object = classmethod(remove_object)
+
     def db_fields(self, obj = None):
         """
         Return only those fields that can be set or updated directly