hash
stringlengths
64
64
content
stringlengths
0
1.51M
cff77fcba778e9e2f5e29dd63da171cc1db37c5fd824d175578485eb5d951491
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'g.i.A' # DATETIME_FORMAT = YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j F' ...
164440b871c6be17824cee54f86e4367cbea085da943a019d9ca4a90533c7cc3
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT ...
f8ec538474005b0095adf54b0c092cb424147da007a5b26144f425a993bfc06a
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' # DATETIME_FORMAT = YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j. F' ...
d4eeb7bcc0efe4c1bdba6e00bcc444280a2a94e6720b8e96304586f6af0f312f
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F, Y' TIME_FORMAT = 'g:i A' # DATETIME_FORMAT = YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j F'...
acf58889b3e0f1bf30ecdc01cbbae885b14415cc533eb92b4a3bff30fd826016
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = 'G:i' DATETIME_FORMAT = r'j \d\e F \d\e Y \a \l\e\s G:i' YEAR_MONTH_...
58aa7c177222212ae0c5722d4a9201d5cd1af31158f02b04cea5cc41161bb0f4
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' # '25 Hydref 2006' TIME_FORMAT = 'P' # '2:30 y.b.' DA...
3bce2cc044e6bd5df2c4089f465e624c00f283e8af639adc5efb50cf6078aeb2
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'Y年n月j日G:i' YEAR_MONTH_FORMAT = 'Y年n月' MONTH_DAY_FORMA...
bb04a9aa6185e8fcb2ddc9d8120c8d1f99bab6da17342fe9a1fa5b8eaa003bf2
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j N Y' DATETIME_FORMAT = "j N Y, G.i" TIME_FORMAT = 'G.i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT...
4e755233a89478032ac9f0cd2e78c62b0062ce2540ee0c2fa241119b9e3d673c
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j M Y' # '25 Oct 2006' TIME_FORMAT = 'P' # '2:30 p.m.' DATET...
d1617f2126d848dd0db4fb8e935b05b1821308f6f7206da311a0315525cb6aa5
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd/m/Y' TIME_FORMAT = 'P' DATETIME_FORMAT = 'd/m/Y P' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j...
64b98a58580ac2b1de0de4cee9f3f244b8e0c645374022b77f42f19d884bbea8
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y \m. E j \d.' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'Y \m. E j \d., H:i' YEAR_MONTH_FORMAT = r'Y ...
998296ba691f1849460cbf761b49cefe5a01a1238e14ab3492db08dfefa794b4
# This file is distributed under the same license as the Django package. # DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'j \d\e F \d\e Y \a \l\a\s H:i' YEAR_MONTH_FORMAT = r'F \d\e Y' MONTH_DAY_FORMAT = r'j \d\e F' SHORT_DATE_FORMAT = 'd/m/Y' SHORT_DATETIME_FORMAT = 'd/m/Y H:i' FIRST_DAY_OF_W...
cbb5d63e1b8ebfb4240c1bf1e2a9307a19aa469ab02f39fbe455a7fb6e66bdc7
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMA...
fb01e9f871546ad9931201a243b7a408c14c07c8e90100f8502e269a18d14cbf
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date # DATE_FORMAT = # TIME_FORMAT = # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = # MONTH_DAY_FORMAT = # SHORT_DATE_FORMAT ...
be11c5378964cce4004515e182de6cf0cec84d32d930c2d5c1b8dbcbe63f5049
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j N Y' TIME_FORMAT = r'H:i' DATETIME_FORMAT = r'j N Y H:i' YEAR_MONTH_FORMAT = r'F Y' MONTH_DAY_FOR...
c64b3fe138d84d21b2cfd70861a13c38cdf06ee78fde8a0cd904eca8d3ce305f
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'j \d\e F \d\e Y \a \l\a\s H:i' YEAR_MONTH_...
acd781329bfaa7e7894b3759bd3c86b830c3226df163b14ab04a5ec85674e69d
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a de julio 1887' TIME_FORMAT = 'H:i' # '18:59' DA...
b656da110f7de0fe818fe5258976a0316e18bb50ff9de1aca4339a40b2f91e55
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'j. E Y G:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMA...
558430e49a452b818a381f4b85571448ba6b53bffae903f5241bb65d6b2ce0bd
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y.' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. E Y. H:i' YEAR_MONTH_FORMAT = 'F Y.' MONTH_DAY_FO...
f0a09256d9373785acae5c7a8460e3f0f6d557ab18b218257f22eda426c5af14
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'\N\gà\y d \t\há\n\g n \nă\m Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'H:i \N\gà\y d \t\há\n\g n \n...
40c7c7a0459ca51ffcc8b684ebac3952398f8ed813014ed8962f091e04b11912
# This file is distributed under the same license as the Django package. # DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'j \d\e F \d\e Y \a \l\a\s H:i' YEAR_MONTH_FORMAT = r'F \d\e Y' MONTH_DAY_FORMAT = r'j \d\e F' SHORT_DATE_FORMAT = 'd/m/Y' SHORT_DATETIME_FORMAT = 'd/m/Y H:i' FIRST_DAY_OF_W...
8ae05a8f2e9b805fb65748f9c598eff7cdf64e82e750cc91bf35432b8bea3bbe
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. N Y.' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'j. N. Y. G:i T' YEAR_MONTH_FORMAT = 'F Y.' MONTH_DAY...
8322cea64eeed5eecb341a100c72ece24230d38cbbbe61a81bdbf56aaecd8e61
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F, Y' TIME_FORMAT = 'g:i A' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j F' SHO...
0c9545a9ba96eddaba18fce1fcc49142f40089c06d554c111d7f1148b82aa458
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT...
a352ba7dbf00c09e621ea4b15a2ac7fea2e1169e78bd1990d1c5037844091598
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j F' SHORT_...
97f9744df438a57182dc79a18732b261a812ea2f4225368e71466f4f8cd4e0f6
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j E Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT ...
d95d29612cd7aafd5c6e46000109e4ff727c7729e85f42e66ba27a3376cb9c18
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'G:i' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j. F' SHOR...
2bd25b909b97766afccf528000206f0f16bc98824843cf837c72e5be391f9b7f
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j F' SHORT_...
6b5df734fc3baf2d96606b3b6f75fb3c6042f861d4b4dd92e737232e9f424c9c
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'g:i A' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j F' SHOR...
92f4ec29268aee80d62ba6be49e3b75777bfffae128ed0c1316a2ad28b950c9e
# This file is distributed under the same license as the Django package. # DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'j \d\e F \d\e Y \a \l\a\s H:i' YEAR_MONTH_FORMAT = r'F \d\e Y' MONTH_DAY_FORMAT = r'j \d\e F' SHORT_DATE_FORMAT = 'd/m/Y' SHORT_DATETIME_FORMAT = 'd/m/Y H:i' FIRST_DAY_OF_W...
e7ee47b78d26824d1ca2f620368a99362d325f595d8c2e55206b192dbe8217d1
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y년 n월 j일' TIME_FORMAT = 'A g:i' DATETIME_FORMAT = 'Y년 n월 j일 g:i A' YEAR_MONTH_FORMAT = 'Y년 n월' MONTH...
4b704ad856ce75975452c3e9f081cc6f81a90e6fdcb48204d73e195f72fb1752
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT ...
4c23f4ac2692eef1658527ce2176da07143a2de25f3ac492a4dc2e7ddec56548
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'j F Y, G:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT...
438dbe5d9e5a5ad7e82a12ae7f4ef5e3c22bebe52b8da58d35e03c7ab06d9421
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y. \g\a\d\a j. F' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'Y. \g\a\d\a j. F, H:i' YEAR_MONTH_FORMAT ...
61068bf18dc7d0038fbc9cf1c220d7c2daab6d8d04c87346b5f32ee011a16b46
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMA...
cb43b91780b7d708093173dd56b42f36a60a572afcf99d617f9a3437d3f78bb3
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'g:i A' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j F' SHOR...
c47d76ebdf6237fd5207f49e0482dc3193534b9d4fa95cd998d7e84ceffd2b90
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y г.' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'j E Y г. G:i' YEAR_MONTH_FORMAT = 'F Y г.' MONTH_DA...
c36e892478a571c0130c9ade9f4dc4c0e52836f3d0b46438a8734f6ae52a1ca9
"""Translation helper functions.""" import functools import gettext as gettext_module import os import re import sys import warnings from collections import OrderedDict from threading import local from django.apps import apps from django.conf import settings from django.conf.locale import LANG_INFO from django.core.ex...
11a1be74fadbd1b4240c9cfee435f9d8bc98fb0793d95c7295a8ad5ba6d486d9
""" Internationalization support. """ import re from contextlib import ContextDecorator from django.utils.functional import lazy __all__ = [ 'activate', 'deactivate', 'override', 'deactivate_all', 'get_language', 'get_language_from_request', 'get_language_info', 'get_language_bidi', 'check_for_languag...
601e05fbe6d88d3660a3b305621105c57408c4b9591c4b46775eb15b00d58add
import re import warnings from io import StringIO from django.template.base import TRANSLATOR_COMMENT_MARK, Lexer, TokenType from . import TranslatorCommentWarning, trim_whitespace dot_re = re.compile(r'\S') def blankout(src, char): """ Change every non-whitespace character to the given char. Used in t...
ca9f366c7b79a2aa8bf796793c5a1809978434eba5c73a7e22a326916cf497d6
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings def gettext(message): return message gettext_noop =...
c376bce04017597d76c3b1750b2c4843f945893c31152ef17f7ac211c9d4ab27
""" Wrapper for loading templates from "templates" directories in INSTALLED_APPS packages. """ from django.template.utils import get_app_template_dirs from .filesystem import Loader as FilesystemLoader class Loader(FilesystemLoader): def get_dirs(self): return get_app_template_dirs('templates')
92f8e637e507c5d77a3f08247b1c3b2072f461e2508175dbbb3fed763e5c88a7
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...
3964e723059b563f9377956b3a42b0d46ffaa48bb3d559e1e4279d64de609725
""" Wrapper for loading templates from the filesystem. """ from django.core.exceptions import SuspiciousFileOperation from django.template import Origin, TemplateDoesNotExist from django.utils._os import safe_join from .base import Loader as BaseLoader class Loader(BaseLoader): def __init__(self, engine, dirs=...
b5b91211a30ec97f58b36f68a53a48f16ba2e7d6de3b6e4524e1c79b630fe95a
""" Wrapper class that takes a list of template loaders as an argument and attempts to load templates from them in order, caching the result. """ import hashlib from django.template import TemplateDoesNotExist from django.template.backends.django import copy_exception from .base import Loader as BaseLoader class L...
f1c05823cc0f38e9c8c7fdefedf0b98decc0ffaa492ea82a39b78bc075d024aa
""" Wrapper for loading templates from a plain Python dict. """ from django.template import Origin, TemplateDoesNotExist from .base import Loader as BaseLoader class Loader(BaseLoader): def __init__(self, engine, templates_dict): self.templates_dict = templates_dict super().__init__(engine) ...
3fc76f3a6429a49f18319e7f5f2389183ceca5b40c34657cd86c4be48c2b3053
from django.core.exceptions import ( ImproperlyConfigured, SuspiciousFileOperation, ) from django.template.utils import get_app_template_dirs from django.utils._os import safe_join from django.utils.functional import cached_property class BaseEngine: # Core methods: engines have to provide their own implemen...
e48c71d3ca227e78e9205a1dd6df4844927f4be5021a4ffe087ea84ee219a971
from django.middleware.csrf import get_token from django.utils.functional import lazy from django.utils.html import format_html from django.utils.safestring import SafeText def csrf_input(request): return format_html( '<input type="hidden" name="csrfmiddlewaretoken" value="{}">', get_token(request...
365df5dd2c57d6bc44d45fb90070a58e07a3ad8a580b1f905c9a4d5244165d1e
import string from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template import Origin, TemplateDoesNotExist from django.utils.html import conditional_escape from .base import BaseEngine from .utils import csrf_input_lazy, csrf_token_lazy class TemplateStrings(Base...
6f1f03700d8faaacc399c81e818d75a66e448660ff8164d32dab86a3dd6298be
import jinja2 from django.conf import settings from django.template import TemplateDoesNotExist, TemplateSyntaxError from django.utils.functional import cached_property from django.utils.module_loading import import_string from .base import BaseEngine class Jinja2(BaseEngine): app_dirname = 'jinja2' def _...
ff0df9d2d98700c48b3b0f9bda8f6b4745a7e985f740c9291e4929bdba3f1302
from importlib import import_module from pkgutil import walk_packages from django.apps import apps from django.conf import settings from django.template import TemplateDoesNotExist from django.template.context import make_context from django.template.engine import Engine from django.template.library import InvalidTemp...
29f1569a594d5b478a225a827ec10dba93c13c71d7b1c61b2448bcdbb9f14642
from django.apps.registry import apps as global_apps from django.db import migrations, router from .exceptions import InvalidMigrationPlan from .loader import MigrationLoader from .recorder import MigrationRecorder from .state import ProjectState class MigrationExecutor: """ End-to-end migration execution - ...
84c3dd431dafa79216b149e003dc6b1a25d082aaa3335d4f9d007f98af71a48d
def topological_sort_as_sets(dependency_graph): """ Variation of Kahn's algorithm (1962) that returns sets. Take a dependency graph as a dictionary of node => dependencies. Yield sets of items in topological order, where the first set contains all nodes without dependencies, and each following set...
188ad83a71af46255fba40143b4094e233120df4086e22b2f6f2f4d259a6ce18
import copy from collections import OrderedDict from contextlib import contextmanager from django.apps import AppConfig from django.apps.registry import Apps, apps as global_apps from django.conf import settings from django.db import models from django.db.models.fields.proxy import OrderWrt from django.db.models.field...
39ae11bdf11aea12130aa75cab05d80bae9892714aca5baecbbbed35b49cf8be
from .migration import Migration, swappable_dependency # NOQA from .operations import * # NOQA
bc0f168ebc6d702edac3f1217d2abe7c542b1dfd7461fc321b2b22c8019740bf
import pkgutil import sys from importlib import import_module, reload from django.apps import apps from django.conf import settings from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationRecorder from .exceptions import ( AmbiguityError, BadMigrationError, Inconsi...
71f6baabd59546c4e6c08b9c363abc5b631bbd203e08d0a17a7637bc589ee318
from django.db.utils import DatabaseError class AmbiguityError(Exception): """More than one migration matches a name prefix.""" pass class BadMigrationError(Exception): """There's a bad migration (unreadable/bad format/etc.).""" pass class CircularDependencyError(Exception): """There's an impo...
6c08a35516d0b29fa2c4ce835905757cda0a4830b9b9dc269dd016384db958de
import os import re from importlib import import_module from django import get_version from django.apps import apps from django.db import migrations from django.db.migrations.loader import MigrationLoader from django.db.migrations.serializer import serializer_factory from django.utils.inspect import get_func_args from...
ecbe9f72fd272af3071917d12d2fcaf17182b31b5d3df03ac10c91990df4f960
import importlib import os import sys from django.apps import apps from django.db.models.fields import NOT_PROVIDED from django.utils import datetime_safe, timezone from .loader import MigrationLoader class MigrationQuestioner: """ Give the autodetector responses to questions it might have. This base cl...
b3bb1756579ae81880800156c68ad51d34a86241171658c3f00c8a452c5c4168
import warnings from functools import total_ordering from django.db.migrations.state import ProjectState from django.utils.datastructures import OrderedSet from .exceptions import CircularDependencyError, NodeNotFoundError RECURSION_DEPTH_WARNING = ( "Maximum recursion depth exceeded while generating migration g...
6d88c943648cbe824b4f8c005d301f4e0a0c491757110c145f7613337de4178f
import functools import re from itertools import chain from django.conf import settings from django.db import models from django.db.migrations import operations from django.db.migrations.migration import Migration from django.db.migrations.operations.models import AlterModelOptions from django.db.migrations.optimizer ...
a8af5f6945ea4693eb67cbe743cb776de04b547cea5f9420172a1b89635192a2
from django.db.transaction import atomic from .exceptions import IrreversibleError class Migration: """ The base class for all migrations. Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the following a...
02920856136b9e767bf72ceb6cf791105b24e64c4b0ae39dd6bc21ddd0da34b2
import datetime import re COMPILED_REGEX_TYPE = type(re.compile('')) class RegexObject: def __init__(self, obj): self.pattern = obj.pattern self.flags = obj.flags def __eq__(self, other): return self.pattern == other.pattern and self.flags == other.flags def get_migration_name_time...
615f550762165fd9f841fdc4b99cabcaed8e1c6232dacc9a729696e0b364b487
from django.apps.registry import Apps from django.db import models from django.db.utils import DatabaseError from django.utils.timezone import now from .exceptions import MigrationSchemaMissing class MigrationRecorder: """ Deal with storing migration records in the database. Because this table is actual...
73676dd2de0039528b382618599266f42d08b5e5734e40fc0fbaf62e1e00f221
class MigrationOptimizer: """ Power the optimization process, where you provide a list of Operations and you are returned a list of equal or shorter length - operations are merged into one if possible. For example, a CreateModel and an AddField can be optimized into a new CreateModel, and Creat...
23b1bd61f275c393f5d450c8361b0297dde6ee7bc0de49fcd63d22ce600d5d65
import builtins import collections.abc import datetime import decimal import enum import functools import math import re import types import uuid from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.utils import COMPILED_REGEX_TYPE, RegexObject from django.u...
ec7a80c7171e11887d8949c980756f9eea8dee575f1a81dc8c36c667ee9d6473
""" 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 DecimalField, FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDe...
1107ab1c514d452a1a54ac86f6e92c1507430ffcc9d9149d9400d0554b781a65
import hashlib from django.db.backends.utils import split_identifier from django.utils.encoding import force_bytes __all__ = ['Index'] class Index: suffix = 'idx' # The max length of the name of the index (restricted to 30 for # cross-database compatibility with Oracle) max_name_length = 30 def...
fdd98af2eedfb4bd2e3584cae7c4f45b74826bd83c21c0d25aa6f0e30f8175be
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import operator import warnings from collections import OrderedDict, namedtuple from functools import lru_cache from itertools import chain from django.conf import settings from django.core import exceptions from django.db...
10186fa0e20b4ea3e8fb0817084ac119b684bd3040bdc628349d6425005ad4dd
from django.core.exceptions import ObjectDoesNotExist from django.db.models import signals from django.db.models.aggregates import * # NOQA from django.db.models.aggregates import __all__ as aggregates_all from django.db.models.deletion import ( CASCADE, DO_NOTHING, PROTECT, SET, SET_DEFAULT, SET_NULL, ProtectedEr...
261a63592f3362ec2f81df6b5e1ddf726f4de51334688e3c1d90680593287d09
import copy import inspect from bisect import bisect from collections import OrderedDict, defaultdict from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured from django.db import connections from django.db.models import Manager from djan...
7171b497a5672bd1de85efdc3054ded701ac03e826850b3bc21582d9d9832f4d
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, ...
5027933bd3788d7b98fc16f20f145d78344e5b6cb48314834a36776dbfaad666
import copy import inspect from importlib import import_module from django.db import router from django.db.models.query import QuerySet class BaseManager: # To retain order, track each time a Manager instance is created. creation_counter = 0 # Set to True for the 'objects' managers that are automaticall...
d6643fccf5691e578efc115d114ef5e1ad3d34cbd2991eb9f93dcfdf58613049
def make_model_tuple(model): """ Take a model or a string of the form "app_label.ModelName" and return a corresponding ("app_label", "modelname") tuple. If a tuple is passed in, assume it's a valid model tuple already and return it unchanged. """ try: if isinstance(model, tuple): ...
29624262e3055ab64fb0b0cf88cd937e4cc2fc7abc81b1185a4bf0faa5c003dc
from functools import partial from django.db.models.utils import make_model_tuple from django.dispatch import Signal class_prepared = Signal(providing_args=["class"]) class ModelSignal(Signal): """ Signal subclass that allows the sender to be lazily specified as a string of the `app_label.ModelName` for...
9a82f4df251e655b5c4edbda5042ba6d734782cda7ed8aa39ed5eef94c6de8da
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ import copy import functools import inspect from collections import namedtu...
06cb452eb1bfaca0472fe219ee2a9763db9228b2fa20e28e8e179705eb426a7d
""" Constants used across the ORM in general. """ # Separator used to split filter strings apart. LOOKUP_SEP = '__'
a57a167eebc765bb4f0579f0da94c98a0b716ae2ff2ba751012074301f770c34
import copy import datetime from decimal import Decimal from django.core.exceptions import EmptyResultSet, FieldError from django.db import connection from django.db.models import fields from django.db.models.query_utils import Q from django.utils.deconstruct import deconstructible from django.utils.functional import ...
ad0b79910fdfc44f525056504c33f2449e92d11f7e40fbc28e16695cdd6169ff
from collections import Counter, OrderedDict 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_object...
d7ab4e4bbdbf1bb6a64d3e767f9cc32319e56e5aabbb12cc279d16a8053b6137
import itertools import math from copy import copy from django.core.exceptions import EmptyResultSet from django.db.models.expressions import Func, Value from django.db.models.fields import DateTimeField, Field, IntegerField from django.db.models.query_utils import RegisterLookupMixin from django.utils.datastructures ...
74183ac52369c87dd874722777969f028ea853f512a6ff36f259eb83bf2d9ae8
""" Helpers to manipulate deferred DDL statements that might need to be adjusted or discarded within when executing a migration. """ class Reference: """Base class that defines the reference interface.""" def references_table(self, table): """ Return whether or not this instance references th...
db3d1c55a230406975b637f63b9d0da1062e83613ce81273d575ac89da6a625c
import datetime import decimal import functools import hashlib import logging from time import time from django.conf import settings from django.db.utils import NotSupportedError from django.utils.encoding import force_bytes from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') clas...
ac0141e5b51d9e4e63724213e0fc15c04b84e9a8f875bb5ab111dc4672321fa6
from django.dispatch import Signal connection_created = Signal(providing_args=["connection"])
02c264e19d46ebe84b2515a4c8e2e93f7940a719f83a63f8875caa3eb9d495f5
from .fields import AddField, AlterField, RemoveField, RenameField from .models import ( AddIndex, AlterIndexTogether, AlterModelManagers, AlterModelOptions, AlterModelTable, AlterOrderWithRespectTo, AlterUniqueTogether, CreateModel, DeleteModel, RemoveIndex, RenameModel, ) from .special import RunPython, R...
394b4bd2d63b46eb4db541ce9aa4a8259128448de320a49106e5cf9360a9ee2e
from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils.functional import cached_property from .fields import ( AddField, AlterField, FieldOperation, RemoveFie...
93ff239da56957209e6cec53c96216e507dd3024b54db77bb7d9adb330c26404
from django.db import router from django.db.models.fields.related import RECURSIVE_RELATIONSHIP_CONSTANT class Operation: """ Base class for migration operations. It's responsible for both mutating the in-memory model state (see db/migrations/state.py) to represent what it performs, as well as ac...
eaf3b645181a50f9f11236e44d7dd0c0037e2da69d6451d8a451e8b8068c9a28
from django.db import router from .base import Operation class SeparateDatabaseAndState(Operation): """ Take two lists of operations - ones that will be used for the database, and ones that will be used for the state change. This allows operations that don't support state change to have it applied, o...
3a55122631c7186cd0c393f79bd2846474c6399a5231b9143829a07f7a301288
from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import NOT_PROVIDED from django.utils.functional import cached_property from .base import Operation from .utils import is_referenced_by_foreign_key class FieldOperation(Operation): def __init__(self, model_name, name): self...
135a40c70a2eb7335ed130d9053686c23b6eee9d959add78b0589d2e5feadce2
def is_referenced_by_foreign_key(state, model_name_lower, field, field_name): for state_app_label, state_model in state.models: for _, f in state.models[state_app_label, state_model].fields: if (f.related_model and '%s.%s' % (state_app_label, model_name_lower) == f.related_mo...
f93f6b21ae1a3a0cb7532f10d109138fc369bb1d04f0fe1949501ff63b0c7fa2
from django.db.models.lookups import ( Exact, GreaterThan, GreaterThanOrEqual, In, IsNull, LessThan, LessThanOrEqual, ) class MultiColSource: contains_aggregate = False def __init__(self, alias, targets, sources, field): self.targets, self.sources, self.field, self.alias = targets, sources, f...
7dc276775662634b04a2e4aaf5257b5b57e6e5e1370bf9cc1a4cb731adf8edd9
""" Field-like classes that aren't really fields. It's easier to use objects that have the same attributes as fields sometimes (avoids a lot of special casing). """ from django.db.models import fields class OrderWrt(fields.IntegerField): """ A proxy for the _order database field that is used when Meta.or...
0cb17b964dde645db0b03c241695e12c452e28485769f5117f6efba86b14935f
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...
dc2cd68f50682ff95a02b8ec0ef56c8ecad9c385c8dae8469a4e7c5b7b2647a1
import functools import inspect from functools import partial from django import forms from django.apps import apps from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models import Q from django.db.models.constants import LOOKUP_SEP f...
a1192012ab6fc5065ad066e0a5a289b9af3744acc798d592764276ee8265694d
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...
e4292ae1dd5c64e0c77d588b19c532b89c2f54fc95f8a7ddd9a649cd8e1c9317
NOT_PROVIDED = object() class FieldCacheMixin: """Provide an API for working with the model's fields value cache.""" def get_cache_name(self): raise NotImplementedError def get_cached_value(self, instance, default=NOT_PROVIDED): cache_name = self.get_cache_name() try: ...
eac9db43e58707e0c6cf57df48c859129bff17688f6ec306c9a0bc607235e72e
""" Accessors for related objects. When a field defines a relation between two models, each model class provides an attribute to access related instances of the other model class (unless the reverse accessor has been disabled with related_name='+'). Accessors are implemented as descriptors in order to customize acces...
8fe60ecace3aa2a3fb4fef317e3cf7ff915c39647f84c041a76c60f317c5992b
""" "Rel objects" for related fields. "Rel objects" (for lack of a better name) carry information about the relation modeled by a related field and provide some utility functions. They're stored in the ``remote_field`` attribute of the field. They also act as reverse fields for the purposes of the Meta API because th...
ca9660f94d3e4447017324422a8abb8269ab3903bbf5d7828da17d3cf276032e
from django.db.models import Func, IntegerField, Transform, Value, fields from django.db.models.functions import Coalesce class BytesToCharFieldConversionMixin: """ Convert CharField results from bytes to str. MySQL returns long data types (bytes) instead of chars when it can't determine the length o...
0b0036a1f55b300c581ecd644f8a65ec10c81888304426ab212f069ec86ed5b0
"""Database functions that do comparisons or type conversions.""" from django.db.models import Func class Cast(Func): """Coerce an expression to a new field type.""" function = 'CAST' template = '%(function)s(%(expressions)s AS %(db_type)s)' def __init__(self, expression, output_field): super...
eeb564bfe603c9c2ebae66aebb0303f2e80f1ad8e61bdcb704fda8366fde35a4
from .comparison import Cast, Coalesce, Greatest, Least from .datetime import ( Extract, ExtractDay, ExtractHour, ExtractMinute, ExtractMonth, ExtractQuarter, ExtractSecond, ExtractWeek, ExtractWeekDay, ExtractYear, Now, Trunc, TruncDate, TruncDay, TruncHour, TruncMinute, TruncMonth, TruncQuarter, Trunc...