python: Import F, Q, QuerySet from their canonical module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-03-03 16:52:14 -08:00 committed by Tim Abbott
parent aa577a554b
commit d3efd4c095
17 changed files with 17 additions and 24 deletions

View File

@ -3,7 +3,7 @@ from datetime import datetime
from typing import Any, Dict, List, Optional, Set, Tuple
from django.db import connection
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from django.http import HttpRequest, HttpResponse, HttpResponseNotFound
from django.shortcuts import render
from django.utils.timezone import now as timezone_now

View File

@ -4,7 +4,7 @@ from datetime import datetime, timedelta, timezone
from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union, cast
from django.conf import settings
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from django.http import HttpRequest, HttpResponse, HttpResponseNotFound
from django.shortcuts import render
from django.utils import translation

View File

@ -1,7 +1,7 @@
from typing import Any, Dict, List, Tuple
from django.conf import settings
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render

View File

@ -5,7 +5,7 @@ from typing import Any, Dict, Literal, Optional, Tuple, Union
import orjson
from django.conf import settings
from django.db import transaction
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from django.utils.timezone import now as timezone_now
from confirmation.models import Confirmation, create_confirmation_link, generate_key

View File

@ -5,9 +5,8 @@ from collections import defaultdict
from typing import Dict, List, Optional
from django.conf import settings
from django.db.models import Sum
from django.db.models import F, Sum
from django.db.models.functions import Length
from django.db.models.query import F
from zerver.models import BotConfigData, UserProfile

View File

@ -1,9 +1,8 @@
from typing import List, Optional, Tuple
from django.conf import settings
from django.db.models import Sum
from django.db.models import F, Sum
from django.db.models.functions import Length
from django.db.models.query import F
from zerver.models import BotStorageData, UserProfile

View File

@ -25,8 +25,7 @@ from typing import (
from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.base import BaseCache
from django.db.models import Q
from django.db.models.query import QuerySet
from django.db.models import Q, QuerySet
from django.http import HttpRequest
from typing_extensions import ParamSpec

View File

@ -5,7 +5,7 @@ from typing import Any, Callable, Dict, Iterable, Tuple
from django.conf import settings
from django.contrib.sessions.models import Session
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from django.utils.timezone import now as timezone_now
from django_stubs_ext import ValuesQuerySet

View File

@ -5,8 +5,7 @@ from typing import Any, DefaultDict, Dict, Iterable, List, Optional, Sequence, S
from django.conf import settings
from django.db import transaction
from django.db.models import Max
from django.db.models.query import QuerySet
from django.db.models import Max, QuerySet
from django.utils.timezone import now as timezone_now
from sentry_sdk import capture_exception

View File

@ -1,8 +1,7 @@
from typing import Collection, List, Optional, Set, Tuple, TypedDict, Union
from django.db import transaction
from django.db.models import Exists, OuterRef, Q
from django.db.models.query import QuerySet
from django.db.models import Exists, OuterRef, Q, QuerySet
from django.utils.timezone import now as timezone_now
from django.utils.translation import gettext as _

View File

@ -4,7 +4,7 @@ from typing import Any, Callable, Collection, Dict, Iterable, List, Mapping, Opt
from django.core.exceptions import ValidationError
from django.db import connection
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from django.utils.translation import gettext as _
from psycopg2.sql import SQL

View File

@ -3,7 +3,7 @@ from typing import Any, Dict, List, Optional, Tuple
import orjson
from django.db import connection
from django.db.models.query import Q, QuerySet
from django.db.models import Q, QuerySet
from sqlalchemy.sql import ColumnElement, column, func, literal
from sqlalchemy.types import Boolean, Text

View File

@ -1,7 +1,7 @@
import datetime
from typing import Callable, List, Optional, Tuple, TypedDict
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from django.utils.timezone import now as timezone_now
from sqlalchemy.sql import ClauseElement, and_, column, not_, or_
from sqlalchemy.types import Integer

View File

@ -6,7 +6,7 @@ from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Typed
import dateutil.parser as date_parser
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from django.forms.models import model_to_dict
from django.utils.translation import gettext as _
from django_otp.middleware import is_verified

View File

@ -4,7 +4,7 @@ from typing import Any, Dict, List
from django.conf import settings
from django.core.management.base import CommandError
from django.db.models.query import QuerySet
from django.db.models import QuerySet
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.soft_deactivation import (

View File

@ -42,9 +42,8 @@ from django.core.exceptions import ValidationError
from django.core.validators import MinLengthValidator, RegexValidator, URLValidator, validate_email
from django.db import models, transaction
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models import CASCADE, Exists, F, OuterRef, Q, Sum
from django.db.models import CASCADE, Exists, F, OuterRef, Q, QuerySet, Sum
from django.db.models.functions import Lower, Upper
from django.db.models.query import QuerySet
from django.db.models.signals import post_delete, post_save, pre_delete
from django.db.models.sql.compiler import SQLCompiler
from django.utils.timezone import now as timezone_now

View File

@ -7,8 +7,7 @@ from unittest.mock import patch
import orjson
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.db.models.query import QuerySet
from django.db.models import Q, QuerySet
from django.utils.timezone import now as timezone_now
from analytics.models import UserCount