Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
models: Tighten type annotation for query_for_ids.
Zixuan James Li3400cb425b56
diff --git a/zerver/models.py b/zerver/models.pyindex 1ee6474c091..7a1749c47a2 100644--- a/zerver/models.py+++ b/zerver/models.py@@ -155,7 +155,15 @@ class AndNonZero(models.Lookup):return f"{lhs} & {rhs} != 0", lhs_params + rhs_params-def query_for_ids(query: QuerySet, user_ids: List[int], field: str) -> QuerySet:+ModelT = TypeVar("ModelT", bound=models.Model)+RowT = TypeVar("RowT")+++def query_for_ids(+ query: "ValuesQuerySet[ModelT, RowT]",+ user_ids: List[int],+ field: str,+) -> "ValuesQuerySet[ModelT, RowT]":"""This function optimizes searches of the form`user_profile_id in (1, 2, 3, 4)` by quickly