hash
stringlengths
64
64
content
stringlengths
0
1.51M
0107af0dba94f4d78666f7f10d7a043b0773c6f2fda63972f2873d709deed826
from django.conf.urls.i18n import i18n_patterns from django.urls import include, path, re_path from django.utils.translation import gettext_lazy as _ from django.views.generic import TemplateView view = TemplateView.as_view(template_name='dummy.html') urlpatterns = [ path('not-prefixed/', view, name='not-prefixed...
6ec6a72d0e8e96c47c482dad7c90d940bac9689c39154abc70dd8d89c0040d6c
from collections import Counter from itertools import chain from operator import attrgetter from django.db import IntegrityError, connections, transaction from django.db.models import signals, sql class ProtectedError(IntegrityError): def __init__(self, msg, protected_objects): self.protected_objects = p...
f7dfc8a6f2bf1f5082b5912b24e9dc7eae122fa7fbad73e1f85726fb2e4512d9
import collections import re import warnings from itertools import chain from django.core.exceptions import EmptyResultSet, FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref from django.db.models.query_utils import QueryWrapper, select_re...
b95470a36eba620f2d1e59a4eb4d375134e0e185679a0a73e9a612bb0b1e669e
from math import ceil from django.db import IntegrityError, connection, models from django.db.models.deletion import Collector from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models import ( MR, A, Avatar, Base, Child,...
8d18150b816d40f57262368cb9ed709ae8961902f32307fbfe3bb7c4124af5fb
from django.db import models class R(models.Model): is_default = models.BooleanField(default=False) def __str__(self): return "%s" % self.pk def get_default_r(): return R.objects.get_or_create(is_default=True)[0].pk class S(models.Model): r = models.ForeignKey(R, models.CASCADE) class T...
8b04d5421fe15fd15b94c75362b778d5a365e286efeaf2ea05a87654ab594835
#!/usr/bin/env python import argparse import atexit import copy import os import shutil import socket import subprocess import sys import tempfile import warnings try: import django except ImportError as e: raise RuntimeError( 'Django module not found, reference tests/README.rst for instructions.' ...
832636980c873f33113306aeeea3e0926aa597a87f8323b61b9a86142769200f
import logging import re import sys import time import warnings from contextlib import contextmanager from functools import wraps from io import StringIO from itertools import chain from types import SimpleNamespace from unittest import TestCase, skipIf, skipUnless from xml.dom.minidom import Node, parseString from dj...
27d503745b856c945596ed064fdc0547b5461e7e7a6f69b40f3dfb63c136033c
import functools import itertools import logging import os import pathlib import signal import subprocess import sys import threading import time import traceback import weakref from collections import defaultdict from pathlib import Path from types import ModuleType from zipimport import zipimporter from django.apps ...
85e5f4a3b3216e6e5f3a40270ea1882aae99a28d57c03e1f301082c9a720cf2d
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ import base64 import binascii import cgi import collections from urllib.parse import unquote from django.conf import settings from django.core.exceptions imp...
5281ca614079b75d411b85f6a3fc107ecbf3b97fe5224450b90ec342823029f9
import copy import inspect import warnings from functools import partialmethod from itertools import chain from django.apps import apps from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned, ...
b80ef6077531bec483700a8889d4cf52300addb38668342b727fb85dbc709b40
import datetime import decimal import functools import hashlib import logging from contextlib import contextmanager from time import time from django.conf import settings from django.db.utils import NotSupportedError from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') class Cursor...
207967e5425438de888fefccd3f2175d27a3f958f559bac871a925917256b490
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
560b2e31bd3539c2a452b6737c8242249fda56e1e368fe8e3e9794a2afd12241
import collections import re import warnings from itertools import chain from django.core.exceptions import EmptyResultSet, FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref from django.db.models.query_utils import QueryWrapper, select_re...
77ac77d1e91ff59a073cfc93764136ee0f1565204513b9847b40f644c3fe305c
import psycopg2 from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.backends.ddl_references import IndexColumns class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s" sql_create_sequence...
97c790bf6ccd068adaae0393025fc500e3cfb7391159b7eda4e16be5f5ef767d
from django.db.models import CharField, Field, FloatField, TextField from django.db.models.expressions import CombinedExpression, Func, Value from django.db.models.functions import Cast, Coalesce from django.db.models.lookups import Lookup class SearchVectorExact(Lookup): lookup_name = 'exact' def process_rh...
b90f3cd117b41b4ad1dbb4b0523227bce71a0023a387f54f85563ebc1b2a90fc
import datetime import re from unittest import mock from django import forms from django.contrib.auth.forms import ( AdminPasswordChangeForm, AuthenticationForm, PasswordChangeForm, PasswordResetForm, ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget, SetPasswordForm, UserChangeForm, UserCreationForm, ...
2ca91c038133e4fcfdfec34a8bca6a799b545a90ca3949a176a1f8dcfddfc935
import os import unittest import warnings from io import StringIO from unittest import mock from django.conf import settings from django.contrib.staticfiles.finders import get_finder, get_finders from django.contrib.staticfiles.storage import staticfiles_storage from django.core.exceptions import ImproperlyConfigured ...
809d490104eaa8c19c0cfa828f59b4d39b23645a891f0cf33d13b458e185d297
""" Test PostgreSQL full text search. These tests use dialogue from the 1975 film Monty Python and the Holy Grail. All text copyright Python (Monty) Pictures. Thanks to sacred-texts.com for the transcript. """ from django.contrib.postgres.search import ( SearchQuery, SearchRank, SearchVector, ) from django.db impo...
baed29b78762a866cc4460de2e8e90a707251b545bd8ade11891b79ea8226e40
import re from io import StringIO from unittest import mock, skipUnless from django.core.management import call_command from django.db import connection from django.db.backends.base.introspection import TableInfo from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from .models import PeopleMore...
be06e0b0327d3b53b09366d88e586d26a15a1538b497c81029f283847e665f4b
import contextlib import os import py_compile import shutil import sys import tempfile import threading import time import types import weakref import zipfile from importlib import import_module from pathlib import Path from unittest import mock, skip, skipIf from django.apps.registry import Apps from django.test impo...
68371290ed6c47a3bf58e314931a7b7324369db39a3625316641cc29f0996ede
import threading from datetime import datetime, timedelta from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections, models from django.db.models.manager import BaseManager from django.db.models.query import EmptyQuerySet, QuerySet...
1c01f859fdc9ccc2b9ce6e866d6e601c995c2c158299c81f3def219a5750228d
import datetime import os from decimal import Decimal from unittest import mock, skipUnless from django import forms from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ) from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import Validation...
4256bc56f9e11c71506eabdca8d840ae0505548642a4becab0e71e1d87cf2506
from math import ceil from django.db import IntegrityError, connection, models from django.db.models.deletion import Collector from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models import ( MR, A, Avatar, Base, Child,...
5fa245a08658b09669522036abdd4f6cfe76071e005aa9c7ab963f71f9f4966d
from django.db import connection, transaction from django.db.models import Case, Count, F, FilteredRelation, Q, When from django.test import TestCase from django.test.testcases import skipUnlessDBFeature from .models import Author, Book, Borrower, Editor, RentalSession, Reservation class FilteredRelationTests(TestCa...
538fad1085f20c3c624a8ffa9e4cd3cb3343eb88cf4f5085b88473e37d4b56b5
import ctypes import itertools import logging import multiprocessing import os import pickle import textwrap import unittest from importlib import import_module from io import StringIO from django.core.management import call_command from django.db import connections from django.test import SimpleTestCase, TestCase fro...
f56805d5842fedf02ef50cd92fa40f6f7cb7e4686ef0e559240f380c74c49c06
import copy import inspect import warnings from functools import partialmethod from itertools import chain from django.apps import apps from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned, ...
05100d677841eba5dab0700a869ee8c4131dae889d667d45ead8ff6d44b875d4
import collections.abc import copy import datetime import decimal import operator import uuid import warnings from base64 import b64decode, b64encode from functools import partialmethod, total_ordering from django import forms from django.apps import apps from django.conf import settings from django.core import checks...
7073c9ccc7e4e4d301cbe0ef2da0057da6ca975cc9e70513b31f8900a4461588
import collections import re import warnings from itertools import chain from django.core.exceptions import EmptyResultSet, FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref from django.db.models.query_utils import QueryWrapper, select_re...
3e7727cac7318aa049ef1cd492615f022f5e0df922e01926faf4a06992b27fd4
import contextlib import os import py_compile import shutil import sys import tempfile import threading import time import types import weakref import zipfile from importlib import import_module from pathlib import Path from unittest import mock, skip, skipIf from django.apps.registry import Apps from django.test impo...
24de93804f1e7f2a9aa1cce99b7ddeaef4145bac38cef19610c4a5e1f35af167
""" A series of tests to establish that the command-line management tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ import os import re import shutil import socket import subprocess import sys import tempfile import unittest from io imp...
c9133d329e351642b77bb2cee948760c173985a8c233aa4186139e5bfca487a7
import datetime import pickle import unittest import uuid from copy import deepcopy from django.core.exceptions import FieldError from django.db import DatabaseError, connection, models from django.db.models import CharField, Q, TimeField, UUIDField from django.db.models.aggregates import ( Avg, Count, Max, Min, S...
5e81b616e640935b2b146338ea0d24647a92d6e2fe02d59141d662edb57d5f19
import functools import itertools import logging import os import pathlib import signal import subprocess import sys import threading import time import traceback import weakref from collections import defaultdict from pathlib import Path from types import ModuleType from zipimport import zipimporter from django.apps ...
c535d4bf6230abfc99e302de442a56c85f6767aeda503f64709b716a5c574665
import datetime import decimal import functools import hashlib import logging from contextlib import contextmanager from time import time from django.conf import settings from django.db.utils import NotSupportedError from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') class Cursor...
526ae9cd12dbcae438eeb95f887023279f2131e4335a14d4f9aa0a1e569e6da2
import collections.abc import copy import datetime import decimal import operator import uuid import warnings from base64 import b64decode, b64encode from functools import partialmethod, total_ordering from django import forms from django.apps import apps from django.conf import settings from django.core import checks...
ccb48fbc06138322ad211b904afcff7b903c7f56ec1082d8e040df24a8d23bb2
from django.core.exceptions import FieldDoesNotExist from django.db import connection, migrations, models, transaction from django.db.migrations.migration import Migration from django.db.migrations.operations import CreateModel from django.db.migrations.operations.fields import FieldOperation from django.db.migrations....
79e9359566693a61e513a3a8322000a554286155862c01a615749d677200bd27
import os import time import warnings from asgiref.local import Local from django.apps import apps from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.db import connections, router from django.db.utils import ConnectionRouter from django.dispatch import ...
e4134517c0883f28171ccadc0ad9c17e516377aedf24f981608c401eab676702
import functools import itertools import logging import os import signal import subprocess import sys import threading import time import traceback import weakref from collections import defaultdict from pathlib import Path from types import ModuleType from zipimport import zipimporter from django.apps import apps fro...
feec83c6766aac93bdf759a04f85a4481cdc10b9379a9ab5ac2ba67130aa0109
""" Timezone-related classes and functions. """ import functools import warnings from contextlib import ContextDecorator from datetime import datetime, timedelta, timezone, tzinfo import pytz from asgiref.local import Local from django.conf import settings from django.utils.deprecation import RemovedInDjango31Warnin...
d5f3f6aefd619b22bec1aff1a693574c9224d391766b47e76b8e36333f93006e
import codecs import datetime import locale import warnings from decimal import Decimal from urllib.parse import quote from django.utils.deprecation import RemovedInDjango40Warning from django.utils.functional import Promise class DjangoUnicodeDecodeError(UnicodeDecodeError): def __init__(self, obj, *args): ...
b92eaa6d67259a95c01495b109d82023d481480b9db9bdf6d3db893f90ccaebf
"""HTML utilities suitable for global use.""" import html import json import re from html.parser import HTMLParser from urllib.parse import ( parse_qsl, quote, unquote, urlencode, urlsplit, urlunsplit, ) from django.utils.encoding import punycode from django.utils.functional import Promise, keep_lazy, keep_lazy_t...
e4a56c04ff3ebdbc20add828fe687068b1f568f4b4e92f866c8e865615bb0403
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
2abe9ca919cfa80ad245e4c5e7b087242ede6bc80964b5d80fb505c4ff7c9bdc
from urllib.parse import urlsplit, urlunsplit from asgiref.local import Local from django.utils.encoding import iri_to_uri from django.utils.functional import lazy from django.utils.translation import override from .exceptions import NoReverseMatch, Resolver404 from .resolvers import get_ns_resolver, get_resolver fr...
024ad1488d89a97cb7148e4e6c26c7bbcaf797760478a770ee6c84090b9a1a1e
""" This module converts requested URLs to callback view functions. URLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a ResolverMatch object which provides access to all attributes of the resolved URL match. """ import functools import inspect import re from importlib impor...
096c703f59582738dc4c18a8a05afac2d07109d9742e6d5b57d695ed27ad05f1
import json from collections import UserList from django.conf import settings from django.core.exceptions import ValidationError # backwards compatibility from django.utils import timezone from django.utils.html import escape, format_html, format_html_join, html_safe from django.utils.translation import gettext_lazy ...
545e96088bda7c6ac75081e9fb31adcdfe82e6c3d3cca2b70c60568a3482489a
import ipaddress import re from pathlib import Path from urllib.parse import urlsplit, urlunsplit from django.core.exceptions import ValidationError from django.utils.deconstruct import deconstructible from django.utils.encoding import punycode from django.utils.functional import SimpleLazyObject from django.utils.ipv...
3e138809aa1ca1b4ccdd2156dbc88b688d5b2ee414c4809b42ea15a7e2546fc2
from pathlib import Path from asgiref.local import Local from django.apps import apps def watch_for_translation_changes(sender, **kwargs): """Register file watchers for .mo files in potential locale paths.""" from django.conf import settings if settings.USE_I18N: directories = [Path('locale')] ...
42dbc7af7daf6d63c6858b2833f47cbed2e544d6bfb70799a9a8789e8fc72b9a
import itertools import math from copy import copy from django.core.exceptions import EmptyResultSet from django.db.models.expressions import Func, Value from django.db.models.fields import DateTimeField, Field, IntegerField from django.db.models.query_utils import RegisterLookupMixin from django.utils.datastructures ...
96ec6cf460a4da10becff00e860cb84d7f05633a7e6f9e14b8311fdc6f28e215
import collections.abc import copy import datetime import decimal import operator import uuid import warnings from base64 import b64decode, b64encode from functools import partialmethod, total_ordering from django import forms from django.apps import apps from django.conf import settings from django.core import checks...
799f63f337ff102f34914a621f37d421d38e46b8b69068605b10c07ce7b0d8a7
import functools import inspect from functools import partial from django import forms from django.apps import apps from django.conf import SettingsReference from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models import Q from djan...
bc22d9c5821a728bcf74ba3a106c7f164172d0345d80feff7a187168edc20846
""" Accessors for related objects. When a field defines a relation between two models, each model class provides an attribute to access related instances of the other model class (unless the reverse accessor has been disabled with related_name='+'). Accessors are implemented as descriptors in order to customize acces...
1c56c6ae44e331a91f2e3eaa0fdf1594edbfda77b8207f55b954071c770c286a
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
cf54ff77698df5040486aa58e5e6983162e0dcaa1e46c50339b96e3a785a42dd
import collections import re import warnings from itertools import chain from django.core.exceptions import EmptyResultSet, FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref, Value from django.db.models.functions import Cast from django.d...
c51461a884d4c9c885c4289c2e37f5b70aecc34997c7c0ad9538c9e1a3937173
""" Oracle database backend for Django. Requires cx_Oracle: https://oracle.github.io/python-cx_Oracle/ """ import datetime import decimal import os import platform from contextlib import contextmanager from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import utils...
56ed01a056edcea04d6e833a890d61c8acecbebfa307cd5cf4f46a8d602b28d7
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.org/project/mysqlclient/ """ import re from django.core.exceptions import ImproperlyConfigured from django.db import utils from django.db.backends import utils as backend_utils from django.db.backends.base.base import BaseDatabaseWrapper from d...
10e621b848e8e95ce14b96c8282c85c3fac0b387652c73c12897b70075adc883
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import asyncio import threading import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import connections from django.db.backends.base.base import Ba...
6b109d12964526f15bc2d139c89a75c47314a3a3d48066cb9c0b7637a8b30db7
""" SQLite backend for the sqlite3 module in the standard library. """ import datetime import decimal import functools import hashlib import math import operator import re import statistics import warnings from itertools import chain from sqlite3 import dbapi2 as Database import pytz from django.core.exceptions impor...
58f5921b6b7f5de9e45d3dfc08308f48c1b474da4b649de50e9560156f8275bc
import functools import os import pkgutil import sys from argparse import _SubParsersAction from collections import defaultdict from difflib import get_close_matches from importlib import import_module import django from django.apps import apps from django.conf import settings from django.core.exceptions import Improp...
59193328e7a9abf5f96453930614204635a761d0929f9921be065104ddd5db37
import asyncio import logging import sys import tempfile import traceback from io import BytesIO from asgiref.sync import sync_to_async from django.conf import settings from django.core import signals from django.core.exceptions import RequestAborted, RequestDataTooBig from django.core.handlers import base from djang...
cdece409d5b5304b9d26c39fdad72cfe1867f4aab81d008108988bb9b6b7fe89
import mimetypes from email import ( charset as Charset, encoders as Encoders, generator, message_from_string, ) from email.errors import HeaderParseError from email.header import Header from email.headerregistry import Address, parser from email.message import Message from email.mime.base import MIMEBase from emai...
ace52c90509c582893553dd119336f0bcccbd549eaa79dcf9c677de1f66cf99c
import unicodedata from django import forms from django.contrib.auth import ( authenticate, get_user_model, password_validation, ) from django.contrib.auth.hashers import ( UNUSABLE_PASSWORD_PREFIX, identify_hasher, ) from django.contrib.auth.models import User from django.contrib.auth.tokens import default_to...
7c941e91d52a40e92fed3a4015e47ca2fd1d88c2fdd6bbe2fe14b1837e1defd5
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils.translation import gettext_lazy as _ from .mixins import CheckFieldDefaultMixin __al...
5e3f3719ee52e3fba4bd44fdade16136a331e1f3a5d4ed0af90d55af919770f2
""" Management utility to create superusers. """ import getpass import os import sys from django.contrib.auth import get_user_model from django.contrib.auth.management import get_default_username from django.contrib.auth.password_validation import validate_password from django.core import exceptions from django.core.m...
a4524f6727cee00c0f4dbb3a0cac014bd16909949a12692071605056b3f16fc5
from collections import defaultdict, namedtuple from django.contrib.gis import forms, gdal from django.contrib.gis.db.models.proxy import SpatialProxy from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.geos import ( GeometryCollection, GEOSException, GEOSGeometry, LineString, Multi...
52aa657de886ffd6b28648500b4df7faf9a9ce48de45fd74458c5464b0b57396
import datetime import importlib import io import os import sys from unittest import mock from django.apps import apps from django.core.management import CommandError, call_command from django.db import ( ConnectionHandler, DatabaseError, connection, connections, models, ) from django.db.backends.base.schema impor...
11919981d901f97c5eb2e21ae55792cf5e5efa80e6606a3e7455c66ce52d2f1b
import functools import re from unittest import mock from django.apps import apps from django.conf import settings from django.contrib.auth.models import AbstractBaseUser from django.core.validators import RegexValidator, validate_slug from django.db import connection, models from django.db.migrations.autodetector imp...
0375ed07371b6a35206cbc79e5d925225c0e5d0700cdee6a56d3b3a7875acb27
import os import sys import unittest from types import ModuleType, SimpleNamespace from unittest import mock from django.conf import ENVIRONMENT_VARIABLE, LazySettings, Settings, settings from django.core.exceptions import ImproperlyConfigured from django.http import HttpRequest from django.test import ( SimpleTes...
b9b0d5fc1b631a92f2d89242773c4cd5bfd8ec0edf01f22450c680211b25c95c
import builtins import getpass import os import sys from datetime import date from io import StringIO from unittest import mock from django.apps import apps from django.contrib.auth import get_permission_codename, management from django.contrib.auth.management import ( create_permissions, get_default_username, ) f...
ec01f79a074b937545b8d72dd2cad7499adbd3b57121072dd1e6b32c3e958e71
import datetime import re from unittest import mock from django import forms from django.contrib.auth.forms import ( AdminPasswordChangeForm, AuthenticationForm, PasswordChangeForm, PasswordResetForm, ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget, SetPasswordForm, UserChangeForm, UserCreationForm, ...
1fce17e6dc299de3e732db44d503d3e0e7d638dac16bd526a8b4232e8cea879c
import uuid from django.core.exceptions import ImproperlyConfigured from django.test import SimpleTestCase from django.test.utils import override_settings from django.urls import Resolver404, path, resolve, reverse from .converters import DynamicConverter from .views import empty_view included_kwargs = {'base': b'he...
fdc3d574573153888873ce2f7af81e5145f52431fdf0dd48c9c50cc65de2352a
import os from io import StringIO from unittest import mock from admin_scripts.tests import AdminScriptTestCase from django.apps import apps from django.core import management from django.core.management import BaseCommand, CommandError, find_commands from django.core.management.utils import ( find_command, get_r...
d4e169cd0b892ca26ef788a5a03666d774585f2902752728c6f1b250db81f5bf
import sys import unittest from django.conf import settings from django.contrib.admindocs import utils, views from django.contrib.admindocs.views import get_return_data_type, simplify_regex from django.contrib.sites.models import Site from django.db import models from django.db.models import fields from django.test im...
41416b323a4eac41e78090f3a3c6be5c38867cd431e2e7da5faeb3fcfd4fa167
import datetime import operator import uuid from decimal import Decimal from django.core import checks, exceptions, serializers from django.core.serializers.json import DjangoJSONEncoder from django.db.models import Count, Q from django.forms import CharField, Form, widgets from django.test.utils import isolate_apps f...
23b66df4e0d62f1caa44f393b78576d8c2fd1e57db018d302c9a8e0cdb7e2424
import json from django.core import checks, exceptions, serializers from django.forms import Form from django.test.utils import isolate_apps from . import PostgreSQLSimpleTestCase, PostgreSQLTestCase from .models import HStoreModel, PostgreSQLModel try: from django.contrib.postgres import forms from django.c...
961dab1096d8c32907af1987a804154ada9f1937815e23e4c9d8a064023235b4
import gzip import random import re import struct from io import BytesIO from urllib.parse import quote from django.conf import settings from django.core import mail from django.core.exceptions import PermissionDenied from django.http import ( FileResponse, HttpRequest, HttpResponse, HttpResponseNotFound, Http...
9cb8d507be1350a2267d78eda710f1e6c8f0f8b35aa582c22c2d6d1fa7880e96
import contextlib import os import py_compile import shutil import sys import tempfile import threading import time import types import weakref import zipfile from importlib import import_module from pathlib import Path from unittest import mock, skip, skipIf from django.apps.registry import Apps from django.test impo...
457b029ad475dcf8f8599042f04043b9cbcecf95e16c57a37e6613b7fb8836c6
import unittest from datetime import datetime from django.test import SimpleTestCase, ignore_warnings from django.utils.datastructures import MultiValueDict from django.utils.deprecation import RemovedInDjango40Warning from django.utils.http import ( base36_to_int, escape_leading_slashes, http_date, int_to_base36,...
15ce768678697bed74622438351df0373b214e26e0d61a2ae82712209f84201a
import json import sys from django.test import SimpleTestCase, ignore_warnings from django.utils import text from django.utils.deprecation import RemovedInDjango40Warning from django.utils.functional import lazystr from django.utils.text import format_lazy from django.utils.translation import gettext_lazy, override I...
d868b94e0f88c22f990e65b1ad469d7dbb30b7dca3048ad47ccc535f99e38e89
from datetime import datetime from functools import partialmethod from io import StringIO from unittest import mock, skipIf from django.core import serializers from django.core.serializers import SerializerDoesNotExist from django.core.serializers.base import ProgressBar from django.db import connection, transaction f...
288f4c03f98094dd83ecf490f47ad1bf21b318c04d7818225f4c3f126a844e73
import datetime import pickle import sys import unittest from operator import attrgetter from django.core.exceptions import EmptyResultSet, FieldError from django.db import DEFAULT_DB_ALIAS, connection from django.db.models import Count, F, Q from django.db.models.sql.constants import LOUTER from django.db.models.sql....
ab0d0124757bf77fac28f904462201d52f244c1c047a8100a7ade049ea5718c9
""" Various complex queries that have been problematic in the past. """ import threading from django.db import models class DumbCategory(models.Model): pass class ProxyCategory(DumbCategory): class Meta: proxy = True class NamedCategory(DumbCategory): name = models.CharField(max_length=10) ...
fb852cf2853c363acb54fd96c179c98770535783a3fe36f2356f4ff38ba41527
from django.db.models import Exists, F, IntegerField, OuterRef, Value from django.db.utils import DatabaseError, NotSupportedError from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models import Number, ReservedName @skipUnlessDBFeature('supports_select_union') class QuerySetSetOperationTe...
322e9716b71aa7b54cb975dfb002e84f8a9a26a793ea695b5e3bd97074e9b425
import os from unittest import mock, skipUnless from django.conf import settings from django.contrib.gis.geoip2 import HAS_GEOIP2 from django.contrib.gis.geos import GEOSGeometry from django.test import SimpleTestCase if HAS_GEOIP2: from django.contrib.gis.geoip2 import GeoIP2, GeoIP2Exception # Note: Requires ...
e6e67f133ab2e3368a1edf2aca15ff9da853c67efcc1a64b6b084736c36a8333
import json import uuid from django.core import exceptions, serializers from django.db import IntegrityError, models from django.test import ( SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature, ) from .models import ( NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild,...
fefaf5f53480de89739e95a8f258184ca4a18746193e99df8a754beb24c51759
import datetime import pickle import unittest import uuid from copy import deepcopy from django.core.exceptions import FieldError from django.db import DatabaseError, connection, models from django.db.models import CharField, Q, TimeField, UUIDField from django.db.models.aggregates import ( Avg, Count, Max, Min, S...
15833358a4ac2950592d68b781f7af9e6eb5cbb04f43c27aa0e6f79413dec053
import datetime import re import sys from contextlib import contextmanager from unittest import SkipTest, skipIf from xml.dom.minidom import parseString import pytz from django.contrib.auth.models import User from django.core import serializers from django.core.exceptions import ImproperlyConfigured from django.db im...
d75f8062492ebfa46dc96d35bb41ab412ec1a1b0e5afde52dd7e73e3f769cfd7
from django.db.models.query_utils import InvalidQuery from django.test import TestCase from .models import ( BigChild, Child, ChildProxy, Primary, RefreshPrimaryProxy, Secondary, ) class AssertionMixin: def assert_delayed(self, obj, num): """ Instances with deferred fields look the same as no...
e24ab0d4835974ece19f6d470c8e3b7fc7766f4ad667fcaa5e82dc93797df709
import datetime from django.contrib import admin from django.contrib.admin.models import LogEntry from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.templatetags.admin_list import pagination from django.contrib.admin.tests import AdminSeleniumTestCase from django.contrib.admin...
c2f3da7b03a643cc32aaea58659ca8864931973d7b79a72d506ea7f9e2f9c95a
import importlib import inspect import os import re import sys import tempfile import threading from io import StringIO from pathlib import Path from unittest import mock from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection from djan...
8815198d0812a581680dc4de1ad18ad3a6c9845760956d404d751130529be65a
#!/usr/bin/env python import argparse import atexit import copy import os import shutil import socket import subprocess import sys import tempfile import warnings try: import django except ImportError as e: raise RuntimeError( 'Django module not found, reference tests/README.rst for instructions.' ...
d3cc2716342a6a0f5b6c4c3adfadec79a200abdfdfe96a3558e4c03aca4e5c4b
import functools import itertools import logging import os import signal import subprocess import sys import threading import time import traceback import weakref from collections import defaultdict from pathlib import Path from types import ModuleType from zipimport import zipimporter from django.apps import apps fro...
1fbba957d956750a49bd26b7d5afde6e5380b1d3392e404de37a9c09c88a1262
import codecs import datetime import locale import warnings from decimal import Decimal from urllib.parse import quote from django.utils.deprecation import RemovedInDjango40Warning from django.utils.functional import Promise class DjangoUnicodeDecodeError(UnicodeDecodeError): def __init__(self, obj, *args): ...
9bd955d234aaf5ead689d6a8eae36b4d28b58138b0c9a2f1c13f83e795bba64f
import base64 import calendar import datetime import re import unicodedata import warnings from binascii import Error as BinasciiError from email.utils import formatdate from urllib.parse import ( ParseResult, SplitResult, _coerce_args, _splitnetloc, _splitparams, quote, quote_plus, scheme_chars, unquote, unquo...
b345726ca72fafe59819335f7b1799b215a5c1336ba8688b29292c0b09ac4e84
""" This module converts requested URLs to callback view functions. URLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a ResolverMatch object which provides access to all attributes of the resolved URL match. """ import functools import inspect import re from importlib impor...
ce6bc78bffa2244b9f14255a893bd7120e82423f08a5fe757d6c346bf8a2454b
import collections.abc import inspect import warnings from math import ceil from django.utils.deprecation import RemovedInDjango31Warning from django.utils.functional import cached_property from django.utils.inspect import method_has_no_args from django.utils.translation import gettext_lazy as _ class UnorderedObjec...
b9318ac6676a056bc0beda9f62bd1d80c353795587d48c98f66efc7477de8954
from django.db.backends.utils import names_digest, split_identifier from django.db.models.query_utils import Q from django.db.models.sql import Query __all__ = ['Index'] class Index: suffix = 'idx' # The max length of the name of the index (restricted to 30 for # cross-database compatibility with Oracle)...
a5fc6304ab00f9aba589a239915ce2e594dfae35e7fb844ef9a95938d028a838
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import operator import warnings from collections import namedtuple from functools import lru_cache from itertools import chain from django.conf import settings from django.core import exceptions from django.db import ( ...
45dda614ab0987d20772e5020b66f8471216356e9e3314f2ce9cbaa1ab3774e3
import copy import inspect from bisect import bisect from collections import defaultdict from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured from django.db import connections from django.db.models import Manager from django.db.models....
c11daea4941278a525ce79c78ca9233146c4786483e7fba1eaf9bcb6b7b6280f
import copy import inspect import warnings from functools import partialmethod from itertools import chain from django.apps import apps from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned, ...
ad9dd49fcbc196264094f2a7e61417c9b5923ac196d0f1cf66dee2a4ea748fb5
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ import copy import functools import inspect from collections import namedtu...
2401f6bf4780a96308a064efcb1657efc7e8940183064eb6c5371fbd58022c06
import copy import datetime import inspect from decimal import Decimal from django.core.exceptions import EmptyResultSet, FieldError from django.db import connection from django.db.models import fields from django.db.models.query_utils import Q from django.db.utils import NotSupportedError from django.utils.deconstruc...