From: Mark Huang Date: Mon, 25 Sep 2006 14:45:12 +0000 (+0000) Subject: - support new schema X-Git-Tag: pycurl-7_13_1~718 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e2386d7ab54feb80871179dc21e927ff0b422d20;p=plcapi.git - support new schema - rename flush() to sync() to be like shelve - remove extraneous imports - fix address_type association --- diff --git a/PLC/Addresses.py b/PLC/Addresses.py index 45b4b131..d51b47d2 100644 --- a/PLC/Addresses.py +++ b/PLC/Addresses.py @@ -1,8 +1,5 @@ -from types import StringTypes - from PLC.Faults import * from PLC.Parameter import Parameter -from PLC.Debug import profile from PLC.Table import Row, Table class Address(Row): @@ -13,8 +10,8 @@ class Address(Row): fields = { 'address_id': Parameter(int, "Address type"), - 'address_type_id': Parameter(int, "Address type identifier"), - 'address_type': Parameter(str, "Address type name"), + 'address_type_ids': Parameter([int], "Address type identifiers"), + 'address_types': Parameter([str], "Address type names"), 'line1': Parameter(str, "Address line 1"), 'line2': Parameter(str, "Address line 2"), 'line3': Parameter(str, "Address line 3"), @@ -26,9 +23,9 @@ class Address(Row): def __init__(self, api, fields): self.api = api - dict.__init__(fields) + Row.__init__(fields) - def flush(self, commit = True): + def sync(self, commit = True): # XXX pass