- support new schema
[plcapi.git] / PLC / Addresses.py
1 from PLC.Faults import *
2 from PLC.Parameter import Parameter
3 from PLC.Table import Row, Table
4
5 class Address(Row):
6     """
7     Representation of a row in the addresses table. To use, instantiate
8     with a dict of values.
9     """
10
11     fields = {
12         'address_id': Parameter(int, "Address type"),
13         'address_type_ids': Parameter([int], "Address type identifiers"),
14         'address_types': Parameter([str], "Address type names"),
15         'line1': Parameter(str, "Address line 1"),
16         'line2': Parameter(str, "Address line 2"),
17         'line3': Parameter(str, "Address line 3"),
18         'city': Parameter(str, "City"),
19         'state': Parameter(str, "State or province"),
20         'postalcode': Parameter(str, "Postal code"),
21         'country': Parameter(str, "Country"),
22         }
23
24     def __init__(self, api, fields):
25         self.api = api
26         Row.__init__(fields)
27
28     def sync(self, commit = True):
29         # XXX
30         pass
31
32     def delete(self, commit = True):
33         # XXX
34         pass
35
36 class Addresses(Table):
37     """
38     Representation of row(s) from the addresses table in the
39     database.
40     """
41
42     def __init__(self, api, address_id_list = None):
43         # XXX
44         pass