hash
stringlengths
64
64
content
stringlengths
0
1.51M
5f95ea4188ca589e1dbc69e9f00b5d7cb69a5d3fe6d55f2511c8a05d30bdb3fa
from django.db.models.expressions import Func, Value from django.db.models.fields import IntegerField from django.db.models.functions import Coalesce from django.db.models.lookups import Transform class BytesToCharFieldConversionMixin: """ Convert CharField results from bytes to str. MySQL returns long d...
cf51a42ca4d10369e61a136263832649c0541990209bcabd4c8e1b5a1ec4a750
from .comparison import Cast, Coalesce, Greatest, Least, NullIf from .datetime import ( Extract, ExtractDay, ExtractHour, ExtractIsoYear, ExtractMinute, ExtractMonth, ExtractQuarter, ExtractSecond, ExtractWeek, ExtractWeekDay, ExtractYear, Now, Trunc, TruncDate, TruncDay, TruncHour, TruncMinute, TruncMo...
8b246dd31675bc1bc9ed0b4c9ee39d544196aaa41977a21ac060fb727547f085
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 ...
5dc2ff21d501256d6a3c89859f04e122a97f27e0e8f9bca7d30b56dc0c412c33
from datetime import datetime from django.conf import settings from django.db.models.expressions import Func from django.db.models.fields import ( DateField, DateTimeField, DurationField, Field, IntegerField, TimeField, ) from django.db.models.lookups import ( Transform, YearExact, YearGt, YearGte, YearLt, Yea...
b327832d0a840755040aa9e56db973fb68c0b6980f155160e4497d4710363528
import sys from django.db.models.fields import DecimalField, FloatField, IntegerField from django.db.models.functions import Cast class FixDecimalInputMixin: def as_postgresql(self, compiler, connection, **extra_context): # Cast FloatField to DecimalField as PostgreSQL doesn't support the # foll...
ec5de49b3e60a21699e825523cc91839e8d2d5cf390af7327230901ff9ae808f
""" 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 ...
b45e8178bc686c1cacdeeca010d1c7bfaee0c2d7099e67fb3368eb3ca798a2df
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, Subquery from django.db.models.query_utils import QueryWrapper,...
da8da4550f215cad14b8f9507842c3bfd1106a32a0556f6bc4d4f53075e64da7
""" Code to manage the creation and SQL rendering of 'where' constraints. """ from django.core.exceptions import EmptyResultSet from django.utils import tree from django.utils.functional import cached_property # Connection types AND = 'AND' OR = 'OR' class WhereNode(tree.Node): """ An SQL WHERE clause. ...
44a38ad8a4a6eb8e5786a2db02240666369614915a71e2f5c68d4d5bb99b954e
from django.db.backends.base.features import BaseDatabaseFeatures from django.db.utils import InterfaceError from django.utils.functional import cached_property class DatabaseFeatures(BaseDatabaseFeatures): interprets_empty_strings_as_nulls = True has_select_for_update = True has_select_for_update_nowait ...
db8c9dee3c47967e1011c0f2a4c8bc6e5db2c0c2298dbc5b1ff9a551405b6311
from django.db import NotSupportedError from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def as_sql(self, with_limits=True, with_col_aliases=False): """ Create the SQL for this query. Return the SQL string and list of parameters. This is overridden from th...
f6e2f5fc32e4eacf7a5b48843fb1e18a9f4e830ea1e5070772163ab20db51b5d
""" 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...
085bed458ff4a18521ca28dc0cff0f877d51dd282ad9cb62fce49f996a30ac2a
import datetime import re import uuid from functools import lru_cache from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.db.backends.utils import strip_quotes, truncate_name from django.db.utils import DatabaseError from django.utils import timezone from ...
b52a8f13f57327b14f358196bb1189397d7f6e549597a87b931b40a75addb6f1
import copy import datetime import re from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.utils import DatabaseError class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_create_column = "ALTER TABLE %(table)s ADD %(column)s %(definition)s" sql_alter_column_type = "MODIFY ...
17d0ba5374b9ec168c3b6d42b940f4d08ae7a82ac2aad8960972f874cd6d2c3f
import sys from django.conf import settings from django.db.backends.base.creation import BaseDatabaseCreation from django.db.utils import DatabaseError from django.utils.crypto import get_random_string from django.utils.functional import cached_property TEST_DATABASE_PREFIX = 'test_' class DatabaseCreation(BaseData...
b9e3e04ecbacaa249d30c8613c3ccdb926f2186f524a2be27f0f2b1f4163d292
from django.db.utils import ProgrammingError from django.utils.functional import cached_property class BaseDatabaseFeatures: gis_enabled = False allows_group_by_pk = False allows_group_by_selected_pks = False empty_fetchmany_value = [] update_can_self_select = True # Does the backend distingu...
9206dd26ea08eae1fbd4e7e02ed3896e3cf09f2b86a54d0985815d3d80220994
import copy import time import warnings from collections import deque from contextlib import contextmanager import _thread import pytz from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS from django.db.backends import utils from django.db.bac...
2c3f78f30d71db6b7b6800aa34c225a252b716f6a0b6ba3e40d28a1f88fffd73
import datetime import decimal from importlib import import_module import sqlparse from django.conf import settings from django.db import NotSupportedError, transaction from django.db.backends import utils from django.utils import timezone from django.utils.encoding import force_text class BaseDatabaseOperations: ...
a88945f9861e8ac674b573abd9078205cec30f249cf6f04349ccabe4855b0a9a
import logging from datetime import datetime from django.db.backends.ddl_references import ( Columns, ForeignKeyName, IndexName, Statement, Table, ) from django.db.backends.utils import names_digest, split_identifier from django.db.models import Index from django.db.transaction import TransactionManagementError, a...
4c5cb096bce54b244d7a8ae1ace13c6fc123d37235a9f0414b89d90b6584bcd6
import os import sys from io import StringIO from django.apps import apps from django.conf import settings from django.core import serializers from django.db import router # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation: ...
62a3e18da8ae3d7de1b99c4b93da04ed7c669504723a852d12bfed5c105e37a1
""" 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...
b3962d0b0dddb275856883807ddae5d0a8c86d4d1b35841c55155bff50779a72
import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.utils import timezone from django.utils.duration import duration_microseconds class DatabaseOperations(BaseDatabaseOperations): compiler_module = "django.db.backends.mysql.compiler" ...
62a4655d97a6f632178a51fd78a1b08dfa13678834d7c50df9d0e3650ebd0095
from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.models import NOT_PROVIDED class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s" sql_alter_column_null = "MODIFY %(column)s %(type)s NULL" sql_alter_column_...
a00757670e6046f40fadc1ddb92e547a70df8a8d599bacc9af510e32cbac37a8
import subprocess import sys from django.db.backends.base.creation import BaseDatabaseCreation from .client import DatabaseClient class DatabaseCreation(BaseDatabaseCreation): def sql_table_creation_suffix(self): suffix = [] test_settings = self.connection.settings_dict['TEST'] if test_...
0d133fb236b23065b25297a5f8b8611d4c20a9d3462e3e68a898ba3a20b313eb
import operator from django.db.backends.base.features import BaseDatabaseFeatures from django.db.utils import InterfaceError from django.utils.functional import cached_property class DatabaseFeatures(BaseDatabaseFeatures): allows_group_by_selected_pks = True can_return_id_from_insert = True can_return_id...
b6405edfac2079c1517b4ad91e89d6639a3b488046f21ac1142781ad5597a8a7
from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.db.models.indexes import Index class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 17: ...
f766a1e6b92df171db0fe61ee62e8b3f496ecd01f19d7e5d360ccf8353664686
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ 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 BaseDatabaseWrapp...
146c393d1dbaa16b53c9469b556768bc77f6766eba5b6c3e10a59b689c576aef
from psycopg2.extras import Inet from django.conf import settings from django.db import NotSupportedError from django.db.backends.base.operations import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): cast_char_field_without_max_length = 'varchar' explain_prefix = 'EXPLAIN' cast_...
b6d7016f35478e1a249e5306a50cd3870a4fd6e6a7afe179fb5ae030dbad600b
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...
115500ae423979a759ea98b36a4ec85ec7074e7ff232d27810703a69b8ce2b20
import sys from psycopg2 import errorcodes from django.db.backends.base.creation import BaseDatabaseCreation from django.db.backends.utils import strip_quotes class DatabaseCreation(BaseDatabaseCreation): def _quote_name(self, name): return self.connection.ops.quote_name(name) def _get_database_cr...
2f8fc7142dd828f288cf0205f41819a3abe3dbc719ebdee0224884928b7eb8a9
import sys from django.db.backends.base.features import BaseDatabaseFeatures from .base import Database class DatabaseFeatures(BaseDatabaseFeatures): # SQLite can read from a cursor since SQLite 3.6.5, subject to the caveat # that statements within a connection aren't isolated from each other. See # htt...
ab47f930704916305a8074316ee0cca7047bf5005fd34ddc784d9bac9e4356f7
import re from collections import namedtuple import sqlparse from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo as BaseFieldInfo, TableInfo, ) from django.db.models.indexes import Index FieldInfo = namedtuple('FieldInfo', BaseFieldInfo._fields + ('pk',)) field_size_re = re....
fce5f1e3a4f4eae15dddb1df6c18901856fff05a8f89c1919d3eb99a26d5befa
""" SQLite backend for the sqlite3 module in the standard library. """ import datetime import decimal import functools 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 import ImproperlyCon...
0fbc08be6398df5e77f23fbd9d01005163eb070fa72a111c6a08839966d2fd30
import datetime import decimal import uuid from functools import lru_cache from itertools import chain from django.conf import settings from django.core.exceptions import FieldError from django.db import utils from django.db.backends.base.operations import BaseDatabaseOperations from django.db.models import aggregates...
5a565d83680e8b75c12f9a51500992196f6cc63e325ebbfa9a65f5d58eb4b397
import os import shutil import sys from django.db.backends.base.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): @staticmethod def is_in_memory_db(database_name): return database_name == ':memory:' or 'mode=memory' in database_name def _get_test_db_name(self): ...
54cdbdc8f3eba44c0575719675e96fc6a776dc244a08b0065819949eedab8c2a
""" 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...
4473f1650c75c6fe63c61b2d5ffefeba925fea8bd3b528e53c7f30718f8f8c91
""" The temp module provides a NamedTemporaryFile that can be reopened in the same process on any platform. Most platforms use the standard Python tempfile.NamedTemporaryFile class, but Windows users are given a custom class. This is needed because the Python implementation of NamedTemporaryFile uses the O_TEMPORARY f...
389e7f1f4c7d737292f23c8b63dbccf79d261ba4cdf9193298cbf59faff92acb
import os from io import BytesIO, StringIO, UnsupportedOperation from django.core.files.utils import FileProxyMixin from django.utils.functional import cached_property class File(FileProxyMixin): DEFAULT_CHUNK_SIZE = 64 * 2 ** 10 def __init__(self, file, name=None): self.file = file if name ...
c37593c8de4255c37060c94703889bfb82817f5db771f14098f89215c6602161
import os from datetime import datetime from urllib.parse import urljoin from django.conf import settings from django.core.exceptions import SuspiciousFileOperation from django.core.files import File, locks from django.core.files.move import file_move_safe from django.core.signals import setting_changed from django.ut...
6f3448658ad74227a8cab743e54454affcb9e48fb9e134297f618bcf8618bc9c
import inspect import types from collections import defaultdict from itertools import chain from django.apps import apps from django.core.checks import Error, Tags, register @register(Tags.models) def check_all_models(app_configs=None, **kwargs): db_table_models = defaultdict(list) errors = [] if app_con...
e1285ab59f6998c2148eb9042e79ee4fec5101d18ad591ba7d27739ef83ee250
from django.conf import settings from django.utils.translation.trans_real import language_code_re from . import Error, Tags, register E001 = Error( 'You have provided an invalid value for the LANGUAGE_CODE setting.', id='translation.E001', ) @register(Tags.translation) def check_setting_language_code(app_co...
377793278824d92fa6f10dfd46523b4def631de2ccc3720eb0f9053db933b7b1
import functools import os import pkgutil import sys from collections import OrderedDict, 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 ImproperlyConfigured from django...
683fb6f7f709bfa5337b2ba24d123762faefce191913185f547c2e8f2898f76b
""" Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ import os import sys from argparse import ArgumentParser, HelpFormatter from io import TextIOBase import django from django.core import checks from django.core.exceptions import Improp...
bedf76e7376c1487bf6670f4e9d22d3233d20c51490a2c7f8dc8ea949b8b65db
import os from subprocess import PIPE, Popen from django.apps import apps as installed_apps from django.utils.crypto import get_random_string from django.utils.encoding import DEFAULT_LOCALE_ENCODING from .base import CommandError, CommandParser def popen_wrapper(args, stdout_encoding='utf-8'): """ Friendly...
d0af9ad7bfb126fa94338556567d4b99f35f5cece6cd5917c85d81ce7e591cbb
""" Module for abstract serializer/unserializer base classes. """ from io import StringIO from django.core.exceptions import ObjectDoesNotExist from django.db import models DEFER_FIELD = object() class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class Serialization...
aad610ca9d815f3f407df34bccfa42641348c64611e26c9ff4eca56fd7e5e8ce
""" YAML serializer. Requires PyYaml (https://pyyaml.org/), but that's checked for in __init__. """ import collections import decimal from io import StringIO import yaml from django.core.serializers.base import DeserializationError from django.core.serializers.python import ( Deserializer as PythonDeserializer,...
247f4f402242e491fb7341119e61929a1735690c2da585130560084569980fbe
""" A Python "serializer". Doesn't do much serializing per se -- just converts to and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for other serializers. """ from collections import OrderedDict from django.apps import apps from django.core.serializers import base from django.db import ...
33b22da401fe6b99904a606f7c015311662f4d2ff90ac3cee7372b59c1c66199
import cgi import codecs import re from io import BytesIO from django.conf import settings from django.core import signals from django.core.handlers import base from django.http import HttpRequest, QueryDict, parse_cookie from django.urls import set_script_prefix from django.utils.encoding import repercent_broken_unic...
db7da3422150abc351f328d23513d83bcf14827088019ca5aab97cc75a105216
import mimetypes from email import ( charset as Charset, encoders as Encoders, generator, message_from_string, ) from email.errors import InvalidHeaderDefect, NonASCIILocalPartDefect from email.header import Header from email.headerregistry import Address from email.message import Message from email.mime.base impor...
b524212383fe940d53d145053eb869b18de61473f3764679f406a3e455a78be8
import time from collections import OrderedDict from importlib import import_module from django.apps import apps from django.core.checks import Tags, run_checks from django.core.management.base import ( BaseCommand, CommandError, no_translations, ) from django.core.management.sql import ( emit_post_migrate_sig...
00aefad8cf7e14f3dde34f93c79211e9eb073761885f970fa46f88c796cc1639
import warnings from collections import OrderedDict from django.apps import apps from django.core import serializers from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import parse_apps_and_model_labels from django.db import DEFAULT_DB_ALIAS, router class ProxyModelWa...
d26efe04dfdc8431b281fa6ff0834cdbfc6b93108c3e7c8cdab79e272cd93b3e
import errno import os import re import socket import sys from datetime import datetime from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp import ( WSGIServer, get_internal_wsgi_application, run, ) from django.utils import autoreload...
827b01510820025a34e70f53a8f23cd8ae0d88d00633d1e42fe0678c9e3a4070
from django.apps import apps from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections, migrations from django.db.migrations.loader import AmbiguityError, MigrationLoader from django.db.migrations.migration import SwappableTupl...
b52f0a162ae68704dd3986dc589b54d3885fc2b9afd5653c04ba07dc622a4319
import codecs import concurrent.futures import glob import os from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import find_command, popen_wrapper def has_bom(fn): with open(fn, 'rb') as f: sample = f.read(4) return sample.startswith((codecs.BOM_UTF8,...
d5fa8311c1d21852704884493f3426bbfab0f0c1a2e9f1482339d880379a9daa
import functools import glob import gzip import os import sys import warnings import zipfile from itertools import product from django.apps import apps from django.conf import settings from django.core import serializers from django.core.exceptions import ImproperlyConfigured from django.core.management.base import Ba...
9ededcee79b2b64b8ec7cd5474962b261b1bf517620ebfdf9740eea0105b5c94
import fnmatch 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 im...
47f46e0532fb671d8c0c4d6a00bdf2544459abe3692eeaf6b4d7dbd664c65094
from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.executor import MigrationExecutor from django.db.migrations.loader import AmbiguityError class Command(BaseCommand): help = "Prints the SQL s...
ca08b5817c6b1809649fdb46a52dea9fc973df78f77fb6735893176cb541e1d2
import sys from django.apps import apps from django.core.management.base import BaseCommand from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.loader import MigrationLoader class Command(BaseCommand): help = "Shows all available migrations for the current project" def add_argument...
69eb83b9189e8c7af1da10b267c48ffd81fa5d9a56b0fb97a9486ca23af725f6
import keyword import re from collections import OrderedDict from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.models.constants import LOOKUP_SEP class Command(BaseCommand): help = "Introspects the database tables in the given dat...
687d304278c0f87190e8e61d96d470ac9ae354a7b1852b9b89f2c1db172d01a3
import os import sys from itertools import takewhile from django.apps import apps from django.conf import settings from django.core.management.base import ( BaseCommand, CommandError, no_translations, ) from django.db import DEFAULT_DB_ALIAS, connections, router from django.db.migrations import Migration from djan...
25c91f9ad335d728bb1f92f56315287a5b6a3d3f0ea920a89aa06199b7222832
"File-based cache backend" import glob import hashlib import os import pickle import random import tempfile import time import zlib from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.core.files import locks from django.core.files.move import file_move_safe class FileBasedCache(BaseCac...
47c9be625e405722f04b0f5084659b627ff67274f005e5d6c3e857dbdc2c341a
"Memcached cache backend" import pickle import re import time from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils.functional import cached_property class BaseMemcachedCache(BaseCache): def __init__(self, server, params, library, value_not_found_exception): super().__...
07e08e913486223ec3bdf889e2be20e50814f1655f108ae2fb9bc2cad46ff681
"""SMTP email backend class.""" import smtplib import socket import ssl import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.message import sanitize_address from django.core.mail.utils import DNS_NAME class EmailBackend(BaseEmailBackend):...
6715d461c8fcbb2cfef3b8c639e2a3dbcc78222f9fb3aa8426393e1b53b5731e
"Misc. utility functions/classes for admin documentation generator." import re from email.errors import HeaderParseError from email.parser import HeaderParser from django.urls import reverse from django.utils.safestring import mark_safe try: import docutils.core import docutils.nodes import docutils.pars...
4caa201f2749214ae12317c39834c42a1c486f2f75ebe2482ac240b498195ed1
from django.db.models import Index from django.db.utils import NotSupportedError from django.utils.functional import cached_property __all__ = [ 'BrinIndex', 'BTreeIndex', 'GinIndex', 'GistIndex', 'HashIndex', 'SpGistIndex', ] class PostgresIndex(Index): @cached_property def max_name_length(self): ...
ae6c5da613e76fbd126b60d18f2f3bef939f28d82578b2e442764a895c51bde2
from django.db.models import Field, FloatField from django.db.models.expressions import CombinedExpression, Func, Value from django.db.models.lookups import Lookup class SearchVectorExact(Lookup): lookup_name = 'exact' def process_rhs(self, qn, connection): if not hasattr(self.rhs, 'resolve_expressio...
ad8009f81da42f94a4427d25f12594c5d709784304e5c4434589037638c58a8b
import inspect import warnings from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.utils.deprecation import RemovedInDjango31Warning UserModel = get_user_model() class ModelBackend: """ Authenticates against settings.AUTH_USER_MODEL. """ def ...
b46c8d02db90b18c4a66b7addaa851def0b5ee6e9cb60ea3e7af135743b07028
from django.contrib import auth from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.core.mail import send_mail from django.db import models from django.db.models.manager imp...
b8e1911527ceffbe28688ca27326a66546cf985fecc9ad5cb7825ae415939552
import base64 import binascii import functools import hashlib import importlib import warnings from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import receiver from django.ut...
60afb963bdfe3f08f63aa679f0472c62fdf851d31fc43f7b71e199875bde7732
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...
d98c89556c7a5220358cac5f83025559c9075d2eda7049024006036ca7b0f5ec
import functools import gzip import re from difflib import SequenceMatcher from pathlib import Path from django.conf import settings from django.core.exceptions import ( FieldDoesNotExist, ImproperlyConfigured, ValidationError, ) from django.utils.functional import lazy from django.utils.html import format_html, f...
ac54f51dd878e15d0f3ce54d460dd860044066d891dd4ca274ece23abc3a8ca1
import json from django import forms from django.conf import settings from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field, ) from django.core.exceptions import ObjectDoesNotExist from django.db.models.fields.related import ManyToMany...
015c0060b5746de91286830f66c591f4159b8dc95f3409e5d23b6013de911e67
from itertools import chain from django.apps import apps from django.conf import settings from django.contrib.admin.utils import ( NotRelationField, flatten, get_fields_from_path, ) from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models from django.db.model...
104fdb8bafe5481614b0582d3e069f960c80ffc17809794403ec49f1e0e53786
import json from django.conf import settings from django.contrib.admin.utils import quote from django.contrib.contenttypes.models import ContentType from django.db import models from django.urls import NoReverseMatch, reverse from django.utils import timezone from django.utils.text import get_text_list from django.uti...
350ddd3d2f6b0429cf6aad95c9936bdcfd19132aa5066d4962ac33c868d0da4a
import copy import json import operator import re from collections import OrderedDict 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, ...
c6f6a26db62535f1a509d0c87923a73f2ddf17ba8b56b14c6a3ce81202d25453
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 django.http imp...
19d0880ac2bc5b2cba900ea89b0fb6be5e2d95306924d3f8f8793cb51ab26936
""" Form Widget classes specific to the Django admin site. """ import copy import json from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.db.models.deletion import CASCADE from django.urls import reverse from django.urls.exceptions import NoReverseM...
f42ca455d5d0c9a24bfdf233ff4d0b888a88b57943d0eddbe127f464ebbdbadf
import datetime import decimal import re from collections import defaultdict from django.core.exceptions import FieldDoesNotExist from django.db import models, router from django.db.models.constants import LOOKUP_SEP from django.db.models.deletion import Collector from django.forms.utils import pretty_name from django...
7d078eb47e819c9193bf0b649db0bc7491cb5ae8f921030fdd6ae2ca9ff50b91
import functools import os from collections import OrderedDict from django.apps import apps from django.conf import settings from django.contrib.staticfiles import utils from django.core.checks import Error from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import ( FileSystemSt...
2f75d24e77d5b09a705e6c3f5d168ae8e8053753fabd32d7f4fcef36e37d402a
import hashlib import json import os import posixpath import re import warnings from collections import OrderedDict from urllib.parse import unquote, urldefrag, urlsplit, urlunsplit from django.conf import settings from django.contrib.staticfiles.utils import check_settings, matches_patterns from django.core.cache imp...
e607ef629424851b8f376561c91679e8ab7230972bf5cd7931c2945655790902
from collections import defaultdict from django.apps import apps from django.db import models from django.utils.translation import gettext_lazy as _ class ContentTypeManager(models.Manager): use_in_migrations = True def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Cac...
f282efc6026d4c653aa1d36eebde2166f648fc628f763530f271674187a1eb5d
from collections import defaultdict from django.contrib.contenttypes.models import ContentType from django.core import checks from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, models, router, transaction from django.db.models import DO_NOTHING from django....
a590a476bebec0e42265ebd15974f7621be88d903377cb8d19d8bb8e9429e0db
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, IntegerField, Transform from django.db.models.lookups ...
f68e9d8ef61a3896252e2eec6186c1dadecdc2d9384227090cd1ce96a174f61d
from django.db.models.expressions import F, OrderBy class OrderableAggMixin: def __init__(self, expression, ordering=(), **extra): if not isinstance(ordering, (list, tuple)): ordering = [ordering] ordering = ordering or [] # Transform minus sign prefixed strings into an OrderB...
045b314108999ebf9c264287cbbe0932ec625aefb4f81c56a99e7d7a77cb274f
from django.db import migrations from django.db.models import Q def update_proxy_model_permissions(apps, schema_editor, reverse=False): """ Update the content_type of proxy model permissions to use the ContentType of the proxy model. """ Permission = apps.get_model('auth', 'Permission') Conten...
acc11bbffd1544a0954f3ad640ce30fb87ff43554dfadcd9e4da067120258ee3
from collections import OrderedDict from datetime import datetime, timedelta from django.conf import settings from django.contrib.admin import FieldListFilter from django.contrib.admin.exceptions import ( DisallowedModelAdminLookup, DisallowedModelAdminToField, ) from django.contrib.admin.options import ( IS_P...
f5bb37112d769adfb6bd9bee47552f7d885af10d7425696958ca6e84193a00db
import datetime from django.contrib.admin.templatetags.admin_urls import add_preserved_filters from django.contrib.admin.utils import ( display_for_field, display_for_value, label_for_field, lookup_field, ) from django.contrib.admin.views.main import ( ALL_VAR, ORDER_VAR, PAGE_VAR, SEARCH_VAR, ) from django.co...
8d66849842d229a541912c58322935f6c83964198f76f472fb5f71f2cd29dba2
import re from datetime import date, datetime from decimal import Decimal from django import template from django.conf import settings from django.template import defaultfilters from django.utils.formats import number_format from django.utils.safestring import mark_safe from django.utils.timezone import is_aware, utc ...
b102a697f1e25340393c6da81ca8f79b63e55eff36bc74389799718340252abd
import os from collections import OrderedDict from django.apps import apps from django.contrib.staticfiles.finders import get_finders from django.contrib.staticfiles.storage import staticfiles_storage from django.core.files.storage import FileSystemStorage from django.core.management.base import BaseCommand, CommandEr...
ac3a6a3b0805b12efd1061382f74e5281584d1eed36dd1d2efbc1c2e843e264c
import datetime import logging import os import shutil import tempfile from django.conf import settings from django.contrib.sessions.backends.base import ( VALID_KEY_CHARS, CreateError, SessionBase, UpdateError, ) from django.contrib.sessions.exceptions import InvalidSessionKey from django.core.exceptions import I...
da3886201fd25d8033fb5ba4f7d1483d47f8a0d803c885a6d59429dc5586c3cf
import base64 import logging import string from datetime import datetime, timedelta from django.conf import settings from django.contrib.sessions.exceptions import SuspiciousSession from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.crypto import ( constant_t...
9aea9cbceeb0208ec0e33f7c7de8b195968eb954c250d42c16121249bdf3f595
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
77e5e6a75d6ce419ef25a42435ee4faa9537c231ed31fe203331f1c87fb0ce78
# 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...
fdb7b39a5dcbcd91dd55edb55e9f0d0249fa30010a8e6aa16e2413948390ab81
""" 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...
6f5146e1d860d6d261113ba5736c24e75ecb69788dde729e205c90addd7eeef0
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see https://www.gdal.org/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" unli...
b69871d6c28ca9867e4ab0e267ad8ab4526984cabdddfbc1e552036f47327dfb
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as capi from django.utils.encoding import force_text # For more information, see the OG...
0f875ec1c2c4fe48c494ada05e67d438203598993e25b61da2e854399bc06324
from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.field import Field from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api from django.utils....
51f8e9f47e01b8e156fbb00a4af7c64928b5b1232e2cc6a9ed7b0952d798754b
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
871e0d44276e28c2455c5d06b727d130f50d2c08e820356a7bfe4cda7bf367b5
from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi from django.utils.encoding import force_bytes, force_text class Driver(GDALBase): """ Wrap a GDAL/O...
3b2e08591c2ea7f5cd64c2ba77cce987c63c155123ebe78456e5890b123e8b37
from ctypes import byref, c_double from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope from django.contrib.gis.gdal.error import GDALException, SRSException from django.contrib.gis.gdal.feature import Feature from django.contrib.gis.gdal.field import OGR...
4b0a44f196b9f888b96b05ffa9e7b058d66a2b342a8f01255ebf0e87f23e45b4
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ import re from ctypes import addressof, byref, c_double from django.contrib.gis import gdal from django.contrib.gis.geometry import hex_regex, json_regex, wkt_regex from django.contrib.gis.geos import prototy...