def save_subresource(self, subresource):
        """
        Save the sub-resource

        NOTE: Currently assumes subresources are stored within a dictionary,
        keyed with the subresource's ID
        """
        data = deepcopy(subresource._resource)
        data.pop('id', None)
        data.pop(self.resource_type + '_id', None)

        subresources = getattr(self, subresource.parent_key, {})
        subresources[subresource.id] = data
        setattr(self, subresource.parent_key, subresources)

        yield self._save()
def save_subresource ( self , subresource ) : data = deepcopy ( subresource . _resource ) data . pop ( 'id' , None ) data . pop ( self . resource_type + '_id' , None ) subresources = getattr ( self , subresource . parent_key , { } ) subresources [ subresource . id ] = data setattr ( self , subresource . parent_key , subresources ) yield self . _save ( )
Save the sub-resource

        NOTE: Currently assumes subresources are stored within a dictionary,
        keyed with the subresource's ID