def METHOD_NAME(self, flat=False):
    from assets.models import Node
    nodes_keys = self.nodes.all().values_list('key', flat=True)
    asset_ids = set(self.assets.all().values_list('id', flat=True))
    nodes_asset_ids = Node.get_nodes_all_asset_ids_by_keys(nodes_keys)
    asset_ids.update(nodes_asset_ids)
    if flat:
        return asset_ids
    assets = Asset.objects.filter(id__in=asset_ids)
    return assets