Open
Description
this is similar to .annotate
but slightly different / more manual querying
an example from some sentry code:
commit_results = list(
Commit.objects.extra(
select={"group_id": "sentry_grouplink.group_id"},
tables=["sentry_grouplink"],
where=[
"sentry_grouplink.linked_id = sentry_commit.id",
"sentry_grouplink.group_id IN ({})".format(
", ".join(str(i.id) for i in resolved_groups)
),
"sentry_grouplink.linked_type = %s",
"sentry_grouplink.relationship = %s",
],
params=[int(GroupLink.LinkedType.commit), int(GroupLink.Relationship.resolves)],
)
)
_commit_resolutions = {
i.group_id: d for i, d in zip(commit_results, serialize(commit_results, user)) # error here
}
would probably be pretty tricky to get the exact types out -- but at the very least I would rather have mypy understand that group_id
attribute exists