22860c4dd2a38d894a98e71fd2b580c88f904b38
[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 identifier"),
13         'line1': Parameter(str, "Address line 1"),
14         'line2': Parameter(str, "Address line 2"),
15         'line3': Parameter(str, "Address line 3"),
16         'city': Parameter(str, "City"),
17         'state': Parameter(str, "State or province"),
18         'postalcode': Parameter(str, "Postal code"),
19         'country': Parameter(str, "Country"),
20         'address_type': Parameter(str, "Address type"),
21         }
22
23     def __init__(self, api, fields):
24         self.api = api
25         Row.__init__(fields)
26
27     def sync(self, commit = True):
28         # XXX
29         pass
30
31     def delete(self, commit = True):
32         # XXX
33         pass
34
35 class Addresses(Table):
36     """
37     Representation of row(s) from the addresses table in the
38     database.
39     """
40
41     def __init__(self, api, address_id_list = None):
42         # XXX
43         pass