hash
stringlengths
64
64
content
stringlengths
0
1.51M
71038d705f331369d80042907d56f6f408e2f4bfbb1c43ee51e0d75071b12d22
from django import forms from django.contrib import admin from django.db import models from .models import ( Author, BinaryTree, CapoFamiglia, Chapter, ChildModel1, ChildModel2, Consigliere, EditablePKBook, ExtraTerrestrial, Fashionista, Holder, Holder2, Holder3, Holder4, Inner, Inner2, Inner3, Inner4Stack...
de15c840c029a3d01ab57cd4b27145fd6130cea50c28e49a3db60ced2b9418ae
from django.core import checks from django.core.checks import Error from django.db import models from django.test import SimpleTestCase from django.test.utils import ( isolate_apps, modify_settings, override_system_checks, ) @isolate_apps('check_framework', attr_name='apps') @override_system_checks([checks.model_...
6c866cdfc9aa75432c78732ed65f14600a69f520410266838fe0c15cd520ae3d
from django.core.checks.translation import E001, check_setting_language_code from django.test import SimpleTestCase, override_settings class TranslationCheckTests(SimpleTestCase): def test_valid_language_code(self): tags = ( 'en', # language 'mas', # langu...
5fbf7bebe0504eb72de36b26b19ad7c8d87588b488d2449295795b594524c694
from django.conf import settings from django.core.checks.messages import Error, Warning from django.core.checks.urls import ( E006, check_url_config, check_url_namespaces_unique, check_url_settings, get_warning_for_invalid_pattern, ) from django.test import SimpleTestCase from django.test.utils import override_...
f12bd07eb6071eb2b53ce99821b173bb8570f88bae5fb0055111983b44f0669c
import datetime from decimal import Decimal from django.contrib.humanize.templatetags import humanize from django.template import Context, Template, defaultfilters from django.test import SimpleTestCase, modify_settings, override_settings from django.utils import translation from django.utils.html import escape from d...
b40018a859e34ae627c398547a18e2866651991efb87c1ef009dea64d23c206b
import datetime from collections import OrderedDict from django.contrib.auth.models import User from django.test import TestCase from .models import Order, RevisionableModel, TestObject class ExtraRegressTests(TestCase): @classmethod def setUpTestData(cls): cls.u = User.objects.create_user( ...
faf1f957e926c5fd624d48eaecc9de4653b21aa90ffbdb76b4205d408b83673c
""" 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 codecs import os import re import shutil import socket import subprocess import sys import tempfile import unitte...
f32e42e72232373639b83071939b33a785bdb0c5d1abc338d8bc0148db19f5b4
from operator import attrgetter from django.db import IntegrityError, NotSupportedError, connection from django.db.models import FileField, Value from django.db.models.functions import Lower from django.test import ( TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature, ) from .models import ( Co...
7ed022fcec93baa68c3ab2d878e5b6993d7c90d138bb2dbc19de03347f981af7
import datetime from unittest import skipIf, skipUnless from django.core.exceptions import FieldError from django.db import NotSupportedError, connection from django.db.models import ( F, OuterRef, RowRange, Subquery, Value, ValueRange, Window, WindowFrame, ) from django.db.models.aggregates import Avg, Max, Min, ...
32110e1b228653e808d46e31a2b03dca0540bb01975f10e516fc44dfbf0590cf
from datetime import datetime from operator import attrgetter from django.db.models import Count, DateTimeField, F, Max, OuterRef, Subquery from django.db.models.functions import Upper from django.test import TestCase from django.utils.deprecation import RemovedInDjango31Warning from .models import Article, Author, O...
98bbccd5c4bb58e82d7a164a9d1fc0e83f4abff80d95fbbf3343c6e30668b61f
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...
5ed8690b4be2b82636a53db2fd1b95bfaaba79cb005ba8406b118aa8ffaabe34
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 ...
589610338ea44433b2b4b46aacba2acf8ce3c21b9a879df54a43eb2ae99e6af6
import unittest from django.conf import settings from django.core.checks import Error, Warning from django.core.checks.model_checks import _check_lazy_references from django.core.exceptions import ImproperlyConfigured from django.db import connection, connections, models from django.db.models.signals import post_init ...
e07577235c3425181122f7646f393116bfaceae6117fbe7e4509ff5aa2fca802
import unittest from django.core.checks import Error, Warning as DjangoWarning from django.db import connection, models from django.test import SimpleTestCase, TestCase, skipIfDBFeature from django.test.utils import isolate_apps, override_settings from django.utils.functional import lazy from django.utils.timezone imp...
9c283824001f981de364b2704c1e0049b681c4d0800f88b601a5df5cdd780f8d
import asyncore import base64 import mimetypes import os import shutil import smtpd import socket import sys import tempfile import threading from email import charset, message_from_binary_file, message_from_bytes from email.header import Header from email.mime.text import MIMEText from email.utils import parseaddr fro...
0e83858f49a784e73b9a8abda8c3a05d77bba9b8f32a77740951aec314f6231b
import pickle from django import forms from django.db import models from django.test import SimpleTestCase, TestCase from django.utils.functional import lazy from .models import ( Bar, Foo, RenamedField, VerboseNameField, Whiz, WhizIter, WhizIterEmpty, ) class Nested: class Field(models.Field): pass...
4bda50d9371c42e2e12859eace53e6085e512c44d8422758f1f56950cce90aa2
from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import DataModel class BinaryFieldTests(TestCase): binary_data = b'\x00\x46\xFE' def test_set_and_retrieve(self): data_set = (self.binary_data, bytearray(self.binary_data), m...
9f3e1c50376984d9c9f7cf2a1fe43d0a63a16232fe4d7c5522fcd73c551beba2
from django import forms from django.contrib import admin from django.contrib.admin import AdminSite from django.contrib.contenttypes.admin import GenericStackedInline from django.core import checks from django.test import SimpleTestCase, override_settings from .models import ( Album, Author, Book, City, Influence...
603dc55deebdcecddb168bfa04eb96c6cb887f7c2ff9f35211937f6586e93709
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...
3de6962f923da28778da40f69c691f0e93c6a9730f5ce6c2ed80dfe15157a799
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...
910158eddae3f7dc3d0146be3192792b72e98c8302b092be3d74458d9b214cac
from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db.models import Prefetch, QuerySet from django.db.models.query import get_prefetcher, prefetch_related_objects from django.test import TestCase, override_setting...
fc49a2ea4a4c30187a34b9d647070a1e6923f2ec2caf2f70fd65b3cb76002952
import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models.query import ModelIterable, QuerySet from django.utils.functional import cached_property class Author(mo...
0c00e728cdbadd9ab24120ac18e449c4e723ae1eac46f6494356b47885b78fed
from unittest import mock, skipUnless from django.db import connection from django.db.models import Index from django.db.utils import DatabaseError from django.test import TransactionTestCase, skipUnlessDBFeature from .models import Article, ArticleReporter, City, District, Reporter class IntrospectionTests(Transac...
8490683191df0ba31939abcff25bd09590f3f28bc68dd0221187bbade3397032
from django.db import models class City(models.Model): id = models.BigAutoField(primary_key=True) name = models.CharField(max_length=50) def __str__(self): return self.name class District(models.Model): city = models.ForeignKey(City, models.CASCADE, primary_key=True) name = models.CharF...
cab776178b87f7079f312aba3c302668676a7e867e6ec204045e4594915310c6
import datetime import decimal import gettext as gettext_module import os import pickle import re import tempfile from contextlib import contextmanager from importlib import import_module from pathlib import Path from threading import local from unittest import mock import _thread from django import forms from django...
66e7c302083cac22fc51c90e71c7ce98d7db49b1cd46b5b17fc7a6b9ce0bdb84
import os from django.template import Context, Template from django.test import SimpleTestCase, override_settings from django.utils.translation import activate, get_language, trans_real from .utils import POFileAssertionMixin SAMPLEPROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sampleproject...
b1350036d61b7e60cb54fb73c64c366fff047fca893b68512eaa418e8689a79d
import time import unittest from datetime import date, datetime from django.core.exceptions import FieldError from django.db import connection, models from django.test import SimpleTestCase, TestCase, override_settings from django.test.utils import register_lookup from django.utils import timezone from .models import...
f5c86049b8613a3778eefc6a6c71774b0e8055461c5dc65e7a2b741e122682b6
import collections.abc from datetime import datetime from math import ceil from operator import attrgetter from django.core.exceptions import FieldError from django.db import connection from django.db.models.functions import Substr from django.test import TestCase, skipUnlessDBFeature from .models import ( Articl...
5990a20e5427469fa4fe8046d73834ad59316e00d5f4ed540daa850661957d3c
import copy import json import os import pickle import unittest import uuid from django.core.exceptions import DisallowedRedirect from django.core.serializers.json import DjangoJSONEncoder from django.core.signals import request_finished from django.db import close_old_connections from django.http import ( BadHead...
5a2c838aa8a24b7047c9c0787910ad4fea6a9e171e8249f850a5c6b7f2cbe281
import unittest from operator import attrgetter from django.core.exceptions import FieldError, ValidationError from django.db import connection, models from django.test import SimpleTestCase, TestCase from django.test.utils import CaptureQueriesContext, isolate_apps from django.utils.version import PY36 from .models ...
09923ef633d8dc97d52599d6d9db919c4c8961cd0c79b47214d3c275aace325b
import datetime import pickle from io import StringIO from operator import attrgetter from unittest.mock import Mock from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core import management from django.db import DEFAULT_DB_ALIAS, connections, router, tra...
82b505b2e75421aedbaf67542cb6681e938edc5645f42f1e788bec6d7ec1473c
import os import signal from unittest import mock from django.db.backends.postgresql.client import DatabaseClient from django.test import SimpleTestCase class PostgreSqlDbshellCommandTestCase(SimpleTestCase): def _run_it(self, dbinfo): """ That function invokes the runshell command, while mockin...
3144465f24f8fdcdf7f09ca0f39e7cbe4565dbf39ed48aa1318352104283035f
import gettext import os import re from datetime import datetime, timedelta from importlib import import_module import pytz from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import widgets from django.contrib.admin.tests import AdminSeleniumTestCase f...
cff3c2595c751f374c75fa1f6ad3429e1d9d9645841fcca13d6652d7087bdb0e
""" Specifying 'choices' for a field Most fields take a ``choices`` parameter, which should be a tuple of tuples specifying which are the valid values for that field. For each field that has ``choices``, a model instance gets a ``get_fieldname_display()`` method, where ``fieldname`` is the name of the field. This met...
1cfd96b75450d7288aa47e3558b87d5a1bf0f2e795e79f002fe0dd2c634e5b6c
from django.core.serializers.json import DjangoJSONEncoder from django.db import migrations, models from ..fields import ( ArrayField, BigIntegerRangeField, CICharField, CIEmailField, CITextField, DateRangeField, DateTimeRangeField, DecimalRangeField, HStoreField, IntegerRangeField, JSONField, SearchVector...
e8cf7d1799f0c84ea5f30d0d863216e3a722fb57c80a74d1f763574191064238
from datetime import date from django.forms import DateField, Form, SelectDateWidget from django.test import override_settings from django.utils import translation from django.utils.dates import MONTHS_AP from .base import WidgetTest class SelectDateWidgetTest(WidgetTest): maxDiff = None widget = SelectDate...
49f2129f45b9c6f73fc6290bd84b214177c3bcbd217ba7502374ccfb5956eec9
import copy import datetime import json import uuid from django.core.exceptions import NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import MaxValueValidator, RegexValidator from django.forms import ( BooleanField, CharField, CheckboxSelectMultiple, Choi...
f7b1007914efc13085195deb414c3cab754be362405cda0f48f3a090c750ccbd
import datetime from django.contrib.sites.models import Site from django.http import Http404 from django.template import TemplateDoesNotExist from django.test import RequestFactory, TestCase from django.test.utils import override_settings from django.views.defaults import ( bad_request, page_not_found, permission_...
2d36748447925e5864a8d0ac7ac39ca462d66d893cff85b48820ed0827c07e75
import gettext import json from os import path from django.conf import settings from django.test import ( RequestFactory, SimpleTestCase, TestCase, modify_settings, override_settings, ) from django.test.selenium import SeleniumTestCase from django.urls import reverse from django.utils.translation import ( ...
5dd1624989574a2ad11d608a3eccb96759ec1e004aa4f1bf053d7e88aa3133e3
import importlib import inspect import os import re import sys import tempfile from io import StringIO from pathlib import Path from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection from django.shortcuts import render from django.temp...
05d70bc7c42d7370a67f6ce0eb72fef5d7e134a0de0139f65c8589c108fae11d
from django.template import RequestContext, TemplateSyntaxError from django.test import RequestFactory, SimpleTestCase, override_settings from django.urls import NoReverseMatch, resolve from ..utils import setup @override_settings(ROOT_URLCONF='template_tests.urls') class UrlTagTests(SimpleTestCase): request_fac...
d2845cc8e345cb6595e8eaca56c1ea26df5eb9a463e2027409bed4d78c50ba2a
from django.template.defaultfilters import urlize from django.test import SimpleTestCase from django.utils.functional import lazy from django.utils.safestring import mark_safe from ..utils import setup class UrlizeTests(SimpleTestCase): @setup({'urlize01': '{% autoescape off %}{{ a|urlize }} {{ b|urlize }}{% en...
34cabc6c30767cd8fc7d46ceeabfd0bcde516f7839dcc004d3e4571b676404f7
from collections import OrderedDict from datetime import date, datetime from django.conf.urls.i18n import i18n_patterns from django.contrib.sitemaps import GenericSitemap, Sitemap, views from django.http import HttpResponse from django.urls import path from django.utils import timezone from django.views.decorators.cac...
155926f03f179b46f1e3d6493ff8dbc723df9c2775e23298dc472b2fd324a764
import re import threading import unittest from django.db import connection, transaction from django.db.models import Avg, StdDev, Sum, Variance from django.db.models.aggregates import Aggregate from django.db.models.fields import CharField from django.db.utils import NotSupportedError from django.test import ( Te...
bc93968cc92af446537b1673790bd8a28e55a2beac8b271b6d7f1c87091e52b1
import decimal from django.db import NotSupportedError, connection from django.db.backends.base.operations import BaseDatabaseOperations from django.db.models import DurationField from django.test import ( SimpleTestCase, TestCase, override_settings, skipIfDBFeature, ) from django.utils import timezone class Sim...
7a77cbff31924655a3ce469827e0a7dbb645eb68b0cfe1913c8b32fcec25ec95
import unittest from unittest import mock from django.core.exceptions import ImproperlyConfigured from django.db import DatabaseError, connection, connections from django.test import TestCase @unittest.skipUnless(connection.vendor == 'postgresql', 'PostgreSQL tests') class Tests(TestCase): def test_nodb_connect...
0223df9a23821a40487e6358c998d1b1c2d17820da06c2cb1390953370aa3c5f
import os import re from io import StringIO from django.contrib.gis.gdal import GDAL_VERSION, Driver, GDALException from django.contrib.gis.utils.ogrinspect import ogrinspect from django.core.management import call_command from django.db import connection, connections from django.test import SimpleTestCase, TestCase, ...
eb084d7cfd9ba820d03b37ff0563d0e554fb62d0a8959972ab534bedc24428e4
import os import unittest from copy import copy from decimal import Decimal from django.conf import settings from django.contrib.gis.gdal import DataSource from django.contrib.gis.utils.layermapping import ( InvalidDecimal, InvalidString, LayerMapError, LayerMapping, MissingForeignKey, ) from django.db import ...
b5a05dcf6da7ae78b41ec99955cfed1351b143e25eee45c1bf4fd542003c0cba
from django.contrib.gis.db import models class NamedModel(models.Model): name = models.CharField(max_length=25) class Meta: abstract = True def __str__(self): return self.name class State(NamedModel): pass class County(NamedModel): state = models.ForeignKey(State, models.CASC...
eba10e81b2011c4fa284b204c268d00d9148bdccc346bc86e295078f9041b625
import json import math import re from decimal import Decimal from django.contrib.gis.db.models import functions from django.contrib.gis.geos import ( GEOSGeometry, LineString, Point, Polygon, fromstr, ) from django.contrib.gis.measure import Area from django.db import NotSupportedError, connection from django.db....
f600106be268490b4d54a2f6334bea31cb5577e4071348498aa3935a5ea923be
import tempfile 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, Point, Polygon, from...
e29f131f221d62924a71b4463b155ab92c0a3ec5bf9e03c4489afb43d00afc59
import ctypes import itertools import json import pickle import random from binascii import a2b_hex from io import BytesIO from unittest import mock from django.contrib.gis import gdal from django.contrib.gis.geos import ( GeometryCollection, GEOSException, GEOSGeometry, LinearRing, LineString, MultiLineString...
874facd01d4c9ac637f651f7c98d0083ce639befbb32765e8dcf645e9f5aa9dd
import os import shutil import struct import tempfile from django.contrib.gis.gdal import GDAL_VERSION, GDALRaster from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.raster.band import GDALBand from django.contrib.gis.shortcuts import numpy from django.test import SimpleTestCase from...
be990e0228c0bcd91d16339c474b69a2834e92dc8beb19e2b728648bbd3931d8
from datetime import datetime, timedelta import pytz from django.conf import settings from django.db.models import ( DateField, DateTimeField, IntegerField, Max, OuterRef, Subquery, TimeField, ) from django.db.models.functions import ( Extract, ExtractDay, ExtractHour, ExtractIsoYear, ExtractMinute, Extra...
088ce2b55e0ed6a702f9b15f6ed28ca11e4c3c8c52567e8b949e80a230b68f2a
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Sqrt from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class SqrtTests(TestCase): def test_null(self)...
5f55dd46770e335b0f0f43bf5a9927ce8cb23f1c9bc990b15c4baf946fd48174
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Ceil from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class CeilTests(TestCase): def test_null(self)...
6c930902fd7e0d8e606c715073c8edf73f8863e474399e402fa47424884060a5
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import ATan from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class ATanTests(TestCase): def test_null(self)...
60cbb8a71501a167c43e0ec3c70e20879c0c0c9acefb2a404b15c82ae8a7b7f7
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Floor from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class FloorTests(TestCase): def test_null(sel...
19a4d3ce860a1314f213404a3da564e62cd1f78ec8518634a61ba48309f4674e
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import ACos from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class ACosTests(TestCase): def test_null(self)...
c395d6b8c6b35c1ce7d1d696ccb6ee81b4b99114209ba750c8f3b84694f000e3
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Cos from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class CosTests(TestCase): def test_null(self): ...
898fbd3a493aaec82148d5e5aab4c871e0a39de3c42f61edb3654751c00a51cd
from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Round from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class RoundTests(TestCase): def test_null(self): ...
ce4b2ebc37dc0aa214b303513b039d6f21ad2c1bd4eddcd3c7ab904a723f5e06
from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Abs from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class AbsTests(TestCase): def test_null(self): Inte...
85bf859fa1d67a3e5a48a077649eb772f069ce1f27df8ae5254bd224eb558fe2
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Cot from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class CotTests(TestCase): def test_null(self): ...
bf9632721cce6c7075163af1e43fc2e5c8fa9ad962a7dfcbc93387d3b4d53aa9
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Degrees from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class DegreesTests(TestCase): def test_null...
8dda05ba33c4ccdb65eed602974848cd73adead06723e0d4b974ba792f82bdc1
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import ASin from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class ASinTests(TestCase): def test_null(self)...
05965a95450856a526b70b11dee972292f9561eef37faedd969beccff75a6332
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Tan from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class TanTests(TestCase): def test_null(self): ...
cd3ecc7c7205d4ef7a278a067572cb73e05b8c99613ee9f397e46582095cf4a2
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Radians from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class RadiansTests(TestCase): def test_null...
eba214aff8e4974254baa8dc77a367856398c65a63881f774706e52e10ce3f6f
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Sin from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class SinTests(TestCase): def test_null(self): ...
d8cece6a69f0f790e85fb469dcbd2b0099ac823a335641cef6caad03b3ba09df
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Exp from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class ExpTests(TestCase): def test_null(self): ...
4c1377452726a8f5a5d9dc709ba09f054fece5ccaf7cead8135ddd774a46eac1
import math from decimal import Decimal from django.db.models import DecimalField from django.db.models.functions import Ln from django.test import TestCase from django.test.utils import register_lookup from ..models import DecimalModel, FloatModel, IntegerModel class LnTests(TestCase): def test_null(self): ...
909ac3953325650ed1e45ea6d127a478e51884ef79ca737b2577b08a41b6285d
#!/usr/bin/env python import argparse import atexit import copy import os import shutil import socket import subprocess import sys import tempfile import warnings import django from django.apps import apps from django.conf import settings from django.db import connection, connections from django.test import TestCase, ...
cc29fe75a32d2a20820b1cf64236dcd02564914ffd646eeaf8f9bb76a28234ba
# Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't picklable (module imports are okay...
285f55028216030e2053d5c923cd9a30c6733b004b7ff70bb50a41940a55e5ee
import json import mimetypes import os import re import sys from copy import copy from functools import partial from http import HTTPStatus from importlib import import_module from io import BytesIO from urllib.parse import unquote_to_bytes, urljoin, urlparse, urlsplit from django.conf import settings from django.core...
b4829303e1ec9b4477aa71928dae2e55c0a80530d38a45d71882fa0a73f839bb
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 from difflib import get_close_matches from functools import wraps from unittest.util import safe_repr from urllib.parse impo...
bdf0356633ad5623091caae63f2969fa0147a13cfa5c1c7ef4e6c8bb9c3d2f80
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...
8092d2eaca4573c452bbd9ed95529cd8c6f45f0707c47acfc4abbde9c0d44515
import itertools import json import os import re from urllib.parse import unquote from django.apps import apps from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.template import Context, Engine from django.urls import translate_url from django.utils.fo...
5dad1a4b95843b48d6fa8fc60e2f26a82fc755e25756daf22ad3d84219c5f956
import functools import re import sys import types from pathlib import Path from django.conf import settings from django.http import HttpResponse, HttpResponseNotFound from django.template import Context, Engine, TemplateDoesNotExist from django.template.defaultfilters import pprint from django.urls import Resolver404...
91d172185cdf1927cd56df62986695c19544eb846ea3e18081b1b46b8b99d6bc
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 ...
828ed56695ba04d7292cb7436e1810b72bd0bdb38f796558ce67d0c54fe00161
"""HTML utilities suitable for global use.""" import json import re from html.parser import HTMLParser from urllib.parse import ( parse_qsl, quote, unquote, urlencode, urlsplit, urlunsplit, ) from django.utils.functional import Promise, keep_lazy, keep_lazy_text from django.utils.http import RFC3986_GENDELIMS, RF...
7cbce3b03a94de3f5ff61e9a7e9f2e8a5b23f652d2429e98fc4fe107990bad6a
""" Functions for working with "safe strings": strings that can be displayed safely without further escaping in HTML. Marking something as a "safe string" means that the producer of the string has already turned characters that should not be interpreted by the HTML engine (e.g. '<') into the appropriate entities. """ ...
c28ea717d027ecc2c8a981dec62b5e004b8b8e6d04c65b2a4c483761c8776177
import copy import itertools import operator from functools import total_ordering, wraps class cached_property: """ Decorator that converts a method with a single self argument into a property cached on the instance. A cached property can be made out of an existing method: (e.g. ``url = cached_pr...
3ca21c6ffd99100c252f0f11a84455f1e54478954caef95e12e65704859c6656
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...
9336230c07a4a6eca01dd1d6193fe421b733e3d254ad36a4977b7a5e1226f2f5
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ import logging import re import string from urllib.parse import urlparse from django.conf import settings from django.core.exceptions import DisallowedHost, Improperl...
0d4d398417274509aab863550eb2eefa663db84e5df3ea742540175c1c489832
""" Helper functions for creating Form classes from Django models and database field objects. """ from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError, ) from django.forms.fields import ChoiceField, Field from django.forms.forms impor...
ff54d8b06d9c03055afce6a2c8c3aa920b1b5d9eb627b0dc640015de7dbfe940
""" Form classes """ import copy from django.core.exceptions import NON_FIELD_ERRORS, ValidationError # BoundField is imported for backwards compatibility in Django 1.9 from django.forms.boundfield import BoundField # NOQA from django.forms.fields import Field, FileField # pretty_name is imported for backwards compa...
9cd016c8cdb39705b7cbfeb89f1796b392a18d0f52f214adfc63c6470b29e6e8
""" 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 from urllib.parse import unquote from django.conf import settings from django.core.exceptions import ( RequestDa...
a6b41d8e9bce659f1e05ecd26142dbcb5caf94f990fd836aac6b503c8950a50c
import datetime import json import mimetypes import os import re import sys import time 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.core.exceptions import DisallowedRedir...
219be645a313effc49b67afacb0270e51263595a1bf3636a01cce34843deb247
import copy import re from io import BytesIO from itertools import chain from urllib.parse import quote, urlencode, urljoin, urlsplit from django.conf import settings from django.core import signing from django.core.exceptions import ( DisallowedHost, ImproperlyConfigured, RequestDataTooBig, ) from django.core.fil...
07ba75d202e4f325bd5d904a035fccfb93a8382dd98699957bd1d5d453e3c31b
"""Translation helper functions.""" import functools import gettext as gettext_module import os import re import sys import warnings from threading import local from django.apps import apps from django.conf import settings from django.conf.locale import LANG_INFO from django.core.exceptions import AppRegistryNotReady ...
c7071511faae00534bcbfd3b6c9cd6a050e6b9d67b861b8ae105fe65dfecb6d7
""" Internationalization support. """ import re import warnings from contextlib import ContextDecorator from django.utils.autoreload import autoreload_started, file_changed from django.utils.deprecation import RemovedInDjango40Warning from django.utils.functional import lazy __all__ = [ 'activate', 'deactivate', ...
e1ed9d99c4115da1a1b543b41f6eba1378440f0821cbcaf655c68c070521388f
from django.apps.registry import Apps from django.db import models from django.db.utils import DatabaseError from django.utils.decorators import classproperty from django.utils.timezone import now from .exceptions import MigrationSchemaMissing class MigrationRecorder: """ Deal with storing migration records ...
085d2e3e7db8e8199aee22c66b720a369592f4810b5c04e0ad1475a13a3990bc
import builtins import collections.abc import datetime import decimal import enum import functools import math import re import types import uuid from django.conf import SettingsReference from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.utils import COMP...
f94cb8e8df048c2870f29d80a5beb72217081fa3a264cc0d027aafc9484381e9
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Case, Func, Star, When from django.db.models.fields import IntegerField from django.db.models.functions.mixins import ( FixDurationInputMixin, NumericOutputFiel...
e85677a9dba39070b02cd861e823ae0019226ec30a3ee9dedfb743255b627f66
""" 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 ( ...
7c498ae5541a03d8f9123e9c56744ecb7e9add21c0aae94737cea44326109e39
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, ...
a09990d086e41b6a59f9bf7e704ced12d91e4725ddc994a128fecb638e7ea18a
from collections import Counter 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 = protected_objects sup...
84f39db87a49778ac86e1ebd608c39777b0cb6fa926b3392b99977ac2dd58bba
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...
9f119ef0dfd520880b88a761a5c480b0f9770563da69429563b1ff53a19ac466
import datetime import posixpath from django import forms from django.core import checks from django.core.files.base import File from django.core.files.images import ImageFile from django.core.files.storage import default_storage from django.db.models import signals from django.db.models.fields import Field from djang...
e1965585c1153df36b7b5661a62d5f6998e8d019d648f606158b82b252ca62ad
import math from django.db.models.expressions import Func from django.db.models.fields import FloatField, IntegerField from django.db.models.functions import Cast from django.db.models.functions.mixins import ( FixDecimalInputMixin, NumericOutputFieldMixin, ) from django.db.models.lookups import Transform class ...
ab5053b3ce03f4eb6d84b61e78b7c79560515860775cad1f4eed82a71ba6ed33
""" 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 ...