776cb7d86633967bef7cda70c2710e91da234b7b
[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     table_name = 'addresses'
12     primary_key = 'address_id'
13     fields = {
14         'address_id': Parameter(int, "Address identifier"),
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         'address_type': Parameter(str, "Address type"),
23         }
24
25     def __init__(self, api, fields = {}):
26         self.api = api
27         Row.__init__(self, fields)
28
29     def delete(self, commit = True):
30         # XXX
31         pass
32
33 class Addresses(Table):
34     """
35     Representation of row(s) from the addresses table in the
36     database.
37     """
38
39     def __init__(self, api, address_id_list = None):
40         # XXX
41         pass