Skip to content

Commit

Permalink
Merge pull request #86 from gadventures/customer-address
Browse files Browse the repository at this point in the history
Customers.address should use/return the Address BaseModel
  • Loading branch information
bartek committed Dec 6, 2017
2 parents 43bdbe7 + b6ce269 commit b4b808d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gapipy/models/address.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from gapipy.utils import enforce_string_type

from .base import BaseModel
from ..utils import enforce_string_type


class Address(BaseModel):
Expand Down
9 changes: 7 additions & 2 deletions gapipy/resources/booking/customer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Python 2 and 3
from __future__ import unicode_literals

from ..base import Resource, BaseModel
from gapipy.models import Address
from gapipy.models.base import BaseModel
from gapipy.resources.base import Resource


class MedicalDetail(BaseModel):
Expand All @@ -15,7 +17,6 @@ class Customer(Resource):

_as_is_fields = [
'account_email',
'address',
'emergency_contacts',
'gender',
'href',
Expand All @@ -32,6 +33,10 @@ class Customer(Resource):

_date_fields = ['date_of_birth', ]

_model_fields = [
('address', Address),
]

_model_collection_fields = [
('medical_details', MedicalDetail),
]
Expand Down

0 comments on commit b4b808d

Please sign in to comment.