def log_affected_projects(pkg, **kwargs):
    affected_projects = Project.objects.filter(dependencies__package=pkg) \
                                       .values_list('id', flat=True)

    log_entries = []
    for project in affected_projects:
        # Add log entry for new package release
        log = Log(project_id=project, **kwargs)
        log_entries.append(log)
    Log.objects.bulk_create(log_entries)
    return affected_projects
Create log entries for all projects that require `pkg`.
dataset/ETHPy150Open rocketDuck/folivora/folivora/tasks.py/log_affected_projects