hash
stringlengths
64
64
content
stringlengths
0
1.51M
63c5c636c6bd69b4641be1ac5f95f97019bd1b83fb558ef3829301a07a4731ca
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures from django.db.backends.mysql.features import ( DatabaseFeatures as MySQLDatabaseFeatures, ) from django.utils.functional import cached_property class DatabaseFeatures(BaseSpatialFeatures, MySQLDatabaseFeatures): has_spatialrefsys_ta...
5b2193557fafd951536f75a5e1bebd552eb0d1450b99e237f74c5af25510698a
from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.views import ( PasswordChangeDoneView, PasswordChangeView, PasswordResetCompleteView, PasswordResetDoneView, PasswordResetView, ) f...
e73f1ee27acb3d8abc4ea29fd9c70f58f7db190454a50b5b9898f1bc691e7207
import datetime import os import re import unittest from unittest import mock from urllib.parse import parse_qsl, urljoin, urlparse import pytz from django.contrib.admin import AdminSite, ModelAdmin from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.models import ADDITION, DELETIO...
ddf19a858ffb1e6702ddd55ef930333f92baaadd301a973a8878708a4071911e
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models class Square(models.Model): root = models.IntegerField() square = models.PositiveIntegerField() def __str__(self): ret...
47040ed12200cf1716c296cba4f1557ed59d184b8986951370dbb366e5bfcc7c
import pathlib from django.core.checks import Warning from django.core.checks.caches import ( E001, check_cache_location_not_exposed, check_default_cache_is_configured, check_file_based_cache_is_absolute, ) from django.test import SimpleTestCase from django.test.utils import override_settings class CheckCach...
c1dc27caac1642f656d0bb9b984c375aae9bca03014fcb5768466ab07948c4f5
from django.conf import settings from django.core.checks.security import base, csrf, sessions from django.core.management.utils import get_random_secret_key from django.test import SimpleTestCase from django.test.utils import override_settings class CheckSessionCookieSecureTest(SimpleTestCase): @override_settings...
3eca693292654549fb129c90ff893694da11fb0acfae3e5a89a26f2b83a53aac
""" 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...
c9c54e271a766e39bc198b84184d686b8c57eccdeaa5819beb26d29658873b03
import sys import unittest from unittest import mock from django import __version__ from django.core.management import CommandError, call_command from django.test import SimpleTestCase from django.test.utils import captured_stdin, captured_stdout class ShellCommandTestCase(SimpleTestCase): script_globals = 'prin...
bc4a8bc34fb2201b149bf2f4e3b3ac8d445a4a1ae90764b786b3770be531be5a
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...
a95163da6b20eb047eed63c80b09546be3694c6b96617d1e0720c7e64cb24a00
import copy import datetime from unittest import mock from django.db import DEFAULT_DB_ALIAS, connection, connections from django.db.backends.base.creation import ( TEST_DATABASE_PREFIX, BaseDatabaseCreation, ) from django.test import SimpleTestCase, TransactionTestCase from django.test.utils import override_setti...
f8093de2e8d1072039b76cc540086536bc340133b88662595d5381db8b606179
import json import math import re from decimal import Decimal from django.contrib.gis.db.models import GeometryField, PolygonField, functions from django.contrib.gis.geos import ( GEOSGeometry, LineString, Point, Polygon, fromstr, ) from django.contrib.gis.measure import Area from django.db import NotSupportedErro...
264cf16f498c37dacbd1bcf450a3919752d82205e76a56a3206147b04d1f9c32
import ctypes import faulthandler import io import itertools import logging import multiprocessing import os import pickle import sys 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...
97377fc10997bdb3230871f0dad8188f82301bd8fbecb49df2b4c0d09b2761a5
import asyncio import difflib import json import posixpath import sys import threading import unittest import warnings from collections import Counter from contextlib import contextmanager from copy import copy, deepcopy from difflib import get_close_matches from functools import wraps from unittest.suite import _Debug...
36a1b2bda60513950029d07b688263d6dc6c69adc7f3efaceb63eeb54626c46e
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 import django from django.apps i...
142c229697150da7a45f551b7b2b692ccf66be225abefbde0e4fcc5b17392349
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ import calendar import datetime import time from email.utils import format_datetime as ...
2a1ae3de0e0ddbfbead568ee92e57ae2bec2f95587cf1203e0037c2806739116
from contextlib import ContextDecorator, contextmanager from django.db import ( DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError, connections, ) class TransactionManagementError(ProgrammingError): """Transaction management is used improperly.""" pass def get_connection(using=None): """ ...
2f3c17394241bba4c3d99ea1b6938fcfc1bb7a10caa216de06b371fc4684d83a
import pkgutil from importlib import import_module from pathlib import Path from asgiref.local import Local from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.functional import cached_property from django.utils.module_loading import import_string DEFAULT_DB_ALI...
51cce22f4563d2351097efef0e2dee25404294923895cb260dc66172fd4f94b2
from django.template import Template, TemplateDoesNotExist class Loader: def __init__(self, engine): self.engine = engine def get_template(self, template_name, skip=None): """ Call self.get_template_sources() and return a Template object for the first template matching templa...
0d44e36d2274ac2d1c6e367f23256be8a9ebb0cd1f5a52b4d06c2cc04005cc7f
import copy import datetime import functools import inspect from decimal import Decimal from uuid import UUID from django.core.exceptions import EmptyResultSet, FieldError from django.db import NotSupportedError, connection from django.db.models import fields from django.db.models.constants import LOOKUP_SEP from djan...
fbc0bebe96b93337643988946364533b42b64c4cf0d973251031d1c77a2bd345
import json from django import forms from django.core import checks, exceptions from django.db import NotSupportedError, connections, router from django.db.models import lookups from django.db.models.lookups import PostgresOperatorLookup, Transform from django.utils.translation import gettext_lazy as _ from . import ...
6140b8f0a94de9f0b841bb2491ced2fb6cb264215b0a929e6cf795fe2c83850a
"""Database functions that do comparisons or type conversions.""" from django.db import NotSupportedError from django.db.models.expressions import Func, Value from django.db.models.fields.json import JSONField from django.utils.regex_helper import _lazy_re_compile class Cast(Func): """Coerce an expression to a ne...
7ef7b98041786cbff89ffcb0cebad9df7a8645383fc21af3ccb43944bc7fe7ca
from .comparison import ( Cast, Coalesce, Collate, Greatest, JSONObject, Least, NullIf, ) from .datetime import ( Extract, ExtractDay, ExtractHour, ExtractIsoWeekDay, ExtractIsoYear, ExtractMinute, ExtractMonth, ExtractQuarter, ExtractSecond, ExtractWeek, ExtractWeekDay, ExtractYear, Now, Trunc, TruncDa...
d3918e9df59778008637a2c3811f670056320547ad45e58972e1e58ea2ed68c2
""" 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 ...
b1947fe8646f73756e6250b51b87ac16173d78d0c918d42f78c71f9b9e4524d7
import collections import re from functools import partial from itertools import chain from django.core.exceptions import EmptyResultSet, FieldError from django.db import DatabaseError, NotSupportedError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import F, OrderBy, RawSQL, Ref,...
e3e2407ff6390db33f9898733bb05d28b4e9cd28abc649416e1e2cb2021ae056
from django.db import DatabaseError, InterfaceError from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property class DatabaseFeatures(BaseDatabaseFeatures): # Oracle crashes with "ORA-00932: inconsistent datatypes: expected - got # BLOB" when grouping...
ae127c4b5aaade6b87dbc1a553ec45af1fb25db5eb53f18e780aa3a60b3e2020
""" 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 Integ...
348e6b6795d93b39969d325ca1518c1d1eb814577b28aa3fea05cff79e3f9902
from django.db import ProgrammingError from django.utils.functional import cached_property class BaseDatabaseFeatures: gis_enabled = False # Oracle can't group by LOB (large object) data types. allows_group_by_lob = True allows_group_by_pk = False allows_group_by_selected_pks = False empty_fet...
18cbed15b8df6c44d1b3efccf764d61ba14db3ac89b94abf0408e308947005ae
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.org/project/mysqlclient/ """ from django.core.exceptions import ImproperlyConfigured from django.db import IntegrityError from django.db.backends import utils as backend_utils from django.db.backends.base.base import BaseDatabaseWrapper from dja...
7c4f4110a69feda24e0b965429e36c00411bba2e3c731b7c195b01194805d5d6
""" PostgreSQL database backend for Django. Requires psycopg 2: https://www.psycopg.org/ """ import asyncio import threading import warnings from contextlib import contextmanager from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import DatabaseError as WrappedDat...
e1feddcd210201e0e8666a2ad0d0e608b43e446694eaa1c59b7a213acd4cfe8b
import operator import platform from django.db import transaction from django.db.backends.base.features import BaseDatabaseFeatures from django.db.utils import OperationalError from django.utils.functional import cached_property from .base import Database class DatabaseFeatures(BaseDatabaseFeatures): # SQLite c...
b4f3150f4ef7475ea0d1a031cde5f298afdcd2b0764baa18ef00dbf102447aa4
""" SQLite backend for the sqlite3 module in the standard library. """ import datetime import decimal import functools import hashlib import math import operator import random import re import statistics import warnings from itertools import chain from sqlite3 import dbapi2 as Database import pytz from django.core.ex...
84ff0e7d3e5099d60fbf45f4ebd1aa82e386239a01009249dc118afd6c57595a
import glob import os import re import sys from functools import total_ordering from itertools import dropwhile import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.temp import NamedTemporaryFile from django.core.management.base import BaseComman...
7be5ad6c5ef4961499b8c96af5664bec0c7777dea63dbc87a5e6991ba8e4a2d2
import copy import json import operator import re from functools import partial, reduce, update_wrapper from urllib.parse import quote as urlquote from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers, widgets from django.contrib.admin.ch...
5232bee4656eac513b4d815dc74127ee4d676c1fa3fb4d97ece7fa3069cd3f2a
import re from functools import update_wrapper from weakref import WeakSet from django.apps import apps from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured from django.db.models.base import ModelBase from djang...
0c4e016e1edfd53f46032e4896cb03fafda3737b2f0eb13a2670ddb02d05537e
import json from django.conf import settings from django.contrib.messages.storage.base import BaseStorage, Message from django.core import signing from django.http import SimpleCookie from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.safestring import SafeData, mark_safe class Mess...
83de4aa3305ef3ddeee5b6571aaca3c319f3a87b87d56a134c8a051a9c70cfa4
import json from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import ( MessageDecoder, MessageEncoder, ) class SessionStorage(BaseStorage): """ Store messages in the session (that is, django.contrib.sessions). """ session_key = '_messages' ...
d3ee625cabd6b34d4c8df55ebe5690251d65321b43a60b95b9e6e12ed6fe8f29
import json from django.contrib.postgres import lookups from django.contrib.postgres.forms import SimpleArrayField from django.contrib.postgres.validators import ArrayMaxLengthValidator from django.core import checks, exceptions from django.db.models import Field, Func, IntegerField, Transform, Value from django.db.mo...
c07945274862126226156def39ef3ada0ecb2740b3c9ad7a72c69aabb927c3d0
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
2ac87c3446a804ed6fb2b6c9bacbf10020ae11bf709eb58d21299a9777e46c2a
import logging from django.conf import settings from django.contrib.gis import gdal from django.contrib.gis.geometry import json_regex from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Widget from django.utils import translation logger = logging.getLogger('django.contrib...
1c3195561ffa4be9903882a2546b668cbf1d8d2a70020de8653a9423258868bd
""" DataSource is a wrapper for the OGR Data Source object, which provides an interface for reading vector geometry data from many different file formats (including ESRI shapefiles). When instantiating a DataSource object, use the filename of a GDAL-supported data source. For example, a SHP file or a TIGER/Line...
c7a21e0b6730dc3741ff869bad340d43251f5a25b8d3713b47c18b31ef0d31ab
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures from django.db.backends.oracle.features import ( DatabaseFeatures as OracleDatabaseFeatures, ) class DatabaseFeatures(BaseSpatialFeatures, OracleDatabaseFeatures): supports_add_srs_entry = False supports_geometry_field_introspect...
10d7462d6f27541fb763f49d6726d959f31f569bb10830086f18a98fcf5d3cd8
import re from django.contrib.gis.db import models class BaseSpatialFeatures: gis_enabled = True # Does the database contain a SpatialRefSys model to store SRID information? has_spatialrefsys_table = True # Does the backend support the django.contrib.gis.utils.add_srs_entry() utility? supports_...
926d1ba37b0d2d46fd1ef3f76b3072d6b3760d527c4d78982506885609ca9d8f
from datetime import date from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.views import ( PasswordChangeDoneView, PasswordChangeView, PasswordResetCompleteView, PasswordResetDoneV...
30cce48f40755e62665c65edd20af38f3bcbafcaff187a2f4b263e1fb956e4d8
import datetime import re from decimal import Decimal from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( Avg, Case, Count, DecimalField, DurationField, Exists, F, FloatField, IntegerField, Max, Min, OuterRef, Subquery, Sum, Value, When, ) from django.d...
b550b231f74a266c06cb83a54d1d2c0c23453ddb160bea5d32b2e50165650790
import decimal import enum import json import unittest import uuid from django import forms from django.core import checks, exceptions, serializers, validators from django.core.exceptions import FieldError from django.core.management import call_command from django.db import IntegrityError, connection, models from dja...
bb15216a36787667ab2c09badaf4aa5d58630134fc11f549ed71bfd5147c32ce
from django.db import models from .fields import ( ArrayField, BigIntegerRangeField, CICharField, CIEmailField, CITextField, DateRangeField, DateTimeRangeField, DecimalRangeField, EnumField, HStoreField, IntegerRangeField, SearchVectorField, ) class Tag: def __init__(self, tag_id): self.tag_i...
41b3357abc093f435f2234e621b5bb85b80992aa6be4cf2a60bd2e253ba5c6a9
import json from django.core import checks, exceptions, serializers from django.db import connection from django.db.models import F, OuterRef, Subquery from django.db.models.expressions import RawSQL from django.forms import Form from django.test.utils import CaptureQueriesContext, isolate_apps from . import PostgreS...
e3b91cf7c6ee35cdf8e45dd20c50b6a13ebcfc051348e18708eb3ac3e2d392e9
import datetime from decimal import Decimal from django.core.exceptions import FieldDoesNotExist, FieldError from django.db import connection from django.db.models import ( BooleanField, Case, CharField, Count, DateTimeField, DecimalField, Exists, ExpressionWrapper, F, FloatField, Func, IntegerField, Max, ...
5a9d3c12d54562a07702897ad2bc024e782f4178dca19aa7cdde80addebf95e0
import json from django.conf import settings from django.contrib.messages import constants from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.cookie import ( CookieStorage, MessageDecoder, MessageEncoder, ) from django.test import SimpleTestCase, override_settings from dj...
b041c86956956e246ffb87d5c6e1125b66818b839b9364eb54640f8e5e5ae473
import unittest from django.core.exceptions import FieldError from django.db import IntegrityError, connection, transaction from django.db.models import CharField, Count, F, IntegerField, Max from django.db.models.functions import Abs, Concat, Lower from django.test import TestCase from django.test.utils import regist...
47048bb87a82ea72c19677d706765033e05455c46c2006b978625989857ac31a
import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature, ) from .models import Re...
837f390e02742bbab72cc3cb37f1225bea27073e678d28694e41fa2559809aea
from datetime import date, datetime from django.test import SimpleTestCase, override_settings from django.test.utils import TZ_SUPPORT, requires_tz_support from django.utils import dateformat, translation from django.utils.dateformat import format from django.utils.timezone import ( get_default_timezone, get_fixed...
6dfb819e68a0e5e30662f5a4d0bda12b1be415c2e49ce675c8c380f61bbc4fe9
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 subprocess import CompletedProcess from unittest import mock, skip, skipIf import pytz import...
11fc75acca2ec716767f26aed0bf4402b8764c626e5c54a6c543b632a3eb8b8d
from django.contrib import admin from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.test import TestCase from .models import Band class AdminActionsTests(TestCase): @classmethod def setUpTestData(cls): cls.superuser = User.o...
50a8d4281ae57329d8c55aca1002cfc93f9cb9c7881e6515dc9c448588c1e8fa
import unittest from io import StringIO from django.db import connection from django.test import TestCase from django.test.runner import DiscoverRunner from .models import Person @unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so we can check output SQL.') class TestDebugSQL(unittest.TestCas...
beafe6467ec89aa620ef40e8a03eef819f855f0eb0331ccdf49333bc7f51b156
import operator from django.db import DatabaseError, NotSupportedError, connection from django.db.models import Exists, F, IntegerField, OuterRef, Value from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from django.test.utils import CaptureQueriesContext from .models import Number, ReservedName ...
d4e929e0eb5729fca82a1f9c7f52aee67bd6d78ed456bc728eceda15c0e7c320
# Fake views for testing url reverse lookup from django.http import HttpResponse from django.template.response import TemplateResponse def index(request): pass def client(request, id): pass def client_action(request, id, action): pass def client2(request, tag): pass def template_response_view(...
ef0789c042c4efb11f3f374520395db79668ce935cfa2cc54749df418524e793
import os from django.template import Context, Engine, TemplateDoesNotExist from django.test import SimpleTestCase from .utils import ROOT RECURSIVE = os.path.join(ROOT, 'recursive_templates') class ExtendsBehaviorTests(SimpleTestCase): def test_normal_extend(self): engine = Engine(dirs=[os.path.join(...
15650556c12ead641a7a37656d7b86a1e17a2b9e0eb267ef9bdc903d48c332d7
import datetime from copy import deepcopy from django.core.exceptions import FieldError, MultipleObjectsReturned from django.db import IntegrityError, models, transaction from django.test import TestCase from django.utils.translation import gettext_lazy from .models import ( Article, Category, Child, ChildNullabl...
e6adcce9ebce5f8e103b580704d1df21a538902f19f6ea27c4c0845c58013f8e
"""Tests for django.db.utils.""" import unittest from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS, ProgrammingError, connection from django.db.utils import ConnectionHandler, load_backend from django.test import SimpleTestCase, TestCase class ConnectionHandlerTests(Simpl...
795793da11cca5c2b583fc8fd81f28b126668acd61fcaf2a3e06ce1384c8b936
import datetime import itertools import unittest from copy import copy from unittest import mock from django.core.management.color import no_style from django.db import ( DatabaseError, DataError, IntegrityError, OperationalError, connection, ) from django.db.models import ( CASCADE, PROTECT, AutoField, BigAut...
3dc8295440f09b5439f967e63efce91effde3c1a29d8fdb1a20d781bc887e40b
import datetime from decimal import Decimal from unittest import mock, skipIf from django.core.exceptions import FieldError from django.db import NotSupportedError, connection from django.db.models import ( Avg, BooleanField, Case, F, Func, IntegerField, Max, Min, OuterRef, Q, RowRange, Subquery, Sum, Value, V...
766a39277a3d9e448136dfa9d34baf0a29394d8ff492753fd01ad91e20b594e7
import re from django.contrib.gis import forms from django.contrib.gis.forms import BaseGeometryWidget, OpenLayersWidget from django.contrib.gis.geos import GEOSGeometry from django.core.exceptions import ValidationError from django.test import SimpleTestCase, override_settings from django.utils.html import escape c...
beceead2c50e0aaf25e03af2565333a249a954fa0ec10181ebbe1e3d2cddcec5
import operator import uuid from unittest import mock, skipIf from django import forms from django.core import serializers from django.core.exceptions import ValidationError from django.core.serializers.json import DjangoJSONEncoder from django.db import ( DataError, IntegrityError, NotSupportedError, OperationalE...
c6bafda279fb25249cf6400eeb0d43017df5b05e70a965d1aa055ce2db7b48f7
import json import os import tempfile import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from django.core.serializers.json import DjangoJSONEncoder from...
8b2d8d26c7659d600051ba319d739dc55995893b182ad3cd50d9c11288ee601f
import datetime import pickle import unittest import uuid from collections import namedtuple from copy import deepcopy from decimal import Decimal from unittest import mock from django.core.exceptions import FieldError from django.db import DatabaseError, NotSupportedError, connection from django.db.models import ( ...
d342c472f88aae9e04682172a413dd9dd354433ee17d44249e121d997da44b88
import os import re import shutil import tempfile import time import warnings from io import StringIO from pathlib import Path from unittest import mock, skipIf, skipUnless from admin_scripts.tests import AdminScriptTestCase from django.core import management from django.core.management import execute_from_command_li...
5965c3576e2ce13682d48d5ca3be663c65b5034cc4729e01554c941c34f7d271
from django.db import migrations, models from ..fields import ( ArrayField, BigIntegerRangeField, CICharField, CIEmailField, CITextField, DateRangeField, DateTimeRangeField, DecimalRangeField, EnumField, HStoreField, IntegerRangeField, SearchVectorField, ) from ..models import TagField class Migration(mi...
0f4f91b8c80632bc95093f3a673baa871417ea5555e3dd60572d27ff58fd57ab
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...
68db79bfa5b0cf8c95cac5470231589ddcc3a71834c8a57eaa1e8d14b7387309
from unittest import mock, skipUnless from django.db import OperationalError, connection from django.test import TestCase @skipUnless(connection.vendor == 'sqlite', 'SQLite tests.') class FeaturesTests(TestCase): def test_supports_json_field_operational_error(self): if hasattr(connection.features, 'suppo...
5c08fa6daf97f8a7654a81c97847d2d089549f5c838cdae4c056b026824ab831
import unittest from django.contrib.gis.db.models.functions import ( Area, Distance, Length, Perimeter, Transform, Union, ) from django.contrib.gis.geos import GEOSGeometry, LineString, Point from django.contrib.gis.measure import D # alias for Distance from django.db import NotSupportedError, connection from dja...
3427461f18341e954322bfc95a3607d74bded18cf5efef53fc2c8fbdcdf59d26
import datetime import unittest from copy import copy from decimal import Decimal from pathlib import Path from django.conf import settings from django.contrib.gis.gdal import DataSource from django.contrib.gis.utils.layermapping import ( InvalidDecimal, InvalidString, LayerMapError, LayerMapping, MissingForei...
69475f0d52debf68fd6f4bbd99573040d54e3d9b9eca3d694f0c4f8c517b1396
import tempfile import unittest from io import StringIO from django.contrib.gis import gdal from django.contrib.gis.db.models import Extent, MakeLine, Union, functions from django.contrib.gis.geos import ( GeometryCollection, GEOSGeometry, LinearRing, LineString, MultiLineString, MultiPoint, MultiPolygon, Poin...
321cba9ae810dc641c270bd1e0ef364d2d51ca268ebb0a9b6a49225282844622
import os import re from datetime import datetime from pathlib import Path from django.contrib.gis.gdal import ( DataSource, Envelope, GDALException, OGRGeometry, ) from django.contrib.gis.gdal.field import ( OFTDateTime, OFTInteger, OFTReal, OFTString, ) from django.test import SimpleTestCase from ..test_dat...
62105fac560e4cadde0f8e6075d28f61eca76081003cc447823211b977f90c59
from django.db import NotSupportedError from django.db.models import F, Value from django.db.models.functions import JSONObject, Lower from django.test import TestCase from django.test.testcases import skipIfDBFeature, skipUnlessDBFeature from django.utils import timezone from ..models import Article, Author @skipUn...
9452d52540e197ac3972975dd2920f17d896797e557ba249b760fd9a881e517a
#!/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.' ...
daa105024f8b2549b0c8069f0047dc23c902564b7fdde5d6cfb96067527a2b95
# This is an example test settings file for use with the Django test suite. # # The 'sqlite3' backend requires only the ENGINE setting (an in- # memory database will be used). All other backends will require a # NAME and potentially authentication information. See the # following section in the docs for more informatio...
57f694b4772f52b2173e02875d64a13d3145306ae68152c90d4531e9f5a996a3
import logging import threading import warnings import weakref from django.utils.deprecation import RemovedInDjango40Warning from django.utils.inspect import func_accepts_kwargs logger = logging.getLogger('django.dispatch') def _make_id(target): if hasattr(target, '__func__'): return (id(target.__self__...
31049a46447661659021a647a3562ad59534224fed4ae9dea8f7f967448997fc
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 ...
120fd391aef903cc54562d8faaf7564d3faba783579646af0e5f3207f092e955
import inspect import os import warnings from importlib import import_module from django.core.exceptions import ImproperlyConfigured from django.utils.deprecation import RemovedInDjango41Warning from django.utils.functional import cached_property from django.utils.module_loading import import_string, module_has_submod...
987d0072f572db05fd0aa6b366147a628539d2a27ab581e70019e04766b209b2
""" Default Django settings. Override these with settings in the module pointed to by the DJANGO_SETTINGS_MODULE environment variable. """ # This is defined here as a do-nothing function because we can't import # django.utils.translation -- that module depends on the settings. def gettext_noop(s): return s ####...
1c7c254fbc996996d3ac7dcab26bd81812a173b22be677021f7c7cf5aee2e95d
import functools import inspect @functools.lru_cache(maxsize=512) def _get_signature(func): return inspect.signature(func) def get_func_args(func): sig = _get_signature(func) return [ arg_name for arg_name, param in sig.parameters.items() if param.kind == inspect.Parameter.POSITIONAL_OR_...
1e5c5634c043336e9a9d29031e93a46e4897d6a5a29ab35d8b6dd2ca901be136
from asgiref.local import Local from django.conf import settings as django_settings from django.utils.functional import cached_property class ConnectionProxy: """Proxy for accessing a connection object's attributes.""" def __init__(self, connections, alias): self.__dict__['_connections'] = connectio...
c3986a643de2502adeb03bbd9b8fc9e890b836ff492041ad6edc36024f79aade
from django.core import signals from django.db.utils import ( DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, ConnectionHandler, ConnectionRouter, DatabaseError, DataError, Error, IntegrityError, InterfaceError, InternalError, NotSupportedError, OperationalError, ProgrammingError, ) from django.utils.conne...
66c4cfaf85b4aaadbd098f6ec35803bc2b8ffb3d1a72181a2225a5c1359f689a
import pkgutil from importlib import import_module from pathlib import Path from django.conf import settings from django.core.exceptions import ImproperlyConfigured # For backwards compatibility with Django < 3.2 from django.utils.connection import ConnectionDoesNotExist # NOQA: F401 from django.utils.connection impo...
76f85c699424561b2356be6867bd5f29ad6c501b26f65b0cc52699e839a9b1ee
import datetime import json import mimetypes import os import re import sys import time from collections.abc import Mapping from email.header import Header from http.client import responses from urllib.parse import quote, urlparse from django.conf import settings from django.core import signals, signing from django.co...
9e29e97dd2e3e903236c85ba28f5985dd3bd027906da6f6c776fc6099b442365
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import operator import warnings from itertools import chain import django from django.conf import settings from django.core import exceptions from django.db import ( DJANGO_VERSION_PICKLE_KEY, IntegrityError, NotSuppor...
23bb5a8b6d2ea15eecb10fe3255c16c111a30ca84042ac9cee45301c7c14c9f0
import bisect import copy import inspect 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 AutoField, Manager, OrderWrt, UniqueConstr...
4b86bf79be1797c777be2ee2d0d4b82bd1de0fc06d53aaf457010061447d84e3
import copy import inspect import warnings from functools import partialmethod from itertools import chain import django 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, MultipleObjects...
608b7d07b4462c3b27fc56b4da5885c4a39a8b6a765c5fce3bbd28f9de5ee254
import json from django import forms from django.core import checks, exceptions from django.db import NotSupportedError, connections, router from django.db.models import lookups from django.db.models.lookups import PostgresOperatorLookup, Transform from django.utils.translation import gettext_lazy as _ from . import ...
715212aea87a72ba8c45e1ac47f7f19b521b7b6050690da3bf5cc3c5aafbcf2c
from django.db import DatabaseError, InterfaceError from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property class DatabaseFeatures(BaseDatabaseFeatures): # Oracle crashes with "ORA-00932: inconsistent datatypes: expected - got # BLOB" when grouping...
7e7c00f5f14cf220c6c06c880824497fdd655b99fc5bab8bd640e90f504a23ef
from django.db import ProgrammingError from django.utils.functional import cached_property class BaseDatabaseFeatures: gis_enabled = False # Oracle can't group by LOB (large object) data types. allows_group_by_lob = True allows_group_by_pk = False allows_group_by_selected_pks = False empty_fet...
f29cc0168381644455e7b374b3dff834a2d466a12ac107ce2657c588a9a5601d
import os import sys from io import StringIO from unittest import expectedFailure, skip from django.apps import apps from django.conf import settings from django.core import serializers from django.db import router from django.db.transaction import atomic from django.utils.module_loading import import_string # The pr...
53160389ea674409976a09c77a6bc8a538d3f34c704e99c5fe7fa8b2e1187e6c
import operator from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property class DatabaseFeatures(BaseDatabaseFeatures): empty_fetchmany_value = () allows_group_by_pk = True related_fields_match_type = True # MySQL doesn't support sliced subq...
3aa43e708851c51a534985cfd5ed1c4878c26ced471f00b3f77dca55e6426eca
import operator from django.db import InterfaceError from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property class DatabaseFeatures(BaseDatabaseFeatures): allows_group_by_selected_pks = True can_return_columns_from_insert = True can_return_row...
ffea1db3d6f8ec36305ee7b27b83e9462a81c2f3dc678a14413386f60c4de5c2
import operator import platform from django.db import transaction from django.db.backends.base.features import BaseDatabaseFeatures from django.db.utils import OperationalError from django.utils.functional import cached_property from .base import Database class DatabaseFeatures(BaseDatabaseFeatures): # SQLite c...
6a645155721a3204afcbbebb3741faff3f1e0be357df8962fef4978f0287dd4b
""" HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21). Based on wsgiref.simple_server which is part of the standard library since 2.5. This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE! """ import l...
aedf6fdb82683eb09dd41575aec01600937b15418e321215d7e4211042aefc59
from itertools import chain from django.utils.inspect import func_accepts_kwargs from django.utils.itercompat import is_iterable class Tags: """ Built-in tags for internal checks. """ admin = 'admin' async_support = 'async_support' caches = 'caches' compatibility = 'compatibility' dat...
1d7b4693326d89bf12f8985872784af966bcf283b3e27de41086acb43672fde5
""" Caching framework. This package defines set of cache backends that all conform to a simple API. In a nutshell, a cache is a set of values -- which can be any object that may be pickled -- identified by string keys. For the complete API, see the abstract BaseCache class in django.core.cache.backends.base. Client ...
ecdb065a17b1d2628abd3d8eb95389360f7b7bd63f2bffe998fd6bbbde3f6dfa
"Memcached cache backend" import pickle import re import time import warnings from django.core.cache.backends.base import ( DEFAULT_TIMEOUT, BaseCache, InvalidCacheKey, memcache_key_warnings, ) from django.utils.deprecation import RemovedInDjango41Warning from django.utils.functional import cached_property clas...