Skip to content

Commit 2e95cda

Browse files
author
Ted S
authored
Merge pull request #16 from laslabs/feuature/0.1/phone-and-address-types
[ADD] carepoint: Support Address and Phone types
2 parents 4ef70e4 + d16a561 commit 2e95cda

3 files changed

Lines changed: 43 additions & 5 deletions

File tree

carepoint/models/address_mixin.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,36 @@
22
# Copyright 2016 LasLabs Inc.
33
# License MIT (https://opensource.org/licenses/MIT).
44

5+
import enum
6+
57
from sqlalchemy import (Column,
68
Integer,
79
DateTime,
8-
ForeignKey
10+
ForeignKey,
11+
Enum,
912
)
1013
from sqlalchemy.ext.declarative import declared_attr
1114

1215

16+
class EnumAddressType(enum.Enum):
17+
""" It provides PEP-0435 compliant Carepoint Address Type Enumerable """
18+
19+
business = 1
20+
home = 2
21+
school = 3
22+
vacation = 4
23+
other = 5
24+
billing = 6
25+
shipping = 7
26+
27+
1328
class AddressMixin(object):
1429
""" This is a mixin for Address Many2Many bindings """
1530

1631
priority = Column(Integer)
17-
addr_type_cn = Column(Integer)
32+
addr_type_cn = Column(
33+
Enum(EnumAddressType),
34+
)
1835
app_flags = Column(Integer)
1936
timestmp = Column(DateTime)
2037

carepoint/models/phone_mixin.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,40 @@
22
# Copyright 2016 LasLabs Inc.
33
# License MIT (https://opensource.org/licenses/MIT).
44

5+
import enum
6+
57
from sqlalchemy import (Column,
68
Integer,
79
DateTime,
8-
ForeignKey
10+
ForeignKey,
11+
Enum,
912
)
1013
from sqlalchemy.ext.declarative import declared_attr
1114

1215

16+
class EnumPhoneType(enum.Enum):
17+
""" It provides PEP-0435 compliant Carepoint Phone Type Enumerable """
18+
19+
assistant = 1
20+
business = 2
21+
business_2 = 3
22+
business_fax = 4
23+
car = 5
24+
home = 6
25+
home_2 = 7
26+
home_fax = 8
27+
mobile = 9
28+
beeper = 10
29+
other_fax = 11
30+
31+
1332
class PhoneMixin(object):
1433
""" This is a mixin for Phone Many2Many bindings """
1534

1635
priority = Column(Integer)
17-
phone_type_cn = Column(Integer)
36+
phone_type_cn = Column(
37+
Enum(EnumPhoneType),
38+
)
1839
app_flags = Column(Integer)
1940
timestmp = Column(DateTime)
2041

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
PACKAGE_NAME = 'carepoint'
11-
VERSION = '0.0.1.1'
11+
VERSION = '0.1.2'
1212

1313

1414
setup(

0 commit comments

Comments
 (0)