From f34afd52aa1b89163d90a21feac7bd9e3425639d Mon Sep 17 00:00:00 2001 From: Rafik Draoui Date: Tue, 7 Jan 2020 10:54:25 -0500 Subject: [PATCH] Make `AgencyChain.agencies` a "resource collection" field 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. --- gapipy/resources/booking/agency_chain.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gapipy/resources/booking/agency_chain.py b/gapipy/resources/booking/agency_chain.py index 512afbf..dc391ae 100644 --- a/gapipy/resources/booking/agency_chain.py +++ b/gapipy/resources/booking/agency_chain.py @@ -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', @@ -28,3 +28,5 @@ class AgencyChain(Resource): _resource_fields = [ ('booking_company', BookingCompany), ] + + _resource_collection_fields = [('agencies', 'Agency')]