From: Mark Huang Date: Mon, 8 Jan 2007 20:01:11 +0000 (+0000) Subject: - python < 2.4 does not support function decorators X-Git-Tag: pycurl-7_13_1~154 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3a5113656ca6eae376c94c05405654c21575c126;p=plcapi.git - python < 2.4 does not support function decorators --- diff --git a/PLC/Table.py b/PLC/Table.py index 12290073..60682edc 100644 --- a/PLC/Table.py +++ b/PLC/Table.py @@ -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