Skip to content

Commit

Permalink
Make AgencyChain.agencies a "resource collection" field
Browse files Browse the repository at this point in the history
We can now get a `Query` when accessing the `agencies` attribute on an
`AgencyChain` instead of a dict with an URI to the agencies list.
  • Loading branch information
rafikdraoui committed Jan 7, 2020
1 parent 4bf6267 commit f34afd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gapipy/resources/booking/agency_chain.py
Expand Up @@ -7,12 +7,12 @@

class AgencyChain(Resource):
_resource_name = 'agency_chains'
_is_parent_resource = True

_as_is_fields = [
'id',
'href',
'name',
'agencies',
'agent_notifications',
'communication_preferences',
'flags',
Expand All @@ -28,3 +28,5 @@ class AgencyChain(Resource):
_resource_fields = [
('booking_company', BookingCompany),
]

_resource_collection_fields = [('agencies', 'Agency')]

0 comments on commit f34afd5

Please sign in to comment.