--- /srv/reproducible-results/rbuild-debian/r-b-build.n7ohgxJF/b1/python-django_4.2.13-1_armhf.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.n7ohgxJF/b2/python-django_4.2.13-1_armhf.changes ├── Files │ @@ -1,3 +1,3 @@ │ │ - 8dc1b4d051e8b4b0bd4b90483255cd33 3587324 doc optional python-django-doc_4.2.13-1_all.deb │ + 4edee6c5d0d19493bc7d53edc22509f3 3640040 doc optional python-django-doc_4.2.13-1_all.deb │ da186b549713ea45f0f57e1904c77528 2735992 python optional python3-django_4.2.13-1_all.deb ├── python-django-doc_4.2.13-1_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2024-05-08 10:28:44.000000 debian-binary │ │ --rw-r--r-- 0 0 0 19140 2024-05-08 10:28:44.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 3567992 2024-05-08 10:28:44.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 19284 2024-05-08 10:28:44.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 3620564 2024-05-08 10:28:44.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── file list │ │ │ │ @@ -1,3 +1,3 @@ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 976 2024-05-08 10:28:44.000000 ./control │ │ │ │ --rw-r--r-- 0 root (0) root (0) 78115 2024-05-08 10:28:44.000000 ./md5sums │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 78499 2024-05-08 10:28:44.000000 ./md5sums │ │ │ ├── ./control │ │ │ │ @@ -1,13 +1,13 @@ │ │ │ │ Package: python-django-doc │ │ │ │ Source: python-django │ │ │ │ Version: 3:4.2.13-1 │ │ │ │ Architecture: all │ │ │ │ Maintainer: Debian Python Team │ │ │ │ -Installed-Size: 33708 │ │ │ │ +Installed-Size: 34052 │ │ │ │ Depends: libjs-sphinxdoc (>= 7.2.2) │ │ │ │ Section: doc │ │ │ │ Priority: optional │ │ │ │ Homepage: http://www.djangoproject.com/ │ │ │ │ Description: High-level Python web development framework (documentation) │ │ │ │ Django is a high-level web application framework that loosely follows the │ │ │ │ model-view-controller design pattern. │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ │ │ │ ├── line order │ │ │ │ │ @@ -177,14 +177,15 @@ │ │ │ │ │ usr/share/doc/python-django-doc/html/_modules/django/views/decorators/csrf.html │ │ │ │ │ usr/share/doc/python-django-doc/html/_modules/django/views/decorators/debug.html │ │ │ │ │ usr/share/doc/python-django-doc/html/_modules/django/views/decorators/http.html │ │ │ │ │ usr/share/doc/python-django-doc/html/_modules/django/views/decorators/vary.html │ │ │ │ │ usr/share/doc/python-django-doc/html/_modules/django/views/generic/dates.html │ │ │ │ │ usr/share/doc/python-django-doc/html/_modules/django/views/i18n.html │ │ │ │ │ usr/share/doc/python-django-doc/html/_modules/index.html │ │ │ │ │ +usr/share/doc/python-django-doc/html/_static/base-stemmer.js │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/basic.css │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/console-tabs.css │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/default.css │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/djangodocs.css │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/docicons-behindscenes.png │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/docicons-note.png │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/docicons-philosophy.png │ │ │ │ │ @@ -195,18 +196,21 @@ │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/fontawesome/css/fa-brands.min.css │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.eot.gz │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.svg │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.ttf.gz │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.woff │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.woff2 │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/homepage.css │ │ │ │ │ +usr/share/doc/python-django-doc/html/_static/italian-stemmer.js │ │ │ │ │ +usr/share/doc/python-django-doc/html/_static/language_data.js │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/minus.png │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/plus.png │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/pygments.css │ │ │ │ │ usr/share/doc/python-django-doc/html/_static/reset-fonts-grids.css │ │ │ │ │ +usr/share/doc/python-django-doc/html/_static/translations.js │ │ │ │ │ usr/share/doc/python-django-doc/html/contents.html │ │ │ │ │ usr/share/doc/python-django-doc/html/faq/admin.html │ │ │ │ │ usr/share/doc/python-django-doc/html/faq/contributing.html │ │ │ │ │ usr/share/doc/python-django-doc/html/faq/general.html │ │ │ │ │ usr/share/doc/python-django-doc/html/faq/help.html │ │ │ │ │ usr/share/doc/python-django-doc/html/faq/index.html │ │ │ │ │ usr/share/doc/python-django-doc/html/faq/install.html │ │ ├── xz --list │ │ │ @@ -1,13 +1,13 @@ │ │ │ Streams: 1 │ │ │ Blocks: 1 │ │ │ - Compressed size: 18.7 KiB (19140 B) │ │ │ - Uncompressed size: 80.0 KiB (81920 B) │ │ │ - Ratio: 0.234 │ │ │ + Compressed size: 18.8 KiB (19284 B) │ │ │ + Uncompressed size: 90.0 KiB (92160 B) │ │ │ + Ratio: 0.209 │ │ │ Check: CRC64 │ │ │ Stream Padding: 0 B │ │ │ Streams: │ │ │ Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding │ │ │ - 1 1 0 0 19140 81920 0.234 CRC64 0 │ │ │ + 1 1 0 0 19284 92160 0.209 CRC64 0 │ │ │ Blocks: │ │ │ Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check │ │ │ - 1 1 12 0 19104 81920 0.233 CRC64 │ │ │ + 1 1 12 0 19248 92160 0.209 CRC64 │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -29,220 +29,221 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 40590 2024-05-07 17:11:00.000000 ./usr/share/doc/python-django-doc/html/_images/list_filter.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 12685 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_images/postmortem.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2017 2024-02-15 11:17:02.000000 ./usr/share/doc/python-django-doc/html/_images/raw_id_fields.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 15461 2024-02-15 11:17:02.000000 ./usr/share/doc/python-django-doc/html/_images/template-lines.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 20673 2024-02-15 11:17:02.000000 ./usr/share/doc/python-django-doc/html/_images/triage_process.svg │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/asgiref/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 78372 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/asgiref/sync.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 78472 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/asgiref/sync.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/apps/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 39797 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/apps/config.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 39910 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/apps/config.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/conf/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/conf/urls/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8589 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/conf/urls/i18n.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8690 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/conf/urls/i18n.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15259 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/decorators.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 381076 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/options.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 86838 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/sites.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15370 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/decorators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 381347 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/options.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 86974 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/sites.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/views/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6624 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/views/decorators.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8377 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6728 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/views/decorators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8475 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12324 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/context_processors.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14286 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/decorators.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 123477 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/hashers.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37585 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/password_validation.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34801 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12425 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/context_processors.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14397 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/decorators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 123588 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/hashers.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 37721 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/password_validation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34924 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/flatpages/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6525 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/flatpages/sitemaps.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6626 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/flatpages/sitemaps.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18288 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/aggregates.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 57676 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/fields.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 96017 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/functions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27145 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/feeds.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18415 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/aggregates.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 57823 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 96299 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/functions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27261 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/feeds.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/forms/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22499 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/forms/fields.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23407 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/forms/widgets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22638 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/forms/fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23521 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/forms/widgets.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19064 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/datasource.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15770 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/driver.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34270 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/envelope.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11449 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/error.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 98882 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/geometries.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17132 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/geomtype.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19168 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/datasource.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15879 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/driver.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34379 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/envelope.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11558 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/error.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 99071 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/geometries.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17236 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/geomtype.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/raster/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 76059 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/raster/source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 53692 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/srs.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 76176 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/raster/source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 53871 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/srs.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18764 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/collections.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4726 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/error.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8447 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/factory.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 100325 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/geometry.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7355 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/io.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29199 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/linestring.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 25810 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/point.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29230 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/polygon.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18883 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/collections.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4830 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/error.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8556 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/factory.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 100429 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/geometry.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7464 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/io.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29308 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/linestring.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 25914 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/point.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29339 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/polygon.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/prototypes/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 51286 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/prototypes/io.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 55457 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/measure.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 51413 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/prototypes/io.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 55563 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/measure.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/utils/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 95675 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/utils/layermapping.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 32846 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/utils/ogrinspect.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 95784 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/utils/layermapping.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 32955 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/utils/ogrinspect.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/messages/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16946 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/messages/api.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7422 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/messages/middleware.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17052 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/messages/api.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7523 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/messages/middleware.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 46709 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/constraints.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5628 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/functions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 44306 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/indexes.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 60681 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/search.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16258 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/validators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 46810 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/constraints.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5734 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/functions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 44442 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/indexes.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 60832 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/search.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16369 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/validators.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sessions/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5569 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sessions/exceptions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15663 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sessions/middleware.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41502 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sitemaps.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5670 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sessions/exceptions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15764 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sessions/middleware.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41630 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sitemaps.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sites/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5502 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sites/middleware.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5603 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sites/middleware.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/checks/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18040 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/checks/messages.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 31142 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/exceptions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18166 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/checks/messages.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31315 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/exceptions.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26903 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/base.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13393 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/images.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27034 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/base.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13494 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/images.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29608 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/base.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35466 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/filesystem.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 45532 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/memory.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8691 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21902 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/uploadedfile.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29730 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/uploadhandler.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29787 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/base.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35575 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/filesystem.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 45636 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/memory.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8797 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22018 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/uploadedfile.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29871 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/files/uploadhandler.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/mail/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 74483 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/mail/message.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22552 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/mail.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 74584 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/mail/message.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22670 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/mail.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/management/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 89850 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/management/base.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37841 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/paginator.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 42142 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/signing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 92880 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/validators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 89986 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/management/base.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38009 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/paginator.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 42265 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/signing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 93053 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/core/validators.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/backends/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/backends/base/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 284680 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/backends/base/schema.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 284864 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/backends/base/schema.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 61808 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/fields.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 190009 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/models.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35342 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/special.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 61927 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 190183 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/models.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35461 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/special.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 38753 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/aggregates.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 366072 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/base.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 70870 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/constraints.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 84238 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/deletion.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 285783 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/expressions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38889 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/aggregates.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 366253 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/base.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 70986 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/constraints.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 84369 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/deletion.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 285954 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/expressions.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 73241 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/files.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 102385 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/json.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 278915 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/related.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 382999 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 73375 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/files.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 102489 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/json.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 279029 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/related.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 383285 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40553 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/comparison.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 63667 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/datetime.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34695 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/math.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 55132 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/text.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18908 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/window.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 54412 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/indexes.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 110112 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/lookups.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 31057 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/manager.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 133324 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/options.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 377322 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/query.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 62787 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/query_utils.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41467 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/transaction.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 39439 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/utils.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 40687 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/comparison.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 63886 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/datetime.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34909 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/math.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 55351 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/text.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19062 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/functions/window.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 54513 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/indexes.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 110228 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/lookups.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31158 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/manager.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 133435 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/options.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 377433 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/query.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 62893 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/models/query_utils.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41630 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/transaction.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 39577 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/db/utils.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/dispatch/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 38260 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/dispatch/dispatcher.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38383 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/dispatch/dispatcher.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 55832 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/boundfield.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 203495 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/fields.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 76304 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/forms.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 81237 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/formsets.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 232884 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/models.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14964 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/renderers.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 176682 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/widgets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 55960 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/boundfield.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 203748 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 76402 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/forms.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 81360 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/formsets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 233007 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/models.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15097 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/renderers.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 176940 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/forms/widgets.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/http/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 108259 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/http/request.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 106939 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/http/response.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 108482 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/http/request.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 107137 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/http/response.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27902 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/cache.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8818 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/clickjacking.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29030 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/common.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 64712 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/csrf.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13708 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/gzip.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9638 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/http.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15442 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/locale.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14475 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/security.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21022 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/shortcuts.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28005 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/cache.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8916 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/clickjacking.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29133 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/common.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 64810 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/csrf.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13806 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/gzip.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9736 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/http.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15540 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/locale.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14573 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/middleware/security.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21132 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/shortcuts.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/backends/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22239 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/backends/django.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23237 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/backends/jinja2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 151345 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/base.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41524 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/context.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12999 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/context_processors.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34081 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/engine.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8114 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/exceptions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12524 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/loader.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22340 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/backends/django.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23338 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/backends/jinja2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 151453 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/base.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41637 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/context.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13112 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/context_processors.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34199 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/engine.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8217 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/exceptions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12632 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/loader.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/loaders/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9946 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/loaders/base.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23736 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/response.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10057 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/loaders/base.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23869 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/template/response.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 172524 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/client.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 166051 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/runner.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 266229 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/testcases.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 127135 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/utils.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 172677 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/client.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 166209 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/runner.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 266472 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/testcases.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 127258 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/test/utils.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 25341 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/base.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16492 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/conf.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10035 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/converters.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4935 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/exceptions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 127316 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/resolvers.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 25449 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/base.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16590 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/conf.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10133 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/converters.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5038 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/exceptions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 127414 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/urls/resolvers.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 63473 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/cache.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 25416 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/dateparse.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28279 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/decorators.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36118 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/encoding.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 76152 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/feedgenerator.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 58755 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/functional.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 62475 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/html.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 66854 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/http.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36648 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/log.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17092 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/module_loading.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10451 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/safestring.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69485 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/text.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40587 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/timezone.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 42939 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/translation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 63601 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/cache.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 25529 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/dateparse.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28402 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/decorators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36256 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/encoding.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 76330 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/feedgenerator.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 58868 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/functional.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 62603 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/html.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 66982 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/http.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36766 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/log.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17190 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/module_loading.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10554 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/safestring.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69583 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/text.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 40755 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/timezone.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 43127 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/utils/translation.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 101382 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/debug.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 101515 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/debug.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11461 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/cache.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5987 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/common.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10783 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/csrf.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12833 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/debug.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19822 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/http.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8330 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/vary.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11567 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/cache.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6088 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/common.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10884 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/csrf.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12939 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/debug.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19938 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/http.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8436 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/decorators/vary.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/generic/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 109288 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/generic/dates.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 43048 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/i18n.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6995 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16885 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 109589 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/generic/dates.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 43156 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django/views/i18n.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7087 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/django.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16977 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_modules/index.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/ │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8133 2024-03-21 21:19:02.000000 ./usr/share/doc/python-django-doc/html/_static/base-stemmer.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 15094 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/basic.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 875 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/console-tabs.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 92 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/default.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7604 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/djangodocs.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1065 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/docicons-behindscenes.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 559 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/docicons-note.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 791 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/docicons-philosophy.png │ │ │ │ @@ -256,638 +257,640 @@ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 64105 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.eot.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 503035 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.svg │ │ │ │ -rw-r--r-- 0 root (0) root (0) 63995 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.ttf.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 63024 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.woff │ │ │ │ -rw-r--r-- 0 root (0) root (0) 53928 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/fontawesome/webfonts/fa-brands-400.woff2 │ │ │ │ -rw-r--r-- 0 root (0) root (0) 892 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/homepage.css │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29065 2024-03-21 21:19:02.000000 ./usr/share/doc/python-django-doc/html/_static/italian-stemmer.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15646 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/language_data.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 90 2024-03-21 21:19:02.000000 ./usr/share/doc/python-django-doc/html/_static/minus.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 90 2024-03-21 21:19:02.000000 ./usr/share/doc/python-django-doc/html/_static/plus.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4699 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/pygments.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5522 2023-06-05 12:53:07.000000 ./usr/share/doc/python-django-doc/html/_static/reset-fonts-grids.css │ │ │ │ --rw-r--r-- 0 root (0) root (0) 112422 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/contents.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 3579 2024-03-21 21:19:02.000000 ./usr/share/doc/python-django-doc/html/_static/translations.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 112497 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/contents.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19685 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/admin.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13327 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/contributing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20517 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/general.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12568 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/help.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16489 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11794 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/install.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14723 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/models.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10344 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/troubleshooting.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13242 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/usage.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 616777 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/genindex.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9760 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/glossary.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19768 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/admin.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13416 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/contributing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 20568 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/general.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12663 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/help.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16576 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11891 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/install.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14820 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/models.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10435 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/troubleshooting.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13339 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/faq/usage.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 618194 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/genindex.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9852 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/glossary.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19302 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/auth-remote-user.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 42204 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/csrf.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19973 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-file-storage.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 46268 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-lookups.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 52613 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-management-commands.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 94544 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-model-fields.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 24282 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-template-backend.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 127795 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-template-tags.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6813 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/delete-app.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19390 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/auth-remote-user.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 42302 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/csrf.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 20066 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-file-storage.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 46361 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-lookups.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 52718 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-management-commands.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 94642 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-model-fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 24375 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-template-backend.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 127873 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/custom-template-tags.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6906 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/delete-app.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9328 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/daphne.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7707 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/hypercorn.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11372 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9351 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/uvicorn.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 32272 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/checklist.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10199 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9427 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/daphne.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7806 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/hypercorn.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11476 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9450 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/asgi/uvicorn.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 32366 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/checklist.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10295 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/index.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16658 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/apache-auth.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8004 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/gunicorn.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12843 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 24456 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/modwsgi.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16166 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/uwsgi.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 49583 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/error-reporting.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9208 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16285 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/initial-data.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13800 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/legacy-databases.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36293 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/logging.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22344 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/outputting-csv.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15297 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/outputting-pdf.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17309 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/overriding-templates.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16755 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/apache-auth.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8103 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/gunicorn.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12942 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 24556 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/modwsgi.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16265 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/deployment/wsgi/uwsgi.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 49710 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/error-reporting.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9303 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16380 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/initial-data.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13893 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/legacy-databases.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36389 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/logging.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22435 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/outputting-csv.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15388 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/outputting-pdf.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17404 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/overriding-templates.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/static-files/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17135 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/static-files/deployment.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26753 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/static-files/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17061 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/upgrade-version.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15526 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/windows.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 50510 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/writing-migrations.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30384 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17233 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/static-files/deployment.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26847 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/static-files/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17154 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/upgrade-version.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15615 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/windows.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 50601 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/howto/writing-migrations.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 30451 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/index.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16358 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/bugs-and-features.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23168 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/committing-code.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15840 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11497 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/localizing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13749 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/new-contributors.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 33984 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/triaging-tickets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16439 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/bugs-and-features.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23242 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/committing-code.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15940 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11589 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/localizing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13841 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/new-contributors.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34004 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/triaging-tickets.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 38893 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/coding-style.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7991 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18471 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/javascript.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30282 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/submitting-patches.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 65153 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/unit-tests.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 24026 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/working-with-git.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 43792 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-documentation.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 127466 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/deprecation.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19979 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/git.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40933 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/howto-release-django.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13034 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12923 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/mailing-lists.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 24609 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/organization.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20596 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/release-process.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19194 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/security.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38986 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/coding-style.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8094 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18574 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/javascript.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 30331 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/submitting-patches.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 65256 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/unit-tests.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 24101 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-code/working-with-git.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 43820 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/contributing/writing-documentation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 127559 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/deprecation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 20076 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/git.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 40967 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/howto-release-django.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13133 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13021 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/mailing-lists.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 24704 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/organization.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 20685 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/release-process.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19289 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/internals/security.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 56891 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/contributing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7725 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10459 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/install.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40628 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/overview.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 32022 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/reusable-apps.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 38836 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial01.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 79499 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial02.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 58392 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial03.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 46831 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial04.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 79329 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial05.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18175 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial06.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 45892 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial07.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13834 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial08.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21454 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/whatsnext.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 56964 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/contributing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7826 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10554 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/install.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 40705 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/overview.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 32117 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/reusable-apps.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38918 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial01.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 79558 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial02.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 58461 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial03.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 46918 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial04.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 79418 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial05.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18273 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial06.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 45939 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial07.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13923 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/tutorial08.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21534 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/intro/whatsnext.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10128 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/api-stability.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26896 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/design-philosophies.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7353 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/distributions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6960 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 100448 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/objects.inv │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41847 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/py-modindex.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10211 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/api-stability.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26981 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/design-philosophies.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7450 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/distributions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7057 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/misc/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 100449 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/objects.inv │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41927 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/py-modindex.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 59413 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/applications.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 140362 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/checks.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 59513 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/applications.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 140469 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/checks.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 39794 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/base.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 193894 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/flattened-index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 92768 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/generic-date-based.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 31111 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/generic-display.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 48535 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/generic-editing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20946 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 53387 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-date-based.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35850 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-editing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 31638 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-multiple-object.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17809 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-simple.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28159 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-single-object.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5936 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17329 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/clickjacking.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 39894 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/base.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 193996 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/flattened-index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 92894 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/generic-date-based.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31211 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/generic-display.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 48637 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/generic-editing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21046 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 53538 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-date-based.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35950 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-editing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31739 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-multiple-object.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17909 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-simple.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28264 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins-single-object.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6036 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/class-based-views/mixins.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17414 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/clickjacking.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 59949 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/actions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19628 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/admindocs.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30009 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/filters.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 451569 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15011 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/javascript.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 104928 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/auth.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 86106 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/contenttypes.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41106 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/flatpages.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 60043 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/actions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19729 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/admindocs.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 30112 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/filters.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 451702 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15114 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/admin/javascript.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 105030 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/auth.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 86180 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/contenttypes.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41202 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/flatpages.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15099 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/admin.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16028 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/commands.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 72779 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/db-api.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6642 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/deployment.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15303 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/feeds.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29499 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/forms-api.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 94120 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/functions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 249598 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/gdal.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 25578 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/geoip2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 100886 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/geoquerysets.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 175078 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/geos.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21731 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15202 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/admin.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16131 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/commands.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 72882 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/db-api.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6750 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/deployment.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15414 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/feeds.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29624 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/forms-api.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 94295 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/functions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 249770 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/gdal.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 25681 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/geoip2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 100993 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/geoquerysets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 175224 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/geos.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21834 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/index.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 24657 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/geolibs.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40107 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12698 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/postgis.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13239 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/spatialite.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30817 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/layermapping.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27976 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/measure.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36074 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/model-api.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8642 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/ogrinspect.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11899 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/serializers.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7396 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/sitemaps.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15605 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/testing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 93236 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/tutorial.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7287 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/utils.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23806 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/humanize.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17334 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 55765 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/messages.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 24761 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/geolibs.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 40201 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12804 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/postgis.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13345 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/install/spatialite.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 30929 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/layermapping.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28083 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/measure.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36195 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/model-api.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8749 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/ogrinspect.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12002 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/serializers.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7499 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/sitemaps.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15708 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/testing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 93335 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/tutorial.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7390 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/gis/utils.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23898 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/humanize.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17424 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 55865 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/messages.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 66606 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/aggregates.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35712 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/constraints.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10565 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/expressions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 134252 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/fields.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36393 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/forms.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10582 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/functions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16081 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28522 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/indexes.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17707 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/lookups.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 31458 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/operations.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 66909 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/search.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11139 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/validators.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20016 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/redirects.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 85566 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/sitemaps.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 65386 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/sites.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 76370 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/staticfiles.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 106470 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/syndication.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28084 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/csrf.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 113285 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/databases.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 231028 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/django-admin.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 55045 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/exceptions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 66703 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/aggregates.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35822 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/constraints.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10668 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/expressions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 134360 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36494 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/forms.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10689 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/functions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16184 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28641 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/indexes.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17815 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/lookups.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31561 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/operations.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 67036 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/search.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11248 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/postgres/validators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 20110 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/redirects.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 85664 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/sitemaps.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 65462 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/sites.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 76474 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/staticfiles.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 106567 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/contrib/syndication.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28181 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/csrf.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 113381 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/databases.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 231133 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/django-admin.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 55202 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/exceptions.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27278 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/file.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7788 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 44916 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/storage.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34390 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/uploads.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27392 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/file.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7888 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 45058 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/storage.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34506 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/files/uploads.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 224705 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/api.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 215071 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/fields.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9040 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/formsets.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11916 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28200 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/models.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35625 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/renderers.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 48122 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/validation.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 148110 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/widgets.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8982 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 47847 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/logging.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 65546 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/middleware.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 86287 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/migration-operations.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 224818 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/api.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 215221 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9142 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/formsets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12014 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28306 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/models.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35741 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/renderers.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 48214 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/validation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 148278 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/forms/widgets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9081 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 47952 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/logging.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 65672 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/middleware.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 86455 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/migration-operations.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13165 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/class.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 53531 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/conditional-expressions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 39038 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/constraints.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 324738 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/database-functions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 175881 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/expressions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 320703 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/fields.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6996 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30387 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/indexes.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 126550 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/instances.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35952 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/lookups.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18225 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/meta.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 67868 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/options.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 519018 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/querysets.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 39326 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/relations.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36696 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/paginator.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 189181 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/request-response.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37652 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/schema-editor.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 380961 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/settings.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 71685 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/signals.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41148 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/template-response.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13265 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/class.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 53635 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/conditional-expressions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 39149 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/constraints.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 324978 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/database-functions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 176012 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/expressions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 320913 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/fields.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7096 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 30491 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/indexes.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 126688 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/instances.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36060 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/lookups.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18329 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/meta.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 67965 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/options.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 519171 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/querysets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 39422 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/models/relations.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36821 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/paginator.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 189376 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/request-response.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 37779 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/schema-editor.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 381081 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/settings.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 71796 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/signals.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41261 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/template-response.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 137004 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/api.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 293668 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/builtins.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8985 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 73689 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/language.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37216 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/unicode.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 33345 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/urlresolvers.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 33170 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/urls.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 167649 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/utils.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 66550 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/validators.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23240 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/views.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 137141 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/api.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 293670 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/builtins.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9087 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 73759 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/templates/language.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 37308 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/unicode.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 33455 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/urlresolvers.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 33268 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/urls.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 167932 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/utils.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 66681 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/validators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23331 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/ref/views.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12905 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/0.95.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 25616 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/0.96.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 95814 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.0-porting-guide.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9157 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.0.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8418 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.0.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26539 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.0.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9718 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.1.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8354 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.1.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8903 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.1.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 46888 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14628 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8225 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12243 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7912 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6781 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7306 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9204 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6463 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 171486 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17452 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8835 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9215 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6605 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6953 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6267 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.14.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7010 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.15.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5900 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.16.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6156 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.17.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6452 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.18.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7039 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.19.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10910 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5783 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.20.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7145 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.21.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8295 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.22.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13784 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.23.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6281 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.24.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6289 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.25.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6393 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.26.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7653 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.27.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6527 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.28.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6480 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.29.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11679 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9976 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10768 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6902 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7056 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8862 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6746 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 122415 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5359 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6857 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5740 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11453 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13939 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5555 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5505 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 124294 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5494 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5474 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5462 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7633 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8982 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10664 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5765 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 90705 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5457 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5836 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13071 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6112 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9175 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11400 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.14.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5797 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.15.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6190 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.16.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6028 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.17.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11538 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.18.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6245 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.19.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9726 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7432 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.20.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10731 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.21.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8042 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.22.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8982 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11406 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5781 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8195 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7116 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8957 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6592 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 152174 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6254 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5788 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5971 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5804 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13481 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11769 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9761 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8483 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14002 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6087 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9150 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11383 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 98832 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11457 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12183 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9645 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8964 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20907 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6969 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10679 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14186 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6143 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5947 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6011 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 153067 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20316 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7887 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7982 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 25003 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13839 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7272 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7225 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7938 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10709 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5851 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11766 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 236981 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15061 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13209 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5422 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6701 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6144 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7210 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.14.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6649 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.15.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9235 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.16.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5885 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.17.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8267 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.18.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9162 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.19.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11551 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 20998 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10750 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10732 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9952 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12558 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11049 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8483 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 234531 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13728 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6640 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9235 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5885 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8933 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16228 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15972 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5398 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9767 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7872 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7603 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7441 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5919 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 177134 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8962 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7723 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7014 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5757 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5865 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9949 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11701 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8127 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7249 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6978 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6686 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7898 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5858 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 104931 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9619 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8261 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13759 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6256 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6264 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6368 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.14.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9002 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.15.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8302 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7332 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7189 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8120 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7677 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5731 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5885 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8515 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 64286 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14262 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6493 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7532 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5876 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7954 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5957 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.14.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6336 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.15.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9013 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.16.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5171 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.17.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6806 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.18.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6938 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.19.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11665 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6185 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.20.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6358 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.21.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7584 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.22.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6251 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.23.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9305 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.24.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6151 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.25.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10052 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.26.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7639 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.27.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8830 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.28.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9890 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15953 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7141 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6473 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8047 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9836 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7611 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 71560 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9584 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9004 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6021 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6806 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6938 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6161 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.14.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7069 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10881 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8851 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6374 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5993 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9633 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7044 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6323 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 88758 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14207 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7575 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6249 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9305 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6837 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6127 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.14.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8176 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12099 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8262 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7155 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7250 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7562 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7048 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6341 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 113560 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13133 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6870 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10052 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7639 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9557 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7263 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.14.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6804 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.15.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6159 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.16.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6605 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.17.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6471 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.18.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8178 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.19.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8434 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6820 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.20.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6504 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.21.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7968 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.22.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7020 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.23.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6330 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.24.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7658 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.25.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6752 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11638 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8808 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6331 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5787 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6054 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5841 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 108453 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12423 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6438 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11233 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6841 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9819 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6522 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7238 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6779 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6134 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6588 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 99262 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11247 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6811 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6504 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7968 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6996 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10762 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6132 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7892 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6262 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7138 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7066 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5868 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8161 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 98603 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13904 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.1.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6321 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.10.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7682 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.11.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5950 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.12.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5105 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.13.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9927 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7872 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.3.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6360 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.4.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8325 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.5.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10630 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.6.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8085 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.7.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8365 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.8.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5810 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.9.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 78581 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 46700 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 158596 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/security.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 3866 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/search.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 1831340 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/searchindex.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12996 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/0.95.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 25701 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/0.96.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 95922 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.0-porting-guide.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9252 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.0.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8511 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.0.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26636 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.0.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9813 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.1.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8449 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.1.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8998 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.1.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 46971 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14725 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8320 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12340 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8007 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6878 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7401 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9297 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6560 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 171568 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17547 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8930 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9312 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6702 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7050 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6364 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.14.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7107 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.15.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5997 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.16.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6253 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.17.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6549 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.18.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7136 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.19.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11007 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5880 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.20.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7240 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.21.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8392 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.22.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13881 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.23.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6378 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.24.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6386 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.25.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6490 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.26.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7750 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.27.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6624 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.28.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6577 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.29.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11776 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10073 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10865 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6999 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7153 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8957 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6843 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 122510 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5456 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6952 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5837 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11548 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14034 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5652 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5602 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 124387 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5591 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5571 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5559 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7730 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9079 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10761 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5860 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 90782 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5554 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5933 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13164 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6209 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9270 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11493 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.14.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5894 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.15.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6287 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.16.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6125 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.17.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11633 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.18.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6342 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.19.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9823 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7527 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.20.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10828 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.21.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8139 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.22.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9079 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11503 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5876 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8290 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7213 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9054 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6689 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 152257 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6351 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5885 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6068 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5901 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13576 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11866 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9858 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8580 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14095 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6184 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9245 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11476 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 98922 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11554 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12278 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9740 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9061 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21000 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7066 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10774 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14277 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6240 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6044 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6108 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 153161 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 20413 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7984 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8079 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 25098 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13934 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7369 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7322 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8035 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10804 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5948 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11863 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 237059 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15158 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13302 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5519 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6798 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6241 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7307 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.14.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6746 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.15.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9332 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.16.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5980 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.17.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8360 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.18.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9259 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.19.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11646 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21095 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10847 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10829 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10047 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12655 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11146 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8578 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 234613 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13825 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6737 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9332 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5980 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9026 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16309 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16063 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5495 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9864 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7969 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7700 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7538 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6016 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 177228 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/1.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9059 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7820 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7111 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5854 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5962 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10042 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11796 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8224 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7346 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7075 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6783 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7995 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5955 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 105028 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.0.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9714 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8358 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13856 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6353 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6361 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6465 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.14.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9097 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.15.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8395 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7429 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7282 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8217 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7774 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5828 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5982 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8610 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 64359 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14359 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6590 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7629 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5973 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8051 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6054 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.14.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6433 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.15.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9110 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.16.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5268 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.17.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6901 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.18.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7035 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.19.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11760 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6280 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.20.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6455 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.21.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7681 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.22.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6348 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.23.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9402 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.24.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6246 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.25.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10139 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.26.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7734 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.27.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8925 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.28.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9987 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16050 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7238 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6570 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8144 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9931 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7708 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 71657 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/2.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9681 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9101 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6118 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6901 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7035 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6256 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.14.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7166 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10978 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8948 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6471 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6090 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9730 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7141 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6420 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 88851 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.0.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14304 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7672 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6346 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9402 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6932 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6222 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.14.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8273 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12196 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8359 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7252 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7345 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7659 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7143 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6438 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 113657 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13230 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6965 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10139 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7734 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9652 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7358 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.14.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6899 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.15.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6254 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.16.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6700 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.17.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6566 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.18.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8273 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.19.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8531 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6915 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.20.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6599 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.21.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8063 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.22.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7115 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.23.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6425 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.24.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7753 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.25.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6849 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11735 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8903 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6428 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5884 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6151 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5938 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 108550 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/3.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12510 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6533 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11328 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6938 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9914 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6619 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7333 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6874 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6229 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6683 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 99359 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.0.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11340 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6906 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6599 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8063 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7091 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10857 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6229 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7989 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6359 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7233 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7161 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5965 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8256 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 98698 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13999 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.1.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6416 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.10.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7777 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.11.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6047 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.12.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5202 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.13.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10024 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7967 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.3.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6457 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.4.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8420 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.5.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10725 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.6.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8180 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.7.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8462 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.8.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5907 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.9.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 78678 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/4.2.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 46799 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 158683 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/releases/security.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 3922 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/search.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 2044728 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/searchindex.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1080 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/templatebuiltins.js │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36305 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/async.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36412 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/async.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 146194 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/customizing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 209793 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/default.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11663 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 81889 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/passwords.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 152908 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/cache.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27160 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/checks.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 146292 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/customizing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 209873 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/default.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11763 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 82009 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/auth/passwords.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 152989 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/cache.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27255 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/checks.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 45834 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/generic-display.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 38804 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/generic-editing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21863 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40243 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/intro.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 97182 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/mixins.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28120 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/conditional-view-processing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 45916 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/generic-display.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38904 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/generic-editing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21963 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 40343 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/intro.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 97296 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/class-based-views/mixins.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28211 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/conditional-view-processing.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 81830 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/aggregation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 81922 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/aggregation.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5618 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 45050 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/many_to_many.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34880 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/many_to_one.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 25131 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/one_to_one.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22954 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/fixtures.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6673 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17497 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/instrumentation.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 55827 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/managers.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 178317 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/models.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 89243 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/multi-db.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 61536 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/optimization.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 249522 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/queries.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16730 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/search.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 49193 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/sql.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14318 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/tablespaces.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 76538 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/transactions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 88836 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/email.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7903 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/external-packages.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35501 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/files.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5721 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 45153 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/many_to_many.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34983 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/many_to_one.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 25232 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/examples/one_to_one.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23056 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/fixtures.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6773 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17597 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/instrumentation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 55921 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/managers.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 178408 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/models.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 89348 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/multi-db.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 61636 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/optimization.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 249565 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/queries.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16814 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/search.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 49311 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/sql.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14423 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/tablespaces.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 76664 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/db/transactions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 88923 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/email.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8000 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/external-packages.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35596 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/files.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 144604 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/formsets.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 96364 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 51346 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/media.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 170332 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/modelforms.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 144716 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/formsets.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 96463 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 51446 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/media.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 170442 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/forms/modelforms.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21099 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/decorators.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 48195 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/file-uploads.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5173 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/generic-views.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6027 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 54127 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/middleware.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 100262 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/sessions.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37460 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/shortcuts.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 92861 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/urls.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29180 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/views.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21215 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/decorators.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 48303 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/file-uploads.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5273 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/generic-views.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6127 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 54223 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/middleware.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 100368 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/sessions.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 37566 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/shortcuts.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 92957 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/urls.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29276 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/http/views.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 21757 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/formatting.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11683 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 71996 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/timezones.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 242385 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/translation.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27058 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23160 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/install.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 45837 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/logging.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 90612 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/migrations.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22428 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/pagination.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 38048 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/performance.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 31318 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/security.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 72981 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/serialization.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34332 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/settings.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36338 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/signals.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40939 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/signing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 73009 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/templates.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 21857 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/formatting.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11784 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 72098 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/timezones.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 242516 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/i18n/translation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27157 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23257 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/install.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 45936 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/logging.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 90703 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/migrations.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22523 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/pagination.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38137 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/performance.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31418 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/security.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 73053 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/serialization.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34425 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/settings.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36448 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/signals.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41046 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/signing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 73126 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/templates.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 110421 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/advanced.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7257 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 42662 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/overview.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 276967 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/tools.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 110564 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/advanced.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7357 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 42765 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/overview.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 277169 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/topics/testing/tools.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc-base/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 407 2024-05-08 10:28:44.000000 ./usr/share/doc-base/python-django-doc.python-django-doc │ │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/doctools.js -> ../../../../javascript/sphinxdoc/1.0/doctools.js │ │ │ │ -lrwxrwxrwx 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/language_data.js -> ../../../../javascript/sphinxdoc/1.0/language_data.js │ │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/searchtools.js -> ../../../../javascript/sphinxdoc/1.0/searchtools.js │ │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2024-05-08 10:28:44.000000 ./usr/share/doc/python-django-doc/html/_static/sphinx_highlight.js -> ../../../../javascript/sphinxdoc/1.0/sphinx_highlight.js │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/asgiref/sync.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - asgiref.sync — Django 4.2.13 documentation │ │ │ │ + asgiref.sync — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for asgiref.sync

│ │ │ │ +  

Codice sorgente per asgiref.sync

│ │ │ │  import asyncio
│ │ │ │  import asyncio.coroutines
│ │ │ │  import contextvars
│ │ │ │  import functools
│ │ │ │  import inspect
│ │ │ │  import os
│ │ │ │  import sys
│ │ │ │ @@ -615,15 +616,15 @@
│ │ │ │      *,
│ │ │ │      force_new_loop: bool = False,
│ │ │ │  ) -> Callable[_P, _R]:
│ │ │ │      ...
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def async_to_sync( │ │ │ │ awaitable: Optional[ │ │ │ │ Union[ │ │ │ │ Callable[_P, Coroutine[Any, Any, _R]], │ │ │ │ Callable[_P, Awaitable[_R]], │ │ │ │ ] │ │ │ │ ] = None, │ │ │ │ @@ -664,15 +665,15 @@ │ │ │ │ thread_sensitive: bool = True, │ │ │ │ executor: Optional["ThreadPoolExecutor"] = None, │ │ │ │ ) -> Callable[_P, Coroutine[Any, Any, _R]]: │ │ │ │ ... │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def sync_to_async( │ │ │ │ func: Optional[Callable[_P, _R]] = None, │ │ │ │ *, │ │ │ │ thread_sensitive: bool = True, │ │ │ │ executor: Optional["ThreadPoolExecutor"] = None, │ │ │ │ ) -> Union[ │ │ │ │ Callable[[Callable[_P, _R]], Callable[_P, Coroutine[Any, Any, _R]]], │ │ │ │ @@ -698,35 +699,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr aassggiirreeff..ssyynncc ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr aassggiirreeff..ssyynncc ************ │ │ │ │ │ import asyncio │ │ │ │ │ import asyncio.coroutines │ │ │ │ │ import contextvars │ │ │ │ │ import functools │ │ │ │ │ import inspect │ │ │ │ │ import os │ │ │ │ │ import sys │ │ │ │ │ @@ -566,15 +566,15 @@ │ │ │ │ │ *, │ │ │ │ │ force_new_loop: bool = False, │ │ │ │ │ ) -> Callable[_P, _R]: │ │ │ │ │ ... │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def async_to_sync( │ │ │ │ │ awaitable: Optional[ │ │ │ │ │ Union[ │ │ │ │ │ Callable[_P, Coroutine[Any, Any, _R]], │ │ │ │ │ Callable[_P, Awaitable[_R]], │ │ │ │ │ ] │ │ │ │ │ ] = None, │ │ │ │ │ @@ -617,15 +617,15 @@ │ │ │ │ │ thread_sensitive: bool = True, │ │ │ │ │ executor: Optional["ThreadPoolExecutor"] = None, │ │ │ │ │ ) -> Callable[_P, Coroutine[Any, Any, _R]]: │ │ │ │ │ ... │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def sync_to_async( │ │ │ │ │ func: Optional[Callable[_P, _R]] = None, │ │ │ │ │ *, │ │ │ │ │ thread_sensitive: bool = True, │ │ │ │ │ executor: Optional["ThreadPoolExecutor"] = None, │ │ │ │ │ ) -> Union[ │ │ │ │ │ Callable[[Callable[_P, _R]], Callable[_P, Coroutine[Any, Any, _R]]], │ │ │ │ │ @@ -639,12 +639,12 @@ │ │ │ │ │ ) │ │ │ │ │ return SyncToAsync( │ │ │ │ │ func, │ │ │ │ │ thread_sensitive=thread_sensitive, │ │ │ │ │ executor=executor, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/apps/config.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.apps.config — Django 4.2.13 documentation │ │ │ │ + django.apps.config — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.apps.config

│ │ │ │ +  

Codice sorgente per django.apps.config

│ │ │ │  import inspect
│ │ │ │  import os
│ │ │ │  from importlib import import_module
│ │ │ │  
│ │ │ │  from django.core.exceptions import ImproperlyConfigured
│ │ │ │  from django.utils.functional import cached_property
│ │ │ │  from django.utils.module_loading import import_string, module_has_submodule
│ │ │ │  
│ │ │ │  APPS_MODULE_NAME = "apps"
│ │ │ │  MODELS_MODULE_NAME = "models"
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AppConfig: │ │ │ │ """Class representing a Django application and its configuration.""" │ │ │ │ │ │ │ │ def __init__(self, app_name, app_module): │ │ │ │ # Full Python path to the application e.g. 'django.contrib.admin'. │ │ │ │ self.name = app_name │ │ │ │ │ │ │ │ @@ -293,15 +294,15 @@ │ │ │ │ ) │ │ │ │ ) │ │ │ │ │ │ │ │ # Entry is a path to an app config class. │ │ │ │ return app_config_class(app_name, app_module) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_model(self, model_name, require_ready=True): │ │ │ │ """ │ │ │ │ Return the model with the given case-insensitive model_name. │ │ │ │ │ │ │ │ Raise LookupError if no model exists with this name. │ │ │ │ """ │ │ │ │ if require_ready: │ │ │ │ @@ -313,15 +314,15 @@ │ │ │ │ except KeyError: │ │ │ │ raise LookupError( │ │ │ │ "App '%s' doesn't have a '%s' model." % (self.label, model_name) │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_models(self, include_auto_created=False, include_swapped=False): │ │ │ │ """ │ │ │ │ Return an iterable of models. │ │ │ │ │ │ │ │ By default, the following models aren't included: │ │ │ │ │ │ │ │ - auto-created models for many-to-many relations without │ │ │ │ @@ -346,15 +347,15 @@ │ │ │ │ self.models = self.apps.all_models[self.label] │ │ │ │ │ │ │ │ if module_has_submodule(self.module, MODELS_MODULE_NAME): │ │ │ │ models_module_name = "%s.%s" % (self.name, MODELS_MODULE_NAME) │ │ │ │ self.models_module = import_module(models_module_name) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def ready(self): │ │ │ │ """ │ │ │ │ Override this method in subclasses to run code when Django starts. │ │ │ │ """
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ @@ -365,35 +366,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,25 +1,25 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..aappppss..ccoonnffiigg ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..aappppss..ccoonnffiigg ************ │ │ │ │ │ import inspect │ │ │ │ │ import os │ │ │ │ │ from importlib import import_module │ │ │ │ │ │ │ │ │ │ from django.core.exceptions import ImproperlyConfigured │ │ │ │ │ from django.utils.functional import cached_property │ │ │ │ │ from django.utils.module_loading import import_string, module_has_submodule │ │ │ │ │ │ │ │ │ │ APPS_MODULE_NAME = "apps" │ │ │ │ │ MODELS_MODULE_NAME = "models" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AppConfig: │ │ │ │ │ """Class representing a Django application and its configuration.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, app_name, app_module): │ │ │ │ │ # Full Python path to the application e.g. 'django.contrib.admin'. │ │ │ │ │ self.name = app_name │ │ │ │ │ │ │ │ │ │ @@ -230,15 +230,15 @@ │ │ │ │ │ ) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ # Entry is a path to an app config class. │ │ │ │ │ return app_config_class(app_name, app_module) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_model(self, model_name, require_ready=True): │ │ │ │ │ """ │ │ │ │ │ Return the model with the given case-insensitive model_name. │ │ │ │ │ │ │ │ │ │ Raise LookupError if no model exists with this name. │ │ │ │ │ """ │ │ │ │ │ if require_ready: │ │ │ │ │ @@ -252,15 +252,15 @@ │ │ │ │ │ "App '%s' doesn't have a '%s' model." % (self.label, │ │ │ │ │ model_name) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_models(self, include_auto_created=False, include_swapped=False): │ │ │ │ │ """ │ │ │ │ │ Return an iterable of models. │ │ │ │ │ │ │ │ │ │ By default, the following models aren't included: │ │ │ │ │ │ │ │ │ │ - auto-created models for many-to-many relations without │ │ │ │ │ @@ -286,19 +286,19 @@ │ │ │ │ │ self.models = self.apps.all_models[self.label] │ │ │ │ │ │ │ │ │ │ if module_has_submodule(self.module, MODELS_MODULE_NAME): │ │ │ │ │ models_module_name = "%s.%s" % (self.name, MODELS_MODULE_NAME) │ │ │ │ │ self.models_module = import_module(models_module_name) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def ready(self): │ │ │ │ │ """ │ │ │ │ │ Override this method in subclasses to run code when Django starts. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/conf/urls/i18n.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.conf.urls.i18n — Django 4.2.13 documentation │ │ │ │ + django.conf.urls.i18n — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.conf.urls.i18n

│ │ │ │ +  

Codice sorgente per django.conf.urls.i18n

│ │ │ │  import functools
│ │ │ │  
│ │ │ │  from django.conf import settings
│ │ │ │  from django.urls import LocalePrefixPattern, URLResolver, get_resolver, path
│ │ │ │  from django.views.i18n import set_language
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def i18n_patterns(*urls, prefix_default_language=True): │ │ │ │ """ │ │ │ │ Add the language code prefix to every URL pattern within this function. │ │ │ │ This may only be used in the root URLconf, not in an included URLconf. │ │ │ │ """ │ │ │ │ if not settings.USE_I18N: │ │ │ │ return list(urls) │ │ │ │ @@ -121,35 +122,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnff..uurrllss..ii1188nn ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnff..uurrllss..ii1188nn ************ │ │ │ │ │ import functools │ │ │ │ │ │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.urls import LocalePrefixPattern, URLResolver, get_resolver, path │ │ │ │ │ from django.views.i18n import set_language │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def i18n_patterns(*urls, prefix_default_language=True): │ │ │ │ │ """ │ │ │ │ │ Add the language code prefix to every URL pattern within this function. │ │ │ │ │ This may only be used in the root URLconf, not in an included URLconf. │ │ │ │ │ """ │ │ │ │ │ if not settings.USE_I18N: │ │ │ │ │ return list(urls) │ │ │ │ │ @@ -42,12 +42,12 @@ │ │ │ │ │ return True, url_pattern.pattern.prefix_default_language │ │ │ │ │ return False, False │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ urlpatterns = [ │ │ │ │ │ path("setlang/", set_language, name="set_language"), │ │ │ │ │ ] │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/decorators.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.admin.decorators — Django 4.2.13 documentation │ │ │ │ + django.contrib.admin.decorators — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.admin.decorators

│ │ │ │ +  

Codice sorgente per django.contrib.admin.decorators

│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def action(function=None, *, permissions=None, description=None): │ │ │ │ """ │ │ │ │ Conveniently add attributes to an action function:: │ │ │ │ │ │ │ │ @admin.action( │ │ │ │ permissions=['publish'], │ │ │ │ description='Mark selected stories as published', │ │ │ │ @@ -104,15 +105,15 @@ │ │ │ │ return decorator │ │ │ │ else: │ │ │ │ return decorator(function)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def display( │ │ │ │ function=None, *, boolean=None, ordering=None, description=None, empty_value=None │ │ │ │ ): │ │ │ │ """ │ │ │ │ Conveniently add attributes to a display function:: │ │ │ │ │ │ │ │ @admin.display( │ │ │ │ @@ -153,15 +154,15 @@ │ │ │ │ return decorator │ │ │ │ else: │ │ │ │ return decorator(function)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def register(*models, site=None): │ │ │ │ """ │ │ │ │ Register the given model(s) classes and wrapped ModelAdmin class with │ │ │ │ admin site: │ │ │ │ │ │ │ │ @register(Author) │ │ │ │ class AuthorAdmin(admin.ModelAdmin): │ │ │ │ @@ -199,35 +200,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,13 +1,13 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn..ddeeccoorraattoorrss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn..ddeeccoorraattoorrss ************ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def action(function=None, *, permissions=None, description=None): │ │ │ │ │ """ │ │ │ │ │ Conveniently add attributes to an action function:: │ │ │ │ │ │ │ │ │ │ @admin.action( │ │ │ │ │ permissions=['publish'], │ │ │ │ │ description='Mark selected stories as published', │ │ │ │ │ @@ -36,15 +36,15 @@ │ │ │ │ │ else: │ │ │ │ │ return decorator(function) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def display( │ │ │ │ │ function=None, *, boolean=None, ordering=None, description=None, │ │ │ │ │ empty_value=None │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Conveniently add attributes to a display function:: │ │ │ │ │ │ │ │ │ │ @@ -87,15 +87,15 @@ │ │ │ │ │ else: │ │ │ │ │ return decorator(function) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def register(*models, site=None): │ │ │ │ │ """ │ │ │ │ │ Register the given model(s) classes and wrapped ModelAdmin class with │ │ │ │ │ admin site: │ │ │ │ │ │ │ │ │ │ @register(Author) │ │ │ │ │ class AuthorAdmin(admin.ModelAdmin): │ │ │ │ │ @@ -121,12 +121,12 @@ │ │ │ │ │ │ │ │ │ │ admin_site.register(models, admin_class=admin_class) │ │ │ │ │ │ │ │ │ │ return admin_class │ │ │ │ │ │ │ │ │ │ return _model_admin_wrapper │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/options.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.admin.options — Django 4.2.13 documentation │ │ │ │ + django.contrib.admin.options — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.admin.options

│ │ │ │ +  

Codice sorgente per django.contrib.admin.options

│ │ │ │  import copy
│ │ │ │  import json
│ │ │ │  import re
│ │ │ │  from functools import partial, update_wrapper
│ │ │ │  from urllib.parse import quote as urlquote
│ │ │ │  
│ │ │ │  from django import forms
│ │ │ │ @@ -681,15 +682,15 @@
│ │ │ │          does not restrict access to the add, change or delete views. Use
│ │ │ │          `ModelAdmin.has_(add|change|delete)_permission` for that.
│ │ │ │          """
│ │ │ │          return request.user.has_module_perms(self.opts.app_label)
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ModelAdmin(BaseModelAdmin): │ │ │ │ """Encapsulate all admin options and functionality for a given model.""" │ │ │ │ │ │ │ │ list_display = ("__str__",) │ │ │ │ list_display_links = () │ │ │ │ list_filter = () │ │ │ │ list_select_related = False │ │ │ │ @@ -735,15 +736,15 @@ │ │ │ │ def __repr__(self): │ │ │ │ return ( │ │ │ │ f"<{self.__class__.__qualname__}: model={self.model.__qualname__} " │ │ │ │ f"site={self.admin_site!r}>" │ │ │ │ ) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_inline_instances(self, request, obj=None): │ │ │ │ inline_instances = [] │ │ │ │ for inline_class in self.get_inlines(request, obj): │ │ │ │ inline = inline_class(self.model, self.admin_site) │ │ │ │ if request: │ │ │ │ if not ( │ │ │ │ inline.has_view_or_change_permission(request, obj) │ │ │ │ @@ -755,15 +756,15 @@ │ │ │ │ inline.max_num = 0 │ │ │ │ inline_instances.append(inline) │ │ │ │ │ │ │ │ return inline_instances
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_urls(self): │ │ │ │ from django.urls import path │ │ │ │ │ │ │ │ def wrap(view): │ │ │ │ def wrapper(*args, **kwargs): │ │ │ │ return self.admin_site.admin_view(view)(*args, **kwargs) │ │ │ │ │ │ │ │ @@ -835,15 +836,15 @@ │ │ │ │ "view": self.has_view_permission(request), │ │ │ │ } │ │ │ │ │ │ │ │ def _get_form_for_get_fields(self, request, obj): │ │ │ │ return self.get_form(request, obj, fields=None) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_form(self, request, obj=None, change=False, **kwargs): │ │ │ │ """ │ │ │ │ Return a Form class for use in the admin add view. This is used by │ │ │ │ add_view and change_view. │ │ │ │ """ │ │ │ │ if "fields" in kwargs: │ │ │ │ fields = kwargs.pop("fields") │ │ │ │ @@ -894,15 +895,15 @@ │ │ │ │ raise FieldError( │ │ │ │ "%s. Check fields/fieldsets/exclude attributes of class %s." │ │ │ │ % (e, self.__class__.__name__) │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_changelist(self, request, **kwargs): │ │ │ │ """ │ │ │ │ Return the ChangeList class for use on the changelist page. │ │ │ │ """ │ │ │ │ from django.contrib.admin.views.main import ChangeList │ │ │ │ │ │ │ │ return ChangeList
│ │ │ │ @@ -951,15 +952,15 @@ │ │ │ │ try: │ │ │ │ object_id = field.to_python(object_id) │ │ │ │ return queryset.get(**{field.name: object_id}) │ │ │ │ except (model.DoesNotExist, ValidationError, ValueError): │ │ │ │ return None │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_changelist_form(self, request, **kwargs): │ │ │ │ """ │ │ │ │ Return a Form class for use in the Formset on the changelist page. │ │ │ │ """ │ │ │ │ defaults = { │ │ │ │ "formfield_callback": partial(self.formfield_for_dbfield, request=request), │ │ │ │ **kwargs, │ │ │ │ @@ -969,15 +970,15 @@ │ │ │ │ ): │ │ │ │ defaults["fields"] = forms.ALL_FIELDS │ │ │ │ │ │ │ │ return modelform_factory(self.model, **defaults)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_changelist_formset(self, request, **kwargs): │ │ │ │ """ │ │ │ │ Return a FormSet class for use on the changelist page if list_editable │ │ │ │ is used. │ │ │ │ """ │ │ │ │ defaults = { │ │ │ │ "formfield_callback": partial(self.formfield_for_dbfield, request=request), │ │ │ │ @@ -989,25 +990,25 @@ │ │ │ │ extra=0, │ │ │ │ fields=self.list_editable, │ │ │ │ **defaults, │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_formsets_with_inlines(self, request, obj=None): │ │ │ │ """ │ │ │ │ Yield formsets and the corresponding inlines. │ │ │ │ """ │ │ │ │ for inline in self.get_inline_instances(request, obj): │ │ │ │ yield inline.get_formset(request, obj), inline
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_paginator( │ │ │ │ self, request, queryset, per_page, orphans=0, allow_empty_first_page=True │ │ │ │ ): │ │ │ │ return self.paginator(queryset, per_page, orphans, allow_empty_first_page)
│ │ │ │ │ │ │ │ │ │ │ │ def log_addition(self, request, obj, message): │ │ │ │ @@ -1103,15 +1104,15 @@ │ │ │ │ for permission in callable.allowed_permissions │ │ │ │ ) │ │ │ │ if any(has_permission(request) for has_permission in permission_checks): │ │ │ │ filtered_actions.append(action) │ │ │ │ return filtered_actions │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_actions(self, request): │ │ │ │ """ │ │ │ │ Return a dictionary mapping the names of all actions for this │ │ │ │ ModelAdmin to a tuple of (callable, name, description) for each action. │ │ │ │ """ │ │ │ │ # If self.actions is set to None that means actions are disabled on │ │ │ │ # this page. │ │ │ │ @@ -1156,25 +1157,25 @@ │ │ │ │ except KeyError: │ │ │ │ return None │ │ │ │ │ │ │ │ description = self._get_action_description(func, action) │ │ │ │ return func, action, description │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_list_display(self, request): │ │ │ │ """ │ │ │ │ Return a sequence containing the fields to be displayed on the │ │ │ │ changelist. │ │ │ │ """ │ │ │ │ return self.list_display
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_list_filter(self, request): │ │ │ │ """ │ │ │ │ Return a sequence containing the fields to be displayed as filters in │ │ │ │ the right sidebar of the changelist page. │ │ │ │ """ │ │ │ │ return self.list_filter
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_search_fields(self, request): │ │ │ │ """ │ │ │ │ Return a sequence containing the fields to be searched whenever │ │ │ │ somebody submits a search query. │ │ │ │ """ │ │ │ │ return self.search_fields
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_search_results(self, request, queryset, search_term): │ │ │ │ """ │ │ │ │ Return a tuple containing a queryset to implement the search │ │ │ │ and a boolean indicating if the results may contain duplicates. │ │ │ │ """ │ │ │ │ │ │ │ │ # Apply keyword searches. │ │ │ │ @@ -1302,15 +1303,15 @@ │ │ │ │ def construct_change_message(self, request, form, formsets, add=False): │ │ │ │ """ │ │ │ │ Construct a JSON structure describing changes from a changed object. │ │ │ │ """ │ │ │ │ return construct_change_message(form, formsets, add) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def message_user( │ │ │ │ self, request, message, level=messages.INFO, extra_tags="", fail_silently=False │ │ │ │ ): │ │ │ │ """ │ │ │ │ Send a message to the user. The default implementation │ │ │ │ posts a message using the django.contrib.messages backend. │ │ │ │ │ │ │ │ @@ -1340,49 +1341,49 @@ │ │ │ │ """ │ │ │ │ Given a ModelForm return an unsaved instance. ``change`` is True if │ │ │ │ the object is being changed, and False if it's being added. │ │ │ │ """ │ │ │ │ return form.save(commit=False) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def save_model(self, request, obj, form, change): │ │ │ │ """ │ │ │ │ Given a model instance save it to the database. │ │ │ │ """ │ │ │ │ obj.save()
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def delete_model(self, request, obj): │ │ │ │ """ │ │ │ │ Given a model instance delete it from the database. │ │ │ │ """ │ │ │ │ obj.delete()
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def delete_queryset(self, request, queryset): │ │ │ │ """Given a queryset, delete it from the database.""" │ │ │ │ queryset.delete()
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def save_formset(self, request, form, formset, change): │ │ │ │ """ │ │ │ │ Given an inline formset save it to the database. │ │ │ │ """ │ │ │ │ formset.save()
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ @@ -2685,35 +2686,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn..ooppttiioonnss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn..ooppttiioonnss ************ │ │ │ │ │ import copy │ │ │ │ │ import json │ │ │ │ │ import re │ │ │ │ │ from functools import partial, update_wrapper │ │ │ │ │ from urllib.parse import quote as urlquote │ │ │ │ │ │ │ │ │ │ from django import forms │ │ │ │ │ @@ -637,15 +637,15 @@ │ │ │ │ │ does not restrict access to the add, change or delete views. Use │ │ │ │ │ `ModelAdmin.has_(add|change|delete)_permission` for that. │ │ │ │ │ """ │ │ │ │ │ return request.user.has_module_perms(self.opts.app_label) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ModelAdmin(BaseModelAdmin): │ │ │ │ │ """Encapsulate all admin options and functionality for a given model.""" │ │ │ │ │ │ │ │ │ │ list_display = ("__str__",) │ │ │ │ │ list_display_links = () │ │ │ │ │ list_filter = () │ │ │ │ │ list_select_related = False │ │ │ │ │ @@ -691,15 +691,15 @@ │ │ │ │ │ def __repr__(self): │ │ │ │ │ return ( │ │ │ │ │ f"<{self.__class__.__qualname__}: model={self.model.__qualname__} " │ │ │ │ │ f"site={self.admin_site!r}>" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_inline_instances(self, request, obj=None): │ │ │ │ │ inline_instances = [] │ │ │ │ │ for inline_class in self.get_inlines(request, obj): │ │ │ │ │ inline = inline_class(self.model, self.admin_site) │ │ │ │ │ if request: │ │ │ │ │ if not ( │ │ │ │ │ inline.has_view_or_change_permission(request, obj) │ │ │ │ │ @@ -712,15 +712,15 @@ │ │ │ │ │ inline_instances.append(inline) │ │ │ │ │ │ │ │ │ │ return inline_instances │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_urls(self): │ │ │ │ │ from django.urls import path │ │ │ │ │ │ │ │ │ │ def wrap(view): │ │ │ │ │ def wrapper(*args, **kwargs): │ │ │ │ │ return self.admin_site.admin_view(view)(*args, **kwargs) │ │ │ │ │ │ │ │ │ │ @@ -794,15 +794,15 @@ │ │ │ │ │ "view": self.has_view_permission(request), │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ def _get_form_for_get_fields(self, request, obj): │ │ │ │ │ return self.get_form(request, obj, fields=None) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_form(self, request, obj=None, change=False, **kwargs): │ │ │ │ │ """ │ │ │ │ │ Return a Form class for use in the admin add view. This is used by │ │ │ │ │ add_view and change_view. │ │ │ │ │ """ │ │ │ │ │ if "fields" in kwargs: │ │ │ │ │ fields = kwargs.pop("fields") │ │ │ │ │ @@ -856,15 +856,15 @@ │ │ │ │ │ "%s. Check fields/fieldsets/exclude attributes of class %s." │ │ │ │ │ % (e, self.__class__.__name__) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_changelist(self, request, **kwargs): │ │ │ │ │ """ │ │ │ │ │ Return the ChangeList class for use on the changelist page. │ │ │ │ │ """ │ │ │ │ │ from django.contrib.admin.views.main import ChangeList │ │ │ │ │ │ │ │ │ │ return ChangeList │ │ │ │ │ @@ -915,15 +915,15 @@ │ │ │ │ │ try: │ │ │ │ │ object_id = field.to_python(object_id) │ │ │ │ │ return queryset.get(**{field.name: object_id}) │ │ │ │ │ except (model.DoesNotExist, ValidationError, ValueError): │ │ │ │ │ return None │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_changelist_form(self, request, **kwargs): │ │ │ │ │ """ │ │ │ │ │ Return a Form class for use in the Formset on the changelist page. │ │ │ │ │ """ │ │ │ │ │ defaults = { │ │ │ │ │ "formfield_callback": partial(self.formfield_for_dbfield, │ │ │ │ │ request=request), │ │ │ │ │ @@ -935,15 +935,15 @@ │ │ │ │ │ defaults["fields"] = forms.ALL_FIELDS │ │ │ │ │ │ │ │ │ │ return modelform_factory(self.model, **defaults) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_changelist_formset(self, request, **kwargs): │ │ │ │ │ """ │ │ │ │ │ Return a FormSet class for use on the changelist page if list_editable │ │ │ │ │ is used. │ │ │ │ │ """ │ │ │ │ │ defaults = { │ │ │ │ │ "formfield_callback": partial(self.formfield_for_dbfield, │ │ │ │ │ @@ -957,26 +957,26 @@ │ │ │ │ │ fields=self.list_editable, │ │ │ │ │ **defaults, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_formsets_with_inlines(self, request, obj=None): │ │ │ │ │ """ │ │ │ │ │ Yield formsets and the corresponding inlines. │ │ │ │ │ """ │ │ │ │ │ for inline in self.get_inline_instances(request, obj): │ │ │ │ │ yield inline.get_formset(request, obj), inline │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_paginator( │ │ │ │ │ self, request, queryset, per_page, orphans=0, │ │ │ │ │ allow_empty_first_page=True │ │ │ │ │ ): │ │ │ │ │ return self.paginator(queryset, per_page, orphans, │ │ │ │ │ allow_empty_first_page) │ │ │ │ │ │ │ │ │ │ @@ -1080,15 +1080,15 @@ │ │ │ │ │ ) │ │ │ │ │ if any(has_permission(request) for has_permission in │ │ │ │ │ permission_checks): │ │ │ │ │ filtered_actions.append(action) │ │ │ │ │ return filtered_actions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_actions(self, request): │ │ │ │ │ """ │ │ │ │ │ Return a dictionary mapping the names of all actions for this │ │ │ │ │ ModelAdmin to a tuple of (callable, name, description) for each action. │ │ │ │ │ """ │ │ │ │ │ # If self.actions is set to None that means actions are disabled on │ │ │ │ │ # this page. │ │ │ │ │ @@ -1136,26 +1136,26 @@ │ │ │ │ │ except KeyError: │ │ │ │ │ return None │ │ │ │ │ │ │ │ │ │ description = self._get_action_description(func, action) │ │ │ │ │ return func, action, description │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_list_display(self, request): │ │ │ │ │ """ │ │ │ │ │ Return a sequence containing the fields to be displayed on the │ │ │ │ │ changelist. │ │ │ │ │ """ │ │ │ │ │ return self.list_display │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_list_display_links(self, request, list_display): │ │ │ │ │ """ │ │ │ │ │ Return a sequence containing the fields to be displayed as links │ │ │ │ │ on the changelist. The list_display parameter is the list of fields │ │ │ │ │ returned by get_list_display(). │ │ │ │ │ """ │ │ │ │ │ if ( │ │ │ │ │ @@ -1167,48 +1167,48 @@ │ │ │ │ │ else: │ │ │ │ │ # Use only the first item in list_display as link │ │ │ │ │ return list(list_display)[:1] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_list_filter(self, request): │ │ │ │ │ """ │ │ │ │ │ Return a sequence containing the fields to be displayed as filters in │ │ │ │ │ the right sidebar of the changelist page. │ │ │ │ │ """ │ │ │ │ │ return self.list_filter │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_list_select_related(self, request): │ │ │ │ │ """ │ │ │ │ │ Return a list of fields to add to the select_related() part of the │ │ │ │ │ changelist items query. │ │ │ │ │ """ │ │ │ │ │ return self.list_select_related │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_search_fields(self, request): │ │ │ │ │ """ │ │ │ │ │ Return a sequence containing the fields to be searched whenever │ │ │ │ │ somebody submits a search query. │ │ │ │ │ """ │ │ │ │ │ return self.search_fields │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_search_results(self, request, queryset, search_term): │ │ │ │ │ """ │ │ │ │ │ Return a tuple containing a queryset to implement the search │ │ │ │ │ and a boolean indicating if the results may contain duplicates. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ # Apply keyword searches. │ │ │ │ │ @@ -1289,15 +1289,15 @@ │ │ │ │ │ def construct_change_message(self, request, form, formsets, add=False): │ │ │ │ │ """ │ │ │ │ │ Construct a JSON structure describing changes from a changed object. │ │ │ │ │ """ │ │ │ │ │ return construct_change_message(form, formsets, add) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def message_user( │ │ │ │ │ self, request, message, level=messages.INFO, extra_tags="", │ │ │ │ │ fail_silently=False │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Send a message to the user. The default implementation │ │ │ │ │ posts a message using the django.contrib.messages backend. │ │ │ │ │ @@ -1330,53 +1330,53 @@ │ │ │ │ │ """ │ │ │ │ │ Given a ModelForm return an unsaved instance. ``change`` is True if │ │ │ │ │ the object is being changed, and False if it's being added. │ │ │ │ │ """ │ │ │ │ │ return form.save(commit=False) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def save_model(self, request, obj, form, change): │ │ │ │ │ """ │ │ │ │ │ Given a model instance save it to the database. │ │ │ │ │ """ │ │ │ │ │ obj.save() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def delete_model(self, request, obj): │ │ │ │ │ """ │ │ │ │ │ Given a model instance delete it from the database. │ │ │ │ │ """ │ │ │ │ │ obj.delete() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def delete_queryset(self, request, queryset): │ │ │ │ │ """Given a queryset, delete it from the database.""" │ │ │ │ │ queryset.delete() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def save_formset(self, request, form, formset, change): │ │ │ │ │ """ │ │ │ │ │ Given an inline formset save it to the database. │ │ │ │ │ """ │ │ │ │ │ formset.save() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def save_related(self, request, form, formsets, change): │ │ │ │ │ """ │ │ │ │ │ Given the ``HttpRequest``, the parent ``ModelForm`` instance, the │ │ │ │ │ list of inline formsets and a boolean value based on whether the │ │ │ │ │ parent is being added or changed, save the related objects to the │ │ │ │ │ database. Note that at this point save_form() and save_model() have │ │ │ │ │ already been called. │ │ │ │ │ @@ -1452,15 +1452,15 @@ │ │ │ │ │ "admin/%s/change_form.html" % app_label, │ │ │ │ │ "admin/change_form.html", │ │ │ │ │ ], │ │ │ │ │ context, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def response_add(self, request, obj, post_url_continue=None): │ │ │ │ │ """ │ │ │ │ │ Determine the HttpResponse for the add_view stage. │ │ │ │ │ """ │ │ │ │ │ opts = obj._meta │ │ │ │ │ preserved_filters = self.get_preserved_filters(request) │ │ │ │ │ obj_url = reverse( │ │ │ │ │ @@ -1550,15 +1550,15 @@ │ │ │ │ │ ) │ │ │ │ │ self.message_user(request, msg, messages.SUCCESS) │ │ │ │ │ return self.response_post_save_add(request, obj) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def response_change(self, request, obj): │ │ │ │ │ """ │ │ │ │ │ Determine the HttpResponse for the change_view stage. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ if IS_POPUP_VAR in request.POST: │ │ │ │ │ opts = obj._meta │ │ │ │ │ @@ -1760,15 +1760,15 @@ │ │ │ │ │ return HttpResponseRedirect(request.get_full_path()) │ │ │ │ │ else: │ │ │ │ │ msg = _("No action selected.") │ │ │ │ │ self.message_user(request, msg, messages.WARNING) │ │ │ │ │ return None │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def response_delete(self, request, obj_display, obj_id): │ │ │ │ │ """ │ │ │ │ │ Determine the HttpResponse for the delete_view stage. │ │ │ │ │ """ │ │ │ │ │ if IS_POPUP_VAR in request.POST: │ │ │ │ │ popup_response_data = json.dumps( │ │ │ │ │ { │ │ │ │ │ @@ -1878,15 +1878,15 @@ │ │ │ │ │ has_delete_permission=has_delete_permission, │ │ │ │ │ has_view_permission=has_view_permission, │ │ │ │ │ ) │ │ │ │ │ inline_admin_formsets.append(inline_admin_formset) │ │ │ │ │ return inline_admin_formsets │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_changeform_initial_data(self, request): │ │ │ │ │ """ │ │ │ │ │ Get the initial form data from the request's GET params. │ │ │ │ │ """ │ │ │ │ │ initial = dict(request.GET.items()) │ │ │ │ │ for k in initial: │ │ │ │ │ try: │ │ │ │ │ @@ -2057,22 +2057,22 @@ │ │ │ │ │ │ │ │ │ │ return self.render_change_form( │ │ │ │ │ request, context, add=add, change=not add, obj=obj, │ │ │ │ │ form_url=form_url │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def add_view(self, request, form_url="", extra_context=None): │ │ │ │ │ return self.changeform_view(request, None, form_url, extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def change_view(self, request, object_id, form_url="", extra_context=None): │ │ │ │ │ return self.changeform_view(request, object_id, form_url, │ │ │ │ │ extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def _get_edited_object_pks(self, request, prefix): │ │ │ │ │ @@ -2096,15 +2096,15 @@ │ │ │ │ │ validate(pk) │ │ │ │ │ except ValidationError: │ │ │ │ │ # Disable the optimization if the POST data was tampered with. │ │ │ │ │ return queryset │ │ │ │ │ return queryset.filter(pk__in=object_pks) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @csrf_protect_m │ │ │ │ │ def changelist_view(self, request, extra_context=None): │ │ │ │ │ """ │ │ │ │ │ The 'change list' admin view for this model. │ │ │ │ │ """ │ │ │ │ │ from django.contrib.admin.views.main import ERROR_FLAG │ │ │ │ │ │ │ │ │ │ @@ -2289,26 +2289,26 @@ │ │ │ │ │ ], │ │ │ │ │ context, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_deleted_objects(self, objs, request): │ │ │ │ │ """ │ │ │ │ │ Hook for customizing the delete process for the delete view and the │ │ │ │ │ "delete selected" action. │ │ │ │ │ """ │ │ │ │ │ return get_deleted_objects(objs, request, self.admin_site) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @csrf_protect_m │ │ │ │ │ def delete_view(self, request, object_id, extra_context=None): │ │ │ │ │ with transaction.atomic(using=router.db_for_write(self.model)): │ │ │ │ │ return self._delete_view(request, object_id, extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -2379,15 +2379,15 @@ │ │ │ │ │ "to_field": to_field, │ │ │ │ │ **(extra_context or {}), │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ return self.render_delete_form(request, context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def history_view(self, request, object_id, extra_context=None): │ │ │ │ │ "The 'history' admin view for this model." │ │ │ │ │ from django.contrib.admin.models import LogEntry │ │ │ │ │ from django.contrib.admin.views.main import PAGE_VAR │ │ │ │ │ │ │ │ │ │ # First check if the user can see this history. │ │ │ │ │ model = self.model │ │ │ │ │ @@ -2444,15 +2444,15 @@ │ │ │ │ │ ], │ │ │ │ │ context, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_formset_kwargs(self, request, obj, inline, prefix): │ │ │ │ │ formset_params = { │ │ │ │ │ "instance": obj, │ │ │ │ │ "prefix": prefix, │ │ │ │ │ "queryset": inline.get_queryset(request), │ │ │ │ │ } │ │ │ │ │ if request.method == "POST": │ │ │ │ │ @@ -2729,24 +2729,24 @@ │ │ │ │ │ # also implies the 'view' permission. │ │ │ │ │ return self._has_any_perms_for_target_model(request, ["view", │ │ │ │ │ "change"]) │ │ │ │ │ return super().has_view_permission(request) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class StackedInline(InlineModelAdmin): │ │ │ │ │ template = "admin/edit_inline/stacked.html" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TabularInline(InlineModelAdmin): │ │ │ │ │ template = "admin/edit_inline/tabular.html" │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/sites.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.admin.sites — Django 4.2.13 documentation │ │ │ │ + django.contrib.admin.sites — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.admin.sites

│ │ │ │ +  

Codice sorgente per django.contrib.admin.sites

│ │ │ │  import re
│ │ │ │  from functools import update_wrapper
│ │ │ │  from weakref import WeakSet
│ │ │ │  
│ │ │ │  from django.apps import apps
│ │ │ │  from django.conf import settings
│ │ │ │  from django.contrib.admin import ModelAdmin, actions
│ │ │ │ @@ -104,15 +105,15 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  class NotRegistered(Exception):
│ │ │ │      pass
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AdminSite: │ │ │ │ """ │ │ │ │ An AdminSite object encapsulates an instance of the Django admin application, ready │ │ │ │ to be hooked in to your URLconf. Models are registered with the AdminSite using the │ │ │ │ register() method, and the get_urls() method can then be used to access Django view │ │ │ │ functions that present a full admin interface for the collection of registered │ │ │ │ models. │ │ │ │ @@ -169,15 +170,15 @@ │ │ │ │ ) │ │ │ │ for modeladmin in modeladmins: │ │ │ │ if modeladmin.model._meta.app_config in app_configs: │ │ │ │ errors.extend(modeladmin.check()) │ │ │ │ return errors │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def register(self, model_or_iterable, admin_class=None, **options): │ │ │ │ """ │ │ │ │ Register the given model(s) with the given admin class. │ │ │ │ │ │ │ │ The model(s) should be Model classes, not instances. │ │ │ │ │ │ │ │ If an admin class isn't given, use ModelAdmin (the default admin │ │ │ │ @@ -223,15 +224,15 @@ │ │ │ │ ) │ │ │ │ │ │ │ │ # Instantiate the admin class to save in the registry │ │ │ │ self._registry[model] = admin_class(model, self)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def unregister(self, model_or_iterable): │ │ │ │ """ │ │ │ │ Unregister the given model(s). │ │ │ │ │ │ │ │ If a model isn't already registered, raise NotRegistered. │ │ │ │ """ │ │ │ │ if isinstance(model_or_iterable, ModelBase): │ │ │ │ @@ -245,26 +246,26 @@ │ │ │ │ def is_registered(self, model): │ │ │ │ """ │ │ │ │ Check if a model class is registered with this `AdminSite`. │ │ │ │ """ │ │ │ │ return model in self._registry │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def add_action(self, action, name=None): │ │ │ │ """ │ │ │ │ Register an action to be available globally. │ │ │ │ """ │ │ │ │ name = name or action.__name__ │ │ │ │ self._actions[name] = action │ │ │ │ self._global_actions[name] = action
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def disable_action(self, name): │ │ │ │ """ │ │ │ │ Disable a globally-registered action. Raise KeyError for invalid names. │ │ │ │ """ │ │ │ │ del self._actions[name]
│ │ │ │ │ │ │ │ │ │ │ │ @@ -279,15 +280,15 @@ │ │ │ │ def actions(self): │ │ │ │ """ │ │ │ │ Get all the enabled actions as an iterable of (name, func). │ │ │ │ """ │ │ │ │ return self._actions.items() │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def has_permission(self, request): │ │ │ │ """ │ │ │ │ Return True if the given HttpRequest has permission to view │ │ │ │ *at least one* page in the admin site. │ │ │ │ """ │ │ │ │ return request.user.is_active and request.user.is_staff
│ │ │ │ │ │ │ │ @@ -404,15 +405,15 @@ │ │ │ │ return urlpatterns │ │ │ │ │ │ │ │ @property │ │ │ │ def urls(self): │ │ │ │ return self.get_urls(), "admin", self.name │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def each_context(self, request): │ │ │ │ """ │ │ │ │ Return a dictionary of variables to put in the template context for │ │ │ │ *every* page in the admin site. │ │ │ │ │ │ │ │ For sites running on a subpath, use the SCRIPT_NAME value if site_url │ │ │ │ hasn't been customized. │ │ │ │ @@ -618,15 +619,15 @@ │ │ │ │ "has_module_perms": has_module_perms, │ │ │ │ "models": [model_dict], │ │ │ │ } │ │ │ │ │ │ │ │ return app_dict │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_app_list(self, request, app_label=None): │ │ │ │ """ │ │ │ │ Return a sorted list of all the installed apps that have been │ │ │ │ registered in this site. │ │ │ │ """ │ │ │ │ app_dict = self._build_app_dict(request, app_label) │ │ │ │ │ │ │ │ @@ -709,35 +710,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn..ssiitteess ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn..ssiitteess ************ │ │ │ │ │ import re │ │ │ │ │ from functools import update_wrapper │ │ │ │ │ from weakref import WeakSet │ │ │ │ │ │ │ │ │ │ from django.apps import apps │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.contrib.admin import ModelAdmin, actions │ │ │ │ │ @@ -36,15 +36,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class NotRegistered(Exception): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AdminSite: │ │ │ │ │ """ │ │ │ │ │ An AdminSite object encapsulates an instance of the Django admin │ │ │ │ │ application, ready │ │ │ │ │ to be hooked in to your URLconf. Models are registered with the AdminSite │ │ │ │ │ using the │ │ │ │ │ register() method, and the get_urls() method can then be used to access │ │ │ │ │ @@ -105,15 +105,15 @@ │ │ │ │ │ ) │ │ │ │ │ for modeladmin in modeladmins: │ │ │ │ │ if modeladmin.model._meta.app_config in app_configs: │ │ │ │ │ errors.extend(modeladmin.check()) │ │ │ │ │ return errors │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def register(self, model_or_iterable, admin_class=None, **options): │ │ │ │ │ """ │ │ │ │ │ Register the given model(s) with the given admin class. │ │ │ │ │ │ │ │ │ │ The model(s) should be Model classes, not instances. │ │ │ │ │ │ │ │ │ │ If an admin class isn't given, use ModelAdmin (the default admin │ │ │ │ │ @@ -163,15 +163,15 @@ │ │ │ │ │ │ │ │ │ │ # Instantiate the admin class to save in the registry │ │ │ │ │ self._registry[model] = admin_class(model, self) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def unregister(self, model_or_iterable): │ │ │ │ │ """ │ │ │ │ │ Unregister the given model(s). │ │ │ │ │ │ │ │ │ │ If a model isn't already registered, raise NotRegistered. │ │ │ │ │ """ │ │ │ │ │ if isinstance(model_or_iterable, ModelBase): │ │ │ │ │ @@ -187,27 +187,27 @@ │ │ │ │ │ def is_registered(self, model): │ │ │ │ │ """ │ │ │ │ │ Check if a model class is registered with this `AdminSite`. │ │ │ │ │ """ │ │ │ │ │ return model in self._registry │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def add_action(self, action, name=None): │ │ │ │ │ """ │ │ │ │ │ Register an action to be available globally. │ │ │ │ │ """ │ │ │ │ │ name = name or action.__name__ │ │ │ │ │ self._actions[name] = action │ │ │ │ │ self._global_actions[name] = action │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def disable_action(self, name): │ │ │ │ │ """ │ │ │ │ │ Disable a globally-registered action. Raise KeyError for invalid names. │ │ │ │ │ """ │ │ │ │ │ del self._actions[name] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -223,15 +223,15 @@ │ │ │ │ │ def actions(self): │ │ │ │ │ """ │ │ │ │ │ Get all the enabled actions as an iterable of (name, func). │ │ │ │ │ """ │ │ │ │ │ return self._actions.items() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def has_permission(self, request): │ │ │ │ │ """ │ │ │ │ │ Return True if the given HttpRequest has permission to view │ │ │ │ │ *at least one* page in the admin site. │ │ │ │ │ """ │ │ │ │ │ return request.user.is_active and request.user.is_staff │ │ │ │ │ │ │ │ │ │ @@ -353,15 +353,15 @@ │ │ │ │ │ return urlpatterns │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ def urls(self): │ │ │ │ │ return self.get_urls(), "admin", self.name │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def each_context(self, request): │ │ │ │ │ """ │ │ │ │ │ Return a dictionary of variables to put in the template context for │ │ │ │ │ *every* page in the admin site. │ │ │ │ │ │ │ │ │ │ For sites running on a subpath, use the SCRIPT_NAME value if site_url │ │ │ │ │ hasn't been customized. │ │ │ │ │ @@ -573,15 +573,15 @@ │ │ │ │ │ "has_module_perms": has_module_perms, │ │ │ │ │ "models": [model_dict], │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ return app_dict │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_app_list(self, request, app_label=None): │ │ │ │ │ """ │ │ │ │ │ Return a sorted list of all the installed apps that have been │ │ │ │ │ registered in this site. │ │ │ │ │ """ │ │ │ │ │ app_dict = self._build_app_dict(request, app_label) │ │ │ │ │ │ │ │ │ │ @@ -656,12 +656,12 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # This global object represents the default admin site, for the common case. │ │ │ │ │ # You can provide your own AdminSite using the (Simple)AdminConfig.default_site │ │ │ │ │ # attribute. You can also instantiate AdminSite in your own code to create a │ │ │ │ │ # custom admin site. │ │ │ │ │ site = DefaultAdminSite() │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin/views/decorators.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.admin.views.decorators — Django 4.2.13 documentation │ │ │ │ + django.contrib.admin.views.decorators — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.admin.views.decorators

│ │ │ │ +  

Codice sorgente per django.contrib.admin.views.decorators

│ │ │ │  from django.contrib.auth import REDIRECT_FIELD_NAME
│ │ │ │  from django.contrib.auth.decorators import user_passes_test
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def staff_member_required( │ │ │ │ view_func=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url="admin:login" │ │ │ │ ): │ │ │ │ """ │ │ │ │ Decorator for views that checks that the user is logged in and is a staff │ │ │ │ member, redirecting to the login page if necessary. │ │ │ │ """ │ │ │ │ @@ -101,35 +102,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,17 +1,17 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn..vviieewwss..ddeeccoorraattoorrss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn..vviieewwss..ddeeccoorraattoorrss ************ │ │ │ │ │ from django.contrib.auth import REDIRECT_FIELD_NAME │ │ │ │ │ from django.contrib.auth.decorators import user_passes_test │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def staff_member_required( │ │ │ │ │ view_func=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url="admin: │ │ │ │ │ login" │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Decorator for views that checks that the user is logged in and is a staff │ │ │ │ │ member, redirecting to the login page if necessary. │ │ │ │ │ @@ -21,12 +21,12 @@ │ │ │ │ │ login_url=login_url, │ │ │ │ │ redirect_field_name=redirect_field_name, │ │ │ │ │ ) │ │ │ │ │ if view_func: │ │ │ │ │ return actual_decorator(view_func) │ │ │ │ │ return actual_decorator │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/admin.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.admin — Django 4.2.13 documentation │ │ │ │ + django.contrib.admin — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.admin

│ │ │ │ +  

Codice sorgente per django.contrib.admin

│ │ │ │  from django.contrib.admin.decorators import action, display, register
│ │ │ │  from django.contrib.admin.filters import (
│ │ │ │      AllValuesFieldListFilter,
│ │ │ │      BooleanFieldListFilter,
│ │ │ │      ChoicesFieldListFilter,
│ │ │ │      DateFieldListFilter,
│ │ │ │      EmptyFieldListFilter,
│ │ │ │ @@ -116,15 +117,15 @@
│ │ │ │      "EmptyFieldListFilter",
│ │ │ │      "RelatedOnlyFieldListFilter",
│ │ │ │      "autodiscover",
│ │ │ │  ]
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def autodiscover(): │ │ │ │ autodiscover_modules("admin", register_to=site)
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ @@ -132,35 +133,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aaddmmiinn ************ │ │ │ │ │ from django.contrib.admin.decorators import action, display, register │ │ │ │ │ from django.contrib.admin.filters import ( │ │ │ │ │ AllValuesFieldListFilter, │ │ │ │ │ BooleanFieldListFilter, │ │ │ │ │ ChoicesFieldListFilter, │ │ │ │ │ DateFieldListFilter, │ │ │ │ │ EmptyFieldListFilter, │ │ │ │ │ @@ -47,16 +47,16 @@ │ │ │ │ │ "EmptyFieldListFilter", │ │ │ │ │ "RelatedOnlyFieldListFilter", │ │ │ │ │ "autodiscover", │ │ │ │ │ ] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def autodiscover(): │ │ │ │ │ autodiscover_modules("admin", register_to=site) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/context_processors.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.auth.context_processors — Django 4.2.13 documentation │ │ │ │ + django.contrib.auth.context_processors — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.auth.context_processors

│ │ │ │ +  

Codice sorgente per django.contrib.auth.context_processors

│ │ │ │  # PermWrapper and PermLookupDict proxy the permissions system into objects that
│ │ │ │  # the template system can understand.
│ │ │ │  
│ │ │ │  
│ │ │ │  class PermLookupDict:
│ │ │ │      def __init__(self, user, app_label):
│ │ │ │          self.user, self.app_label = user, app_label
│ │ │ │ @@ -116,15 +117,15 @@
│ │ │ │              # The name refers to module.
│ │ │ │              return bool(self[perm_name])
│ │ │ │          app_label, perm_name = perm_name.split(".", 1)
│ │ │ │          return self[app_label][perm_name]
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def auth(request): │ │ │ │ """ │ │ │ │ Return context variables required by apps that use Django's authentication │ │ │ │ system. │ │ │ │ │ │ │ │ If there is no 'user' attribute in the request, use AnonymousUser (from │ │ │ │ django.contrib.auth). │ │ │ │ @@ -149,35 +150,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aauutthh..ccoonntteexxtt__pprroocceessssoorrss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aauutthh..ccoonntteexxtt__pprroocceessssoorrss ************ │ │ │ │ │ # PermWrapper and PermLookupDict proxy the permissions system into objects that │ │ │ │ │ # the template system can understand. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class PermLookupDict: │ │ │ │ │ def __init__(self, user, app_label): │ │ │ │ │ self.user, self.app_label = user, app_label │ │ │ │ │ @@ -47,15 +47,15 @@ │ │ │ │ │ # The name refers to module. │ │ │ │ │ return bool(self[perm_name]) │ │ │ │ │ app_label, perm_name = perm_name.split(".", 1) │ │ │ │ │ return self[app_label][perm_name] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def auth(request): │ │ │ │ │ """ │ │ │ │ │ Return context variables required by apps that use Django's authentication │ │ │ │ │ system. │ │ │ │ │ │ │ │ │ │ If there is no 'user' attribute in the request, use AnonymousUser (from │ │ │ │ │ django.contrib.auth). │ │ │ │ │ @@ -68,12 +68,12 @@ │ │ │ │ │ user = AnonymousUser() │ │ │ │ │ │ │ │ │ │ return { │ │ │ │ │ "user": user, │ │ │ │ │ "perms": PermWrapper(user), │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/decorators.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.auth.decorators — Django 4.2.13 documentation │ │ │ │ + django.contrib.auth.decorators — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.auth.decorators

│ │ │ │ +  

Codice sorgente per django.contrib.auth.decorators

│ │ │ │  from functools import wraps
│ │ │ │  from urllib.parse import urlparse
│ │ │ │  
│ │ │ │  from django.conf import settings
│ │ │ │  from django.contrib.auth import REDIRECT_FIELD_NAME
│ │ │ │  from django.core.exceptions import PermissionDenied
│ │ │ │  from django.shortcuts import resolve_url
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def user_passes_test( │ │ │ │ test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME │ │ │ │ ): │ │ │ │ """ │ │ │ │ Decorator for views that checks that the user passes the given test, │ │ │ │ redirecting to the log-in page if necessary. The test should be a callable │ │ │ │ that takes the user object and returns True if the user passes. │ │ │ │ @@ -113,15 +114,15 @@ │ │ │ │ return _wrapper_view │ │ │ │ │ │ │ │ return decorator
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def login_required( │ │ │ │ function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None │ │ │ │ ): │ │ │ │ """ │ │ │ │ Decorator for views that checks that the user is logged in, redirecting │ │ │ │ to the log-in page if necessary. │ │ │ │ """ │ │ │ │ @@ -133,15 +134,15 @@ │ │ │ │ if function: │ │ │ │ return actual_decorator(function) │ │ │ │ return actual_decorator
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def permission_required(perm, login_url=None, raise_exception=False): │ │ │ │ """ │ │ │ │ Decorator for views that checks whether a user has a particular permission │ │ │ │ enabled, redirecting to the log-in page if necessary. │ │ │ │ If the raise_exception parameter is given the PermissionDenied exception │ │ │ │ is raised. │ │ │ │ """ │ │ │ │ @@ -170,35 +171,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,22 +1,22 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aauutthh..ddeeccoorraattoorrss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aauutthh..ddeeccoorraattoorrss ************ │ │ │ │ │ from functools import wraps │ │ │ │ │ from urllib.parse import urlparse │ │ │ │ │ │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.contrib.auth import REDIRECT_FIELD_NAME │ │ │ │ │ from django.core.exceptions import PermissionDenied │ │ │ │ │ from django.shortcuts import resolve_url │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def user_passes_test( │ │ │ │ │ test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Decorator for views that checks that the user passes the given test, │ │ │ │ │ redirecting to the log-in page if necessary. The test should be a callable │ │ │ │ │ that takes the user object and returns True if the user passes. │ │ │ │ │ @@ -46,15 +46,15 @@ │ │ │ │ │ │ │ │ │ │ return decorator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def login_required( │ │ │ │ │ function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Decorator for views that checks that the user is logged in, redirecting │ │ │ │ │ to the log-in page if necessary. │ │ │ │ │ """ │ │ │ │ │ @@ -67,15 +67,15 @@ │ │ │ │ │ return actual_decorator(function) │ │ │ │ │ return actual_decorator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def permission_required(perm, login_url=None, raise_exception=False): │ │ │ │ │ """ │ │ │ │ │ Decorator for views that checks whether a user has a particular permission │ │ │ │ │ enabled, redirecting to the log-in page if necessary. │ │ │ │ │ If the raise_exception parameter is given the PermissionDenied exception │ │ │ │ │ is raised. │ │ │ │ │ """ │ │ │ │ │ @@ -92,12 +92,12 @@ │ │ │ │ │ if raise_exception: │ │ │ │ │ raise PermissionDenied │ │ │ │ │ # As the last resort, show the login form │ │ │ │ │ return False │ │ │ │ │ │ │ │ │ │ return user_passes_test(check_perms, login_url=login_url) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/hashers.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.auth.hashers — Django 4.2.13 documentation │ │ │ │ + django.contrib.auth.hashers — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.auth.hashers

│ │ │ │ +  

Codice sorgente per django.contrib.auth.hashers

│ │ │ │  import base64
│ │ │ │  import binascii
│ │ │ │  import functools
│ │ │ │  import hashlib
│ │ │ │  import importlib
│ │ │ │  import math
│ │ │ │  import warnings
│ │ │ │ @@ -97,26 +98,26 @@
│ │ │ │  UNUSABLE_PASSWORD_PREFIX = "!"  # This will never be a valid encoded hash
│ │ │ │  UNUSABLE_PASSWORD_SUFFIX_LENGTH = (
│ │ │ │      40  # number of random chars to add after UNUSABLE_PASSWORD_PREFIX
│ │ │ │  )
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def is_password_usable(encoded): │ │ │ │ """ │ │ │ │ Return True if this password wasn't generated by │ │ │ │ User.set_unusable_password(), i.e. make_password(None). │ │ │ │ """ │ │ │ │ return encoded is None or not encoded.startswith(UNUSABLE_PASSWORD_PREFIX)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def check_password(password, encoded, setter=None, preferred="default"): │ │ │ │ """ │ │ │ │ Return a boolean of whether the raw password matches the three │ │ │ │ part encoded digest. │ │ │ │ │ │ │ │ If setter is specified, it'll be called when you need to │ │ │ │ regenerate the password. │ │ │ │ @@ -145,15 +146,15 @@ │ │ │ │ if setter and is_correct and must_update: │ │ │ │ setter(password) │ │ │ │ return is_correct
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def make_password(password, salt=None, hasher="default"): │ │ │ │ """ │ │ │ │ Turn a plain-text password into a hash for database storage │ │ │ │ │ │ │ │ Same as encode() but generate a new random salt. If password is None then │ │ │ │ return a concatenation of UNUSABLE_PASSWORD_PREFIX and a random string, │ │ │ │ which disallows logins. Additional random string reduces chances of gaining │ │ │ │ @@ -972,35 +973,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aauutthh..hhaasshheerrss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aauutthh..hhaasshheerrss ************ │ │ │ │ │ import base64 │ │ │ │ │ import binascii │ │ │ │ │ import functools │ │ │ │ │ import hashlib │ │ │ │ │ import importlib │ │ │ │ │ import math │ │ │ │ │ import warnings │ │ │ │ │ @@ -29,27 +29,27 @@ │ │ │ │ │ UNUSABLE_PASSWORD_PREFIX = "!" # This will never be a valid encoded hash │ │ │ │ │ UNUSABLE_PASSWORD_SUFFIX_LENGTH = ( │ │ │ │ │ 40 # number of random chars to add after UNUSABLE_PASSWORD_PREFIX │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def is_password_usable(encoded): │ │ │ │ │ """ │ │ │ │ │ Return True if this password wasn't generated by │ │ │ │ │ User.set_unusable_password(), i.e. make_password(None). │ │ │ │ │ """ │ │ │ │ │ return encoded is None or not encoded.startswith(UNUSABLE_PASSWORD_PREFIX) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def check_password(password, encoded, setter=None, preferred="default"): │ │ │ │ │ """ │ │ │ │ │ Return a boolean of whether the raw password matches the three │ │ │ │ │ part encoded digest. │ │ │ │ │ │ │ │ │ │ If setter is specified, it'll be called when you need to │ │ │ │ │ regenerate the password. │ │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │ │ setter(password) │ │ │ │ │ return is_correct │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def make_password(password, salt=None, hasher="default"): │ │ │ │ │ """ │ │ │ │ │ Turn a plain-text password into a hash for database storage │ │ │ │ │ │ │ │ │ │ Same as encode() but generate a new random salt. If password is None then │ │ │ │ │ return a concatenation of UNUSABLE_PASSWORD_PREFIX and a random string, │ │ │ │ │ which disallows logins. Additional random string reduces chances of gaining │ │ │ │ │ @@ -904,12 +904,12 @@ │ │ │ │ │ _("algorithm"): decoded["algorithm"], │ │ │ │ │ _("salt"): decoded["salt"], │ │ │ │ │ _("hash"): mask_hash(decoded["hash"], show=3), │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ def harden_runtime(self, password, encoded): │ │ │ │ │ pass │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth/password_validation.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.auth.password_validation — Django 4.2.13 documentation │ │ │ │ + django.contrib.auth.password_validation — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.auth.password_validation

│ │ │ │ +  

Codice sorgente per django.contrib.auth.password_validation

│ │ │ │  import functools
│ │ │ │  import gzip
│ │ │ │  import re
│ │ │ │  from difflib import SequenceMatcher
│ │ │ │  from pathlib import Path
│ │ │ │  
│ │ │ │  from django.conf import settings
│ │ │ │ @@ -92,15 +93,15 @@
│ │ │ │  
│ │ │ │  @functools.lru_cache(maxsize=None)
│ │ │ │  def get_default_password_validators():
│ │ │ │      return get_password_validators(settings.AUTH_PASSWORD_VALIDATORS)
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_password_validators(validator_config): │ │ │ │ validators = [] │ │ │ │ for validator in validator_config: │ │ │ │ try: │ │ │ │ klass = import_string(validator["NAME"]) │ │ │ │ except ImportError: │ │ │ │ msg = ( │ │ │ │ @@ -111,15 +112,15 @@ │ │ │ │ validators.append(klass(**validator.get("OPTIONS", {}))) │ │ │ │ │ │ │ │ return validators
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate_password(password, user=None, password_validators=None): │ │ │ │ """ │ │ │ │ Validate that the password meets all validator requirements. │ │ │ │ │ │ │ │ If the password is valid, return ``None``. │ │ │ │ If the password is invalid, raise ValidationError with all error messages. │ │ │ │ """ │ │ │ │ @@ -133,30 +134,30 @@ │ │ │ │ errors.append(error) │ │ │ │ if errors: │ │ │ │ raise ValidationError(errors)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def password_changed(password, user=None, password_validators=None): │ │ │ │ """ │ │ │ │ Inform all validators that have implemented a password_changed() method │ │ │ │ that the password has been changed. │ │ │ │ """ │ │ │ │ if password_validators is None: │ │ │ │ password_validators = get_default_password_validators() │ │ │ │ for validator in password_validators: │ │ │ │ password_changed = getattr(validator, "password_changed", lambda *a: None) │ │ │ │ password_changed(password, user)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def password_validators_help_texts(password_validators=None): │ │ │ │ """ │ │ │ │ Return a list of all help texts of all configured validators. │ │ │ │ """ │ │ │ │ help_texts = [] │ │ │ │ if password_validators is None: │ │ │ │ password_validators = get_default_password_validators() │ │ │ │ @@ -178,15 +179,15 @@ │ │ │ │ return format_html("<ul>{}</ul>", help_items) if help_items else "" │ │ │ │ │ │ │ │ │ │ │ │ password_validators_help_text_html = lazy(_password_validators_help_text_html, str) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MinimumLengthValidator: │ │ │ │ """ │ │ │ │ Validate that the password is of a minimum length. │ │ │ │ """ │ │ │ │ │ │ │ │ def __init__(self, min_length=8): │ │ │ │ self.min_length = min_length │ │ │ │ @@ -241,15 +242,15 @@ │ │ │ │ pwd_len = len(password) │ │ │ │ length_bound_similarity = max_similarity / 2 * pwd_len │ │ │ │ value_len = len(value) │ │ │ │ return pwd_len >= 10 * value_len and value_len < length_bound_similarity │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class UserAttributeSimilarityValidator: │ │ │ │ """ │ │ │ │ Validate that the password is sufficiently different from the user's │ │ │ │ attributes. │ │ │ │ │ │ │ │ If no specific attributes are provided, look at a sensible list of │ │ │ │ defaults. Attributes that don't exist are ignored. Comparison is made to │ │ │ │ @@ -302,15 +303,15 @@ │ │ │ │ return _( │ │ │ │ "Your password can’t be too similar to your other personal information." │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class CommonPasswordValidator: │ │ │ │ """ │ │ │ │ Validate that the password is not a common password. │ │ │ │ │ │ │ │ The password is rejected if it occurs in a provided list of passwords, │ │ │ │ which may be gzipped. The list Django ships with contains 20000 common │ │ │ │ passwords (lowercased and deduplicated), created by Royce Williams: │ │ │ │ @@ -341,15 +342,15 @@ │ │ │ │ │ │ │ │ def get_help_text(self): │ │ │ │ return _("Your password can’t be a commonly used password.")
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class NumericPasswordValidator: │ │ │ │ """ │ │ │ │ Validate that the password is not entirely numeric. │ │ │ │ """ │ │ │ │ │ │ │ │ def validate(self, password, user=None): │ │ │ │ if password.isdigit(): │ │ │ │ @@ -369,35 +370,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aauutthh..ppaasssswwoorrdd__vvaalliiddaattiioonn ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aauutthh..ppaasssswwoorrdd__vvaalliiddaattiioonn ************ │ │ │ │ │ import functools │ │ │ │ │ import gzip │ │ │ │ │ import re │ │ │ │ │ from difflib import SequenceMatcher │ │ │ │ │ from pathlib import Path │ │ │ │ │ │ │ │ │ │ from django.conf import settings │ │ │ │ │ @@ -23,15 +23,15 @@ │ │ │ │ │ │ │ │ │ │ @functools.lru_cache(maxsize=None) │ │ │ │ │ def get_default_password_validators(): │ │ │ │ │ return get_password_validators(settings.AUTH_PASSWORD_VALIDATORS) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_password_validators(validator_config): │ │ │ │ │ validators = [] │ │ │ │ │ for validator in validator_config: │ │ │ │ │ try: │ │ │ │ │ klass = import_string(validator["NAME"]) │ │ │ │ │ except ImportError: │ │ │ │ │ msg = ( │ │ │ │ │ @@ -43,15 +43,15 @@ │ │ │ │ │ │ │ │ │ │ return validators │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate_password(password, user=None, password_validators=None): │ │ │ │ │ """ │ │ │ │ │ Validate that the password meets all validator requirements. │ │ │ │ │ │ │ │ │ │ If the password is valid, return ``None``. │ │ │ │ │ If the password is invalid, raise ValidationError with all error messages. │ │ │ │ │ """ │ │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ if errors: │ │ │ │ │ raise ValidationError(errors) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def password_changed(password, user=None, password_validators=None): │ │ │ │ │ """ │ │ │ │ │ Inform all validators that have implemented a password_changed() method │ │ │ │ │ that the password has been changed. │ │ │ │ │ """ │ │ │ │ │ if password_validators is None: │ │ │ │ │ password_validators = get_default_password_validators() │ │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ None) │ │ │ │ │ password_changed(password, user) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def password_validators_help_texts(password_validators=None): │ │ │ │ │ """ │ │ │ │ │ Return a list of all help texts of all configured validators. │ │ │ │ │ """ │ │ │ │ │ help_texts = [] │ │ │ │ │ if password_validators is None: │ │ │ │ │ password_validators = get_default_password_validators() │ │ │ │ │ @@ -115,15 +115,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ password_validators_help_text_html = lazy(_password_validators_help_text_html, │ │ │ │ │ str) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MinimumLengthValidator: │ │ │ │ │ """ │ │ │ │ │ Validate that the password is of a minimum length. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def __init__(self, min_length=8): │ │ │ │ │ self.min_length = min_length │ │ │ │ │ @@ -179,15 +179,15 @@ │ │ │ │ │ pwd_len = len(password) │ │ │ │ │ length_bound_similarity = max_similarity / 2 * pwd_len │ │ │ │ │ value_len = len(value) │ │ │ │ │ return pwd_len >= 10 * value_len and value_len < length_bound_similarity │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class UserAttributeSimilarityValidator: │ │ │ │ │ """ │ │ │ │ │ Validate that the password is sufficiently different from the user's │ │ │ │ │ attributes. │ │ │ │ │ │ │ │ │ │ If no specific attributes are provided, look at a sensible list of │ │ │ │ │ defaults. Attributes that don't exist are ignored. Comparison is made to │ │ │ │ │ @@ -244,15 +244,15 @@ │ │ │ │ │ information." │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class CommonPasswordValidator: │ │ │ │ │ """ │ │ │ │ │ Validate that the password is not a common password. │ │ │ │ │ │ │ │ │ │ The password is rejected if it occurs in a provided list of passwords, │ │ │ │ │ which may be gzipped. The list Django ships with contains 20000 common │ │ │ │ │ passwords (lowercased and deduplicated), created by Royce Williams: │ │ │ │ │ @@ -285,15 +285,15 @@ │ │ │ │ │ def get_help_text(self): │ │ │ │ │ return _("Your password can’t be a commonly used password.") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class NumericPasswordValidator: │ │ │ │ │ """ │ │ │ │ │ Validate that the password is not entirely numeric. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def validate(self, password, user=None): │ │ │ │ │ if password.isdigit(): │ │ │ │ │ @@ -301,12 +301,12 @@ │ │ │ │ │ _("This password is entirely numeric."), │ │ │ │ │ code="password_entirely_numeric", │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ def get_help_text(self): │ │ │ │ │ return _("Your password can’t be entirely numeric.") │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/auth.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.auth — Django 4.2.13 documentation │ │ │ │ + django.contrib.auth — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.auth

│ │ │ │ +  

Codice sorgente per django.contrib.auth

│ │ │ │  import inspect
│ │ │ │  import re
│ │ │ │  
│ │ │ │  from django.apps import apps as django_apps
│ │ │ │  from django.conf import settings
│ │ │ │  from django.core.exceptions import ImproperlyConfigured, PermissionDenied
│ │ │ │  from django.middleware.csrf import rotate_token
│ │ │ │ @@ -130,15 +131,15 @@
│ │ │ │  def _get_user_session_key(request):
│ │ │ │      # This value in the session is always serialized to a string, so we need
│ │ │ │      # to convert it back to Python whenever we access it.
│ │ │ │      return get_user_model()._meta.pk.to_python(request.session[SESSION_KEY])
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @sensitive_variables("credentials") │ │ │ │ def authenticate(request=None, **credentials): │ │ │ │ """ │ │ │ │ If the given credentials are valid, return a User object. │ │ │ │ """ │ │ │ │ for backend, backend_path in _get_backends(return_tuples=True): │ │ │ │ backend_signature = inspect.signature(backend.authenticate) │ │ │ │ @@ -164,15 +165,15 @@ │ │ │ │ user_login_failed.send( │ │ │ │ sender=__name__, credentials=_clean_credentials(credentials), request=request │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def login(request, user, backend=None): │ │ │ │ """ │ │ │ │ Persist a user id and a backend in the request. This way a user doesn't │ │ │ │ have to reauthenticate on every request. Note that data set during │ │ │ │ the anonymous session is retained when the user logs in. │ │ │ │ """ │ │ │ │ session_auth_hash = "" │ │ │ │ @@ -220,15 +221,15 @@ │ │ │ │ request.user = user │ │ │ │ rotate_token(request) │ │ │ │ user_logged_in.send(sender=user.__class__, request=request, user=user)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def logout(request): │ │ │ │ """ │ │ │ │ Remove the authenticated user's ID from the request and flush their session │ │ │ │ data. │ │ │ │ """ │ │ │ │ # Dispatch the signal before the user is logged out so the receivers have a │ │ │ │ # chance to find out *who* logged out. │ │ │ │ @@ -241,15 +242,15 @@ │ │ │ │ from django.contrib.auth.models import AnonymousUser │ │ │ │ │ │ │ │ request.user = AnonymousUser()
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_user_model(): │ │ │ │ """ │ │ │ │ Return the User model that is active in this project. │ │ │ │ """ │ │ │ │ try: │ │ │ │ return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False) │ │ │ │ except ValueError: │ │ │ │ @@ -261,15 +262,15 @@ │ │ │ │ "AUTH_USER_MODEL refers to model '%s' that has not been installed" │ │ │ │ % settings.AUTH_USER_MODEL │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_user(request): │ │ │ │ """ │ │ │ │ Return the user model instance associated with the given request session. │ │ │ │ If no user is retrieved, return an instance of `AnonymousUser`. │ │ │ │ """ │ │ │ │ from .models import AnonymousUser │ │ │ │ │ │ │ │ @@ -315,15 +316,15 @@ │ │ │ │ """ │ │ │ │ Return the codename of the permission for the specified action. │ │ │ │ """ │ │ │ │ return "%s_%s" % (action, opts.model_name) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def update_session_auth_hash(request, user): │ │ │ │ """ │ │ │ │ Updating a user's password logs out all sessions for the user. │ │ │ │ │ │ │ │ Take the current request and the updated user object from which the new │ │ │ │ session hash will be derived and update the session hash appropriately to │ │ │ │ prevent a password change from logging out the session from which the │ │ │ │ @@ -341,35 +342,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..aauutthh ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..aauutthh ************ │ │ │ │ │ import inspect │ │ │ │ │ import re │ │ │ │ │ │ │ │ │ │ from django.apps import apps as django_apps │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.core.exceptions import ImproperlyConfigured, PermissionDenied │ │ │ │ │ from django.middleware.csrf import rotate_token │ │ │ │ │ @@ -62,15 +62,15 @@ │ │ │ │ │ def _get_user_session_key(request): │ │ │ │ │ # This value in the session is always serialized to a string, so we need │ │ │ │ │ # to convert it back to Python whenever we access it. │ │ │ │ │ return get_user_model()._meta.pk.to_python(request.session[SESSION_KEY]) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @sensitive_variables("credentials") │ │ │ │ │ def authenticate(request=None, **credentials): │ │ │ │ │ """ │ │ │ │ │ If the given credentials are valid, return a User object. │ │ │ │ │ """ │ │ │ │ │ for backend, backend_path in _get_backends(return_tuples=True): │ │ │ │ │ backend_signature = inspect.signature(backend.authenticate) │ │ │ │ │ @@ -98,15 +98,15 @@ │ │ │ │ │ request=request │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def login(request, user, backend=None): │ │ │ │ │ """ │ │ │ │ │ Persist a user id and a backend in the request. This way a user doesn't │ │ │ │ │ have to reauthenticate on every request. Note that data set during │ │ │ │ │ the anonymous session is retained when the user logs in. │ │ │ │ │ """ │ │ │ │ │ session_auth_hash = "" │ │ │ │ │ @@ -156,15 +156,15 @@ │ │ │ │ │ rotate_token(request) │ │ │ │ │ user_logged_in.send(sender=user.__class__, request=request, user=user) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def logout(request): │ │ │ │ │ """ │ │ │ │ │ Remove the authenticated user's ID from the request and flush their session │ │ │ │ │ data. │ │ │ │ │ """ │ │ │ │ │ # Dispatch the signal before the user is logged out so the receivers have a │ │ │ │ │ # chance to find out *who* logged out. │ │ │ │ │ @@ -178,15 +178,15 @@ │ │ │ │ │ │ │ │ │ │ request.user = AnonymousUser() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_user_model(): │ │ │ │ │ """ │ │ │ │ │ Return the User model that is active in this project. │ │ │ │ │ """ │ │ │ │ │ try: │ │ │ │ │ return django_apps.get_model(settings.AUTH_USER_MODEL, │ │ │ │ │ require_ready=False) │ │ │ │ │ @@ -200,15 +200,15 @@ │ │ │ │ │ % settings.AUTH_USER_MODEL │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_user(request): │ │ │ │ │ """ │ │ │ │ │ Return the user model instance associated with the given request session. │ │ │ │ │ If no user is retrieved, return an instance of `AnonymousUser`. │ │ │ │ │ """ │ │ │ │ │ from .models import AnonymousUser │ │ │ │ │ │ │ │ │ │ @@ -256,26 +256,26 @@ │ │ │ │ │ """ │ │ │ │ │ Return the codename of the permission for the specified action. │ │ │ │ │ """ │ │ │ │ │ return "%s_%s" % (action, opts.model_name) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def update_session_auth_hash(request, user): │ │ │ │ │ """ │ │ │ │ │ Updating a user's password logs out all sessions for the user. │ │ │ │ │ │ │ │ │ │ Take the current request and the updated user object from which the new │ │ │ │ │ session hash will be derived and update the session hash appropriately to │ │ │ │ │ prevent a password change from logging out the session from which the │ │ │ │ │ password was changed. │ │ │ │ │ """ │ │ │ │ │ request.session.cycle_key() │ │ │ │ │ if hasattr(user, "get_session_auth_hash") and request.user == user: │ │ │ │ │ request.session[HASH_SESSION_KEY] = user.get_session_auth_hash() │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/flatpages/sitemaps.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.flatpages.sitemaps — Django 4.2.13 documentation │ │ │ │ + django.contrib.flatpages.sitemaps — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.flatpages.sitemaps

│ │ │ │ +  

Codice sorgente per django.contrib.flatpages.sitemaps

│ │ │ │  from django.apps import apps as django_apps
│ │ │ │  from django.contrib.sitemaps import Sitemap
│ │ │ │  from django.core.exceptions import ImproperlyConfigured
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FlatPageSitemap(Sitemap): │ │ │ │ def items(self): │ │ │ │ if not django_apps.is_installed("django.contrib.sites"): │ │ │ │ raise ImproperlyConfigured( │ │ │ │ "FlatPageSitemap requires django.contrib.sites, which isn't installed." │ │ │ │ ) │ │ │ │ Site = django_apps.get_model("sites.Site") │ │ │ │ @@ -96,35 +97,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,27 +1,27 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ffllaattppaaggeess..ssiitteemmaappss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ffllaattppaaggeess..ssiitteemmaappss ************ │ │ │ │ │ from django.apps import apps as django_apps │ │ │ │ │ from django.contrib.sitemaps import Sitemap │ │ │ │ │ from django.core.exceptions import ImproperlyConfigured │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FlatPageSitemap(Sitemap): │ │ │ │ │ def items(self): │ │ │ │ │ if not django_apps.is_installed("django.contrib.sites"): │ │ │ │ │ raise ImproperlyConfigured( │ │ │ │ │ "FlatPageSitemap requires django.contrib.sites, which isn't │ │ │ │ │ installed." │ │ │ │ │ ) │ │ │ │ │ Site = django_apps.get_model("sites.Site") │ │ │ │ │ current_site = Site.objects.get_current() │ │ │ │ │ return current_site.flatpage_set.filter(registration_required=False) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/aggregates.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.db.models.aggregates — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.db.models.aggregates — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.db.models.aggregates

│ │ │ │ +  

Codice sorgente per django.contrib.gis.db.models.aggregates

│ │ │ │  from django.contrib.gis.db.models.fields import (
│ │ │ │      ExtentField,
│ │ │ │      GeometryCollectionField,
│ │ │ │      GeometryField,
│ │ │ │      LineStringField,
│ │ │ │  )
│ │ │ │  from django.db.models import Aggregate, Value
│ │ │ │ @@ -127,59 +128,59 @@
│ │ │ │                  raise ValueError(
│ │ │ │                      "Geospatial aggregates only allowed on geometry fields."
│ │ │ │                  )
│ │ │ │          return c
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Collect(GeoAggregate): │ │ │ │ name = "Collect" │ │ │ │ output_field_class = GeometryCollectionField
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Extent(GeoAggregate): │ │ │ │ name = "Extent" │ │ │ │ is_extent = "2D" │ │ │ │ │ │ │ │ def __init__(self, expression, **extra): │ │ │ │ super().__init__(expression, output_field=ExtentField(), **extra) │ │ │ │ │ │ │ │ def convert_value(self, value, expression, connection): │ │ │ │ return connection.ops.convert_extent(value)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Extent3D(GeoAggregate): │ │ │ │ name = "Extent3D" │ │ │ │ is_extent = "3D" │ │ │ │ │ │ │ │ def __init__(self, expression, **extra): │ │ │ │ super().__init__(expression, output_field=ExtentField(), **extra) │ │ │ │ │ │ │ │ def convert_value(self, value, expression, connection): │ │ │ │ return connection.ops.convert_extent3d(value)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MakeLine(GeoAggregate): │ │ │ │ name = "MakeLine" │ │ │ │ output_field_class = LineStringField
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Union(GeoAggregate): │ │ │ │ name = "Union" │ │ │ │ output_field_class = GeometryField
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ @@ -188,35 +189,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ddbb..mmooddeellss..aaggggrreeggaatteess ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ddbb..mmooddeellss..aaggggrreeggaatteess ************ │ │ │ │ │ from django.contrib.gis.db.models.fields import ( │ │ │ │ │ ExtentField, │ │ │ │ │ GeometryCollectionField, │ │ │ │ │ GeometryField, │ │ │ │ │ LineStringField, │ │ │ │ │ ) │ │ │ │ │ from django.db.models import Aggregate, Value │ │ │ │ │ @@ -63,65 +63,65 @@ │ │ │ │ │ raise ValueError( │ │ │ │ │ "Geospatial aggregates only allowed on geometry fields." │ │ │ │ │ ) │ │ │ │ │ return c │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Collect(GeoAggregate): │ │ │ │ │ name = "Collect" │ │ │ │ │ output_field_class = GeometryCollectionField │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Extent(GeoAggregate): │ │ │ │ │ name = "Extent" │ │ │ │ │ is_extent = "2D" │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, **extra): │ │ │ │ │ super().__init__(expression, output_field=ExtentField(), **extra) │ │ │ │ │ │ │ │ │ │ def convert_value(self, value, expression, connection): │ │ │ │ │ return connection.ops.convert_extent(value) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Extent3D(GeoAggregate): │ │ │ │ │ name = "Extent3D" │ │ │ │ │ is_extent = "3D" │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, **extra): │ │ │ │ │ super().__init__(expression, output_field=ExtentField(), **extra) │ │ │ │ │ │ │ │ │ │ def convert_value(self, value, expression, connection): │ │ │ │ │ return connection.ops.convert_extent3d(value) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MakeLine(GeoAggregate): │ │ │ │ │ name = "MakeLine" │ │ │ │ │ output_field_class = LineStringField │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Union(GeoAggregate): │ │ │ │ │ name = "Union" │ │ │ │ │ output_field_class = GeometryField │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/fields.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.db.models.fields — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.db.models.fields — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.db.models.fields

│ │ │ │ +  

Codice sorgente per django.contrib.gis.db.models.fields

│ │ │ │  from collections import defaultdict, namedtuple
│ │ │ │  
│ │ │ │  from django.contrib.gis import forms, gdal
│ │ │ │  from django.contrib.gis.db.models.proxy import SpatialProxy
│ │ │ │  from django.contrib.gis.gdal.error import GDALException
│ │ │ │  from django.contrib.gis.geos import (
│ │ │ │      GeometryCollection,
│ │ │ │ @@ -294,15 +295,15 @@
│ │ │ │  
│ │ │ │          # Assigning the SRID value.
│ │ │ │          obj.srid = self.get_srid(obj)
│ │ │ │          return obj
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeometryField(BaseSpatialField): │ │ │ │ """ │ │ │ │ The base Geometry field -- maps to the OpenGIS Specification Geometry type. │ │ │ │ """ │ │ │ │ │ │ │ │ description = _( │ │ │ │ "The base Geometry field — maps to the OpenGIS Specification Geometry type." │ │ │ │ @@ -398,75 +399,75 @@ │ │ │ │ return compiler.connection.ops.select % sql, params │ │ │ │ return sql, params
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # The OpenGIS Geometry Type Fields │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class PointField(GeometryField): │ │ │ │ geom_type = "POINT" │ │ │ │ geom_class = Point │ │ │ │ form_class = forms.PointField │ │ │ │ description = _("Point")
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class LineStringField(GeometryField): │ │ │ │ geom_type = "LINESTRING" │ │ │ │ geom_class = LineString │ │ │ │ form_class = forms.LineStringField │ │ │ │ description = _("Line string")
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class PolygonField(GeometryField): │ │ │ │ geom_type = "POLYGON" │ │ │ │ geom_class = Polygon │ │ │ │ form_class = forms.PolygonField │ │ │ │ description = _("Polygon")
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiPointField(GeometryField): │ │ │ │ geom_type = "MULTIPOINT" │ │ │ │ geom_class = MultiPoint │ │ │ │ form_class = forms.MultiPointField │ │ │ │ description = _("Multi-point")
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiLineStringField(GeometryField): │ │ │ │ geom_type = "MULTILINESTRING" │ │ │ │ geom_class = MultiLineString │ │ │ │ form_class = forms.MultiLineStringField │ │ │ │ description = _("Multi-line string")
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiPolygonField(GeometryField): │ │ │ │ geom_type = "MULTIPOLYGON" │ │ │ │ geom_class = MultiPolygon │ │ │ │ form_class = forms.MultiPolygonField │ │ │ │ description = _("Multi polygon")
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeometryCollectionField(GeometryField): │ │ │ │ geom_type = "GEOMETRYCOLLECTION" │ │ │ │ geom_class = GeometryCollection │ │ │ │ form_class = forms.GeometryCollectionField │ │ │ │ description = _("Geometry collection")
│ │ │ │ │ │ │ │ │ │ │ │ @@ -481,15 +482,15 @@ │ │ │ │ │ │ │ │ def select_format(self, compiler, sql, params): │ │ │ │ select = compiler.connection.ops.select_extent │ │ │ │ return select % sql if select else sql, params │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RasterField(BaseSpatialField): │ │ │ │ """ │ │ │ │ Raster field for GeoDjango -- evaluates into GDALRaster objects. │ │ │ │ """ │ │ │ │ │ │ │ │ description = _("Raster Field") │ │ │ │ geom_type = "RASTER" │ │ │ │ @@ -542,35 +543,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ddbb..mmooddeellss..ffiieellddss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ddbb..mmooddeellss..ffiieellddss ************ │ │ │ │ │ from collections import defaultdict, namedtuple │ │ │ │ │ │ │ │ │ │ from django.contrib.gis import forms, gdal │ │ │ │ │ from django.contrib.gis.db.models.proxy import SpatialProxy │ │ │ │ │ from django.contrib.gis.gdal.error import GDALException │ │ │ │ │ from django.contrib.gis.geos import ( │ │ │ │ │ GeometryCollection, │ │ │ │ │ @@ -231,15 +231,15 @@ │ │ │ │ │ │ │ │ │ │ # Assigning the SRID value. │ │ │ │ │ obj.srid = self.get_srid(obj) │ │ │ │ │ return obj │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeometryField(BaseSpatialField): │ │ │ │ │ """ │ │ │ │ │ The base Geometry field -- maps to the OpenGIS Specification Geometry type. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ description = _( │ │ │ │ │ "The base Geometry field — maps to the OpenGIS Specification Geometry │ │ │ │ │ @@ -338,81 +338,81 @@ │ │ │ │ │ return sql, params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # The OpenGIS Geometry Type Fields │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class PointField(GeometryField): │ │ │ │ │ geom_type = "POINT" │ │ │ │ │ geom_class = Point │ │ │ │ │ form_class = forms.PointField │ │ │ │ │ description = _("Point") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class LineStringField(GeometryField): │ │ │ │ │ geom_type = "LINESTRING" │ │ │ │ │ geom_class = LineString │ │ │ │ │ form_class = forms.LineStringField │ │ │ │ │ description = _("Line string") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class PolygonField(GeometryField): │ │ │ │ │ geom_type = "POLYGON" │ │ │ │ │ geom_class = Polygon │ │ │ │ │ form_class = forms.PolygonField │ │ │ │ │ description = _("Polygon") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiPointField(GeometryField): │ │ │ │ │ geom_type = "MULTIPOINT" │ │ │ │ │ geom_class = MultiPoint │ │ │ │ │ form_class = forms.MultiPointField │ │ │ │ │ description = _("Multi-point") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiLineStringField(GeometryField): │ │ │ │ │ geom_type = "MULTILINESTRING" │ │ │ │ │ geom_class = MultiLineString │ │ │ │ │ form_class = forms.MultiLineStringField │ │ │ │ │ description = _("Multi-line string") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiPolygonField(GeometryField): │ │ │ │ │ geom_type = "MULTIPOLYGON" │ │ │ │ │ geom_class = MultiPolygon │ │ │ │ │ form_class = forms.MultiPolygonField │ │ │ │ │ description = _("Multi polygon") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeometryCollectionField(GeometryField): │ │ │ │ │ geom_type = "GEOMETRYCOLLECTION" │ │ │ │ │ geom_class = GeometryCollection │ │ │ │ │ form_class = forms.GeometryCollectionField │ │ │ │ │ description = _("Geometry collection") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -428,15 +428,15 @@ │ │ │ │ │ │ │ │ │ │ def select_format(self, compiler, sql, params): │ │ │ │ │ select = compiler.connection.ops.select_extent │ │ │ │ │ return select % sql if select else sql, params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RasterField(BaseSpatialField): │ │ │ │ │ """ │ │ │ │ │ Raster field for GeoDjango -- evaluates into GDALRaster objects. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ description = _("Raster Field") │ │ │ │ │ geom_type = "RASTER" │ │ │ │ │ @@ -478,12 +478,12 @@ │ │ │ │ │ (RasterBandTransform,), │ │ │ │ │ {"band_index": band_index}, │ │ │ │ │ ) │ │ │ │ │ except ValueError: │ │ │ │ │ pass │ │ │ │ │ return super().get_transform(name) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/db/models/functions.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.db.models.functions — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.db.models.functions — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.db.models.functions

│ │ │ │ +  

Codice sorgente per django.contrib.gis.db.models.functions

│ │ │ │  from decimal import Decimal
│ │ │ │  
│ │ │ │  from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
│ │ │ │  from django.contrib.gis.db.models.sql import AreaField, DistanceField
│ │ │ │  from django.contrib.gis.geos import GEOSGeometry
│ │ │ │  from django.core.exceptions import FieldError
│ │ │ │  from django.db import NotSupportedError
│ │ │ │ @@ -222,15 +223,15 @@
│ │ │ │          )
│ │ │ │          clone = self.copy()
│ │ │ │          clone.set_source_expressions([*self.get_source_expressions(), tolerance])
│ │ │ │          return clone.as_sql(compiler, connection, **extra_context)
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Area(OracleToleranceMixin, GeoFunc): │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ @cached_property │ │ │ │ def output_field(self): │ │ │ │ return AreaField(self.geo_field) │ │ │ │ │ │ │ │ @@ -248,24 +249,24 @@ │ │ │ │ extra_context["template"] = "%(function)s(%(expressions)s, %(spheroid)d)" │ │ │ │ extra_context["spheroid"] = True │ │ │ │ return self.as_sql(compiler, connection, **extra_context)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Azimuth(GeoFunc): │ │ │ │ output_field = FloatField() │ │ │ │ arity = 2 │ │ │ │ geom_param_pos = (0, 1)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AsGeoJSON(GeoFunc): │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ def __init__(self, expression, bbox=False, crs=False, precision=8, **extra): │ │ │ │ expressions = [expression] │ │ │ │ if precision is not None: │ │ │ │ expressions.append(self._handle_param(precision, "precision", int)) │ │ │ │ @@ -285,15 +286,15 @@ │ │ │ │ clone = self.copy() │ │ │ │ clone.set_source_expressions(source_expressions[:1]) │ │ │ │ return super(AsGeoJSON, clone).as_sql(compiler, connection, **extra_context)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AsGML(GeoFunc): │ │ │ │ geom_param_pos = (1,) │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ def __init__(self, expression, version=2, precision=8, **extra): │ │ │ │ expressions = [version, expression] │ │ │ │ if precision is not None: │ │ │ │ @@ -311,28 +312,28 @@ │ │ │ │ else "SDO_UTIL.TO_GMLGEOMETRY" │ │ │ │ ) │ │ │ │ return super(AsGML, clone).as_sql(compiler, connection, **extra_context)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AsKML(GeoFunc): │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ def __init__(self, expression, precision=8, **extra): │ │ │ │ expressions = [expression] │ │ │ │ if precision is not None: │ │ │ │ expressions.append(self._handle_param(precision, "precision", int)) │ │ │ │ super().__init__(*expressions, **extra)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AsSVG(GeoFunc): │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ def __init__(self, expression, relative=False, precision=8, **extra): │ │ │ │ relative = ( │ │ │ │ relative if hasattr(relative, "resolve_expression") else int(relative) │ │ │ │ ) │ │ │ │ @@ -342,53 +343,53 @@ │ │ │ │ self._handle_param(precision, "precision", int), │ │ │ │ ] │ │ │ │ super().__init__(*expressions, **extra)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AsWKB(GeoFunc): │ │ │ │ output_field = BinaryField() │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AsWKT(GeoFunc): │ │ │ │ output_field = TextField() │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BoundingCircle(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ def __init__(self, expression, num_seg=48, **extra): │ │ │ │ super().__init__(expression, num_seg, **extra) │ │ │ │ │ │ │ │ def as_oracle(self, compiler, connection, **extra_context): │ │ │ │ clone = self.copy() │ │ │ │ clone.set_source_expressions([self.get_source_expressions()[0]]) │ │ │ │ return super(BoundingCircle, clone).as_oracle( │ │ │ │ compiler, connection, **extra_context │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Centroid(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Difference(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ arity = 2 │ │ │ │ geom_param_pos = (0, 1)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class DistanceResultMixin: │ │ │ │ @@ -397,15 +398,15 @@ │ │ │ │ return DistanceField(self.geo_field) │ │ │ │ │ │ │ │ def source_is_geography(self): │ │ │ │ return self.geo_field.geography and self.geo_field.srid == 4326 │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Distance(DistanceResultMixin, OracleToleranceMixin, GeoFunc): │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ spheroid = None │ │ │ │ │ │ │ │ def __init__(self, expr1, expr2, spheroid=None, **extra): │ │ │ │ expressions = [expr1, expr2] │ │ │ │ if spheroid is not None: │ │ │ │ @@ -451,47 +452,47 @@ │ │ │ │ ] = "COALESCE(%(function)s(%(expressions)s, %(spheroid)s), 0)" │ │ │ │ extra_context["spheroid"] = int(bool(self.spheroid)) │ │ │ │ return super().as_sql(compiler, connection, **extra_context)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Envelope(GeomOutputGeoFunc): │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ForcePolygonCW(GeomOutputGeoFunc): │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FromWKB(GeoFunc): │ │ │ │ output_field = GeometryField(srid=0) │ │ │ │ arity = 1 │ │ │ │ geom_param_pos = ()
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FromWKT(GeoFunc): │ │ │ │ output_field = GeometryField(srid=0) │ │ │ │ arity = 1 │ │ │ │ geom_param_pos = ()
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeoHash(GeoFunc): │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ def __init__(self, expression, precision=None, **extra): │ │ │ │ expressions = [expression] │ │ │ │ if precision is not None: │ │ │ │ expressions.append(self._handle_param(precision, "precision", int)) │ │ │ │ @@ -503,56 +504,56 @@ │ │ │ │ if len(clone.source_expressions) < 2: │ │ │ │ clone.source_expressions.append(Value(100)) │ │ │ │ return clone.as_sql(compiler, connection, **extra_context)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeometryDistance(GeoFunc): │ │ │ │ output_field = FloatField() │ │ │ │ arity = 2 │ │ │ │ function = "" │ │ │ │ arg_joiner = " <-> " │ │ │ │ geom_param_pos = (0, 1)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Intersection(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ arity = 2 │ │ │ │ geom_param_pos = (0, 1)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @BaseSpatialField.register_lookup │ │ │ │ class IsEmpty(GeoFuncMixin, Transform): │ │ │ │ lookup_name = "isempty" │ │ │ │ output_field = BooleanField()
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @BaseSpatialField.register_lookup │ │ │ │ class IsValid(OracleToleranceMixin, GeoFuncMixin, Transform): │ │ │ │ lookup_name = "isvalid" │ │ │ │ output_field = BooleanField() │ │ │ │ │ │ │ │ def as_oracle(self, compiler, connection, **extra_context): │ │ │ │ sql, params = super().as_oracle(compiler, connection, **extra_context) │ │ │ │ return "CASE %s WHEN 'TRUE' THEN 1 ELSE 0 END" % sql, params
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Length(DistanceResultMixin, OracleToleranceMixin, GeoFunc): │ │ │ │ def __init__(self, expr1, spheroid=True, **extra): │ │ │ │ self.spheroid = spheroid │ │ │ │ super().__init__(expr1, **extra) │ │ │ │ │ │ │ │ def as_sql(self, compiler, connection, **extra_context): │ │ │ │ if ( │ │ │ │ @@ -586,55 +587,55 @@ │ │ │ │ if self.geo_field.geodetic(connection): │ │ │ │ function = "GeodesicLength" if self.spheroid else "GreatCircleLength" │ │ │ │ return super().as_sql(compiler, connection, function=function, **extra_context)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class LineLocatePoint(GeoFunc): │ │ │ │ output_field = FloatField() │ │ │ │ arity = 2 │ │ │ │ geom_param_pos = (0, 1)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MakeValid(GeomOutputGeoFunc): │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MemSize(GeoFunc): │ │ │ │ output_field = IntegerField() │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class NumGeometries(GeoFunc): │ │ │ │ output_field = IntegerField() │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class NumPoints(GeoFunc): │ │ │ │ output_field = IntegerField() │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Perimeter(DistanceResultMixin, OracleToleranceMixin, GeoFunc): │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ def as_postgresql(self, compiler, connection, **extra_context): │ │ │ │ function = None │ │ │ │ if self.geo_field.geodetic(connection) and not self.source_is_geography(): │ │ │ │ raise NotSupportedError( │ │ │ │ @@ -649,44 +650,44 @@ │ │ │ │ if self.geo_field.geodetic(connection): │ │ │ │ raise NotSupportedError("Perimeter cannot use a non-projected field.") │ │ │ │ return super().as_sql(compiler, connection, **extra_context)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class PointOnSurface(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Reverse(GeoFunc): │ │ │ │ arity = 1
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Scale(SQLiteDecimalToFloatMixin, GeomOutputGeoFunc): │ │ │ │ def __init__(self, expression, x, y, z=0.0, **extra): │ │ │ │ expressions = [ │ │ │ │ expression, │ │ │ │ self._handle_param(x, "x", NUMERIC_TYPES), │ │ │ │ self._handle_param(y, "y", NUMERIC_TYPES), │ │ │ │ ] │ │ │ │ if z != 0.0: │ │ │ │ expressions.append(self._handle_param(z, "z", NUMERIC_TYPES)) │ │ │ │ super().__init__(*expressions, **extra)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SnapToGrid(SQLiteDecimalToFloatMixin, GeomOutputGeoFunc): │ │ │ │ def __init__(self, expression, *args, **extra): │ │ │ │ nargs = len(args) │ │ │ │ expressions = [expression] │ │ │ │ if nargs in (1, 2): │ │ │ │ expressions.extend( │ │ │ │ [self._handle_param(arg, "", NUMERIC_TYPES) for arg in args] │ │ │ │ @@ -700,49 +701,49 @@ │ │ │ │ else: │ │ │ │ raise ValueError("Must provide 1, 2, or 4 arguments to `SnapToGrid`.") │ │ │ │ super().__init__(*expressions, **extra)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SymDifference(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ arity = 2 │ │ │ │ geom_param_pos = (0, 1)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Transform(GeomOutputGeoFunc): │ │ │ │ def __init__(self, expression, srid, **extra): │ │ │ │ expressions = [ │ │ │ │ expression, │ │ │ │ self._handle_param(srid, "srid", int), │ │ │ │ ] │ │ │ │ if "output_field" not in extra: │ │ │ │ extra["output_field"] = GeometryField(srid=srid) │ │ │ │ super().__init__(*expressions, **extra)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Translate(Scale): │ │ │ │ def as_sqlite(self, compiler, connection, **extra_context): │ │ │ │ clone = self.copy() │ │ │ │ if len(self.source_expressions) < 4: │ │ │ │ # Always provide the z parameter for ST_Translate │ │ │ │ clone.source_expressions.append(Value(0)) │ │ │ │ return super(Translate, clone).as_sqlite(compiler, connection, **extra_context)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Union(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ arity = 2 │ │ │ │ geom_param_pos = (0, 1)
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ @@ -751,35 +752,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ddbb..mmooddeellss..ffuunnccttiioonnss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ddbb..mmooddeellss..ffuunnccttiioonnss ************ │ │ │ │ │ from decimal import Decimal │ │ │ │ │ │ │ │ │ │ from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField │ │ │ │ │ from django.contrib.gis.db.models.sql import AreaField, DistanceField │ │ │ │ │ from django.contrib.gis.geos import GEOSGeometry │ │ │ │ │ from django.core.exceptions import FieldError │ │ │ │ │ from django.db import NotSupportedError │ │ │ │ │ @@ -157,15 +157,15 @@ │ │ │ │ │ clone = self.copy() │ │ │ │ │ clone.set_source_expressions([*self.get_source_expressions(), │ │ │ │ │ tolerance]) │ │ │ │ │ return clone.as_sql(compiler, connection, **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Area(OracleToleranceMixin, GeoFunc): │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ @cached_property │ │ │ │ │ def output_field(self): │ │ │ │ │ return AreaField(self.geo_field) │ │ │ │ │ │ │ │ │ │ @@ -186,25 +186,25 @@ │ │ │ │ │ extra_context["spheroid"] = True │ │ │ │ │ return self.as_sql(compiler, connection, **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Azimuth(GeoFunc): │ │ │ │ │ output_field = FloatField() │ │ │ │ │ arity = 2 │ │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AsGeoJSON(GeoFunc): │ │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, bbox=False, crs=False, precision=8, │ │ │ │ │ **extra): │ │ │ │ │ expressions = [expression] │ │ │ │ │ if precision is not None: │ │ │ │ │ @@ -227,15 +227,15 @@ │ │ │ │ │ return super(AsGeoJSON, clone).as_sql(compiler, connection, │ │ │ │ │ **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AsGML(GeoFunc): │ │ │ │ │ geom_param_pos = (1,) │ │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, version=2, precision=8, **extra): │ │ │ │ │ expressions = [version, expression] │ │ │ │ │ if precision is not None: │ │ │ │ │ @@ -255,29 +255,29 @@ │ │ │ │ │ return super(AsGML, clone).as_sql(compiler, connection, │ │ │ │ │ **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AsKML(GeoFunc): │ │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, precision=8, **extra): │ │ │ │ │ expressions = [expression] │ │ │ │ │ if precision is not None: │ │ │ │ │ expressions.append(self._handle_param(precision, "precision", int)) │ │ │ │ │ super().__init__(*expressions, **extra) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AsSVG(GeoFunc): │ │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, relative=False, precision=8, **extra): │ │ │ │ │ relative = ( │ │ │ │ │ relative if hasattr(relative, "resolve_expression") else int │ │ │ │ │ (relative) │ │ │ │ │ @@ -289,33 +289,33 @@ │ │ │ │ │ ] │ │ │ │ │ super().__init__(*expressions, **extra) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AsWKB(GeoFunc): │ │ │ │ │ output_field = BinaryField() │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AsWKT(GeoFunc): │ │ │ │ │ output_field = TextField() │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BoundingCircle(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ │ def __init__(self, expression, num_seg=48, **extra): │ │ │ │ │ super().__init__(expression, num_seg, **extra) │ │ │ │ │ │ │ │ │ │ def as_oracle(self, compiler, connection, **extra_context): │ │ │ │ │ clone = self.copy() │ │ │ │ │ clone.set_source_expressions([self.get_source_expressions()[0]]) │ │ │ │ │ @@ -323,23 +323,23 @@ │ │ │ │ │ compiler, connection, **extra_context │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Centroid(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Difference(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ │ arity = 2 │ │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -349,15 +349,15 @@ │ │ │ │ │ return DistanceField(self.geo_field) │ │ │ │ │ │ │ │ │ │ def source_is_geography(self): │ │ │ │ │ return self.geo_field.geography and self.geo_field.srid == 4326 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Distance(DistanceResultMixin, OracleToleranceMixin, GeoFunc): │ │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ │ spheroid = None │ │ │ │ │ │ │ │ │ │ def __init__(self, expr1, expr2, spheroid=None, **extra): │ │ │ │ │ expressions = [expr1, expr2] │ │ │ │ │ if spheroid is not None: │ │ │ │ │ @@ -407,51 +407,51 @@ │ │ │ │ │ extra_context["spheroid"] = int(bool(self.spheroid)) │ │ │ │ │ return super().as_sql(compiler, connection, **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Envelope(GeomOutputGeoFunc): │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ForcePolygonCW(GeomOutputGeoFunc): │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FromWKB(GeoFunc): │ │ │ │ │ output_field = GeometryField(srid=0) │ │ │ │ │ arity = 1 │ │ │ │ │ geom_param_pos = () │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FromWKT(GeoFunc): │ │ │ │ │ output_field = GeometryField(srid=0) │ │ │ │ │ arity = 1 │ │ │ │ │ geom_param_pos = () │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeoHash(GeoFunc): │ │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, precision=None, **extra): │ │ │ │ │ expressions = [expression] │ │ │ │ │ if precision is not None: │ │ │ │ │ expressions.append(self._handle_param(precision, "precision", int)) │ │ │ │ │ @@ -464,60 +464,60 @@ │ │ │ │ │ clone.source_expressions.append(Value(100)) │ │ │ │ │ return clone.as_sql(compiler, connection, **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeometryDistance(GeoFunc): │ │ │ │ │ output_field = FloatField() │ │ │ │ │ arity = 2 │ │ │ │ │ function = "" │ │ │ │ │ arg_joiner = " <-> " │ │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Intersection(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ │ arity = 2 │ │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @BaseSpatialField.register_lookup │ │ │ │ │ class IsEmpty(GeoFuncMixin, Transform): │ │ │ │ │ lookup_name = "isempty" │ │ │ │ │ output_field = BooleanField() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @BaseSpatialField.register_lookup │ │ │ │ │ class IsValid(OracleToleranceMixin, GeoFuncMixin, Transform): │ │ │ │ │ lookup_name = "isvalid" │ │ │ │ │ output_field = BooleanField() │ │ │ │ │ │ │ │ │ │ def as_oracle(self, compiler, connection, **extra_context): │ │ │ │ │ sql, params = super().as_oracle(compiler, connection, **extra_context) │ │ │ │ │ return "CASE %s WHEN 'TRUE' THEN 1 ELSE 0 END" % sql, params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Length(DistanceResultMixin, OracleToleranceMixin, GeoFunc): │ │ │ │ │ def __init__(self, expr1, spheroid=True, **extra): │ │ │ │ │ self.spheroid = spheroid │ │ │ │ │ super().__init__(expr1, **extra) │ │ │ │ │ │ │ │ │ │ def as_sql(self, compiler, connection, **extra_context): │ │ │ │ │ if ( │ │ │ │ │ @@ -556,60 +556,60 @@ │ │ │ │ │ return super().as_sql(compiler, connection, function=function, │ │ │ │ │ **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class LineLocatePoint(GeoFunc): │ │ │ │ │ output_field = FloatField() │ │ │ │ │ arity = 2 │ │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MakeValid(GeomOutputGeoFunc): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MemSize(GeoFunc): │ │ │ │ │ output_field = IntegerField() │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class NumGeometries(GeoFunc): │ │ │ │ │ output_field = IntegerField() │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class NumPoints(GeoFunc): │ │ │ │ │ output_field = IntegerField() │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Perimeter(DistanceResultMixin, OracleToleranceMixin, GeoFunc): │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ def as_postgresql(self, compiler, connection, **extra_context): │ │ │ │ │ function = None │ │ │ │ │ if self.geo_field.geodetic(connection) and not self.source_is_geography │ │ │ │ │ (): │ │ │ │ │ @@ -628,31 +628,31 @@ │ │ │ │ │ field.") │ │ │ │ │ return super().as_sql(compiler, connection, **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class PointOnSurface(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Reverse(GeoFunc): │ │ │ │ │ arity = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Scale(SQLiteDecimalToFloatMixin, GeomOutputGeoFunc): │ │ │ │ │ def __init__(self, expression, x, y, z=0.0, **extra): │ │ │ │ │ expressions = [ │ │ │ │ │ expression, │ │ │ │ │ self._handle_param(x, "x", NUMERIC_TYPES), │ │ │ │ │ self._handle_param(y, "y", NUMERIC_TYPES), │ │ │ │ │ ] │ │ │ │ │ @@ -660,15 +660,15 @@ │ │ │ │ │ expressions.append(self._handle_param(z, "z", NUMERIC_TYPES)) │ │ │ │ │ super().__init__(*expressions, **extra) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SnapToGrid(SQLiteDecimalToFloatMixin, GeomOutputGeoFunc): │ │ │ │ │ def __init__(self, expression, *args, **extra): │ │ │ │ │ nargs = len(args) │ │ │ │ │ expressions = [expression] │ │ │ │ │ if nargs in (1, 2): │ │ │ │ │ expressions.extend( │ │ │ │ │ [self._handle_param(arg, "", NUMERIC_TYPES) for arg in args] │ │ │ │ │ @@ -686,55 +686,55 @@ │ │ │ │ │ `SnapToGrid`.") │ │ │ │ │ super().__init__(*expressions, **extra) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SymDifference(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ │ arity = 2 │ │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Transform(GeomOutputGeoFunc): │ │ │ │ │ def __init__(self, expression, srid, **extra): │ │ │ │ │ expressions = [ │ │ │ │ │ expression, │ │ │ │ │ self._handle_param(srid, "srid", int), │ │ │ │ │ ] │ │ │ │ │ if "output_field" not in extra: │ │ │ │ │ extra["output_field"] = GeometryField(srid=srid) │ │ │ │ │ super().__init__(*expressions, **extra) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Translate(Scale): │ │ │ │ │ def as_sqlite(self, compiler, connection, **extra_context): │ │ │ │ │ clone = self.copy() │ │ │ │ │ if len(self.source_expressions) < 4: │ │ │ │ │ # Always provide the z parameter for ST_Translate │ │ │ │ │ clone.source_expressions.append(Value(0)) │ │ │ │ │ return super(Translate, clone).as_sqlite(compiler, connection, │ │ │ │ │ **extra_context) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Union(OracleToleranceMixin, GeomOutputGeoFunc): │ │ │ │ │ arity = 2 │ │ │ │ │ geom_param_pos = (0, 1) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/feeds.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.feeds — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.feeds — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.feeds

│ │ │ │ +  

Codice sorgente per django.contrib.gis.feeds

│ │ │ │  from django.contrib.syndication.views import Feed as BaseFeed
│ │ │ │  from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
│ │ │ │  
│ │ │ │  
│ │ │ │  class GeoFeedMixin:
│ │ │ │      """
│ │ │ │      This mixin provides the necessary routines for SyndicationFeed subclasses
│ │ │ │ @@ -158,15 +159,15 @@
│ │ │ │                          raise ValueError(
│ │ │ │                              'Geometry type "%s" not supported.' % geom.geom_type
│ │ │ │                          )
│ │ │ │  
│ │ │ │  
│ │ │ │  # ### SyndicationFeed subclasses ###
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeoRSSFeed(Rss201rev2Feed, GeoFeedMixin): │ │ │ │ def rss_attributes(self): │ │ │ │ attrs = super().rss_attributes() │ │ │ │ attrs["xmlns:georss"] = "http://www.georss.org/georss" │ │ │ │ return attrs │ │ │ │ │ │ │ │ def add_item_elements(self, handler, item): │ │ │ │ @@ -176,15 +177,15 @@ │ │ │ │ def add_root_elements(self, handler): │ │ │ │ super().add_root_elements(handler) │ │ │ │ self.add_georss_element(handler, self.feed)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeoAtom1Feed(Atom1Feed, GeoFeedMixin): │ │ │ │ def root_attributes(self): │ │ │ │ attrs = super().root_attributes() │ │ │ │ attrs["xmlns:georss"] = "http://www.georss.org/georss" │ │ │ │ return attrs │ │ │ │ │ │ │ │ def add_item_elements(self, handler, item): │ │ │ │ @@ -194,15 +195,15 @@ │ │ │ │ def add_root_elements(self, handler): │ │ │ │ super().add_root_elements(handler) │ │ │ │ self.add_georss_element(handler, self.feed)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class W3CGeoFeed(Rss201rev2Feed, GeoFeedMixin): │ │ │ │ def rss_attributes(self): │ │ │ │ attrs = super().rss_attributes() │ │ │ │ attrs["xmlns:geo"] = "http://www.w3.org/2003/01/geo/wgs84_pos#" │ │ │ │ return attrs │ │ │ │ │ │ │ │ def add_item_elements(self, handler, item): │ │ │ │ @@ -213,15 +214,15 @@ │ │ │ │ super().add_root_elements(handler) │ │ │ │ self.add_georss_element(handler, self.feed, w3c_geo=True)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # ### Feed subclass ### │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Feed(BaseFeed): │ │ │ │ """ │ │ │ │ This is a subclass of the `Feed` from `django.contrib.syndication`. │ │ │ │ This allows users to define a `geometry(obj)` and/or `item_geometry(item)` │ │ │ │ methods on their own subclasses so that geo-referenced information may │ │ │ │ placed in the feed. │ │ │ │ """ │ │ │ │ @@ -242,35 +243,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ffeeeeddss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ffeeeeddss ************ │ │ │ │ │ from django.contrib.syndication.views import Feed as BaseFeed │ │ │ │ │ from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class GeoFeedMixin: │ │ │ │ │ """ │ │ │ │ │ This mixin provides the necessary routines for SyndicationFeed subclasses │ │ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │ │ 'Geometry type "%s" not supported.' % │ │ │ │ │ geom.geom_type │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # ### SyndicationFeed subclasses ### │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeoRSSFeed(Rss201rev2Feed, GeoFeedMixin): │ │ │ │ │ def rss_attributes(self): │ │ │ │ │ attrs = super().rss_attributes() │ │ │ │ │ attrs["xmlns:georss"] = "http://www.georss.org/georss" │ │ │ │ │ return attrs │ │ │ │ │ │ │ │ │ │ def add_item_elements(self, handler, item): │ │ │ │ │ @@ -115,15 +115,15 @@ │ │ │ │ │ super().add_root_elements(handler) │ │ │ │ │ self.add_georss_element(handler, self.feed) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeoAtom1Feed(Atom1Feed, GeoFeedMixin): │ │ │ │ │ def root_attributes(self): │ │ │ │ │ attrs = super().root_attributes() │ │ │ │ │ attrs["xmlns:georss"] = "http://www.georss.org/georss" │ │ │ │ │ return attrs │ │ │ │ │ │ │ │ │ │ def add_item_elements(self, handler, item): │ │ │ │ │ @@ -134,15 +134,15 @@ │ │ │ │ │ super().add_root_elements(handler) │ │ │ │ │ self.add_georss_element(handler, self.feed) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class W3CGeoFeed(Rss201rev2Feed, GeoFeedMixin): │ │ │ │ │ def rss_attributes(self): │ │ │ │ │ attrs = super().rss_attributes() │ │ │ │ │ attrs["xmlns:geo"] = "http://www.w3.org/2003/01/geo/wgs84_pos#" │ │ │ │ │ return attrs │ │ │ │ │ │ │ │ │ │ def add_item_elements(self, handler, item): │ │ │ │ │ @@ -154,15 +154,15 @@ │ │ │ │ │ self.add_georss_element(handler, self.feed, w3c_geo=True) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # ### Feed subclass ### │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Feed(BaseFeed): │ │ │ │ │ """ │ │ │ │ │ This is a subclass of the `Feed` from `django.contrib.syndication`. │ │ │ │ │ This allows users to define a `geometry(obj)` and/or `item_geometry(item)` │ │ │ │ │ methods on their own subclasses so that geo-referenced information may │ │ │ │ │ placed in the feed. │ │ │ │ │ """ │ │ │ │ │ @@ -171,12 +171,12 @@ │ │ │ │ │ │ │ │ │ │ def feed_extra_kwargs(self, obj): │ │ │ │ │ return {"geometry": self._get_dynamic_attr("geometry", obj)} │ │ │ │ │ │ │ │ │ │ def item_extra_kwargs(self, item): │ │ │ │ │ return {"geometry": self._get_dynamic_attr("item_geometry", item)} │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/forms/fields.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.forms.fields — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.forms.fields — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.forms.fields

│ │ │ │ +  

Codice sorgente per django.contrib.gis.forms.fields

│ │ │ │  from django import forms
│ │ │ │  from django.contrib.gis.gdal import GDALException
│ │ │ │  from django.contrib.gis.geos import GEOSException, GEOSGeometry
│ │ │ │  from django.core.exceptions import ValidationError
│ │ │ │  from django.utils.translation import gettext_lazy as _
│ │ │ │  
│ │ │ │  from .widgets import OpenLayersWidget
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeometryField(forms.Field): │ │ │ │ """ │ │ │ │ This is the basic form field for a Geometry. Any textual input that is │ │ │ │ accepted by GEOSGeometry is accepted by this form. By default, │ │ │ │ this includes WKT, HEXEWKB, WKB (in a buffer), and GeoJSON. │ │ │ │ """ │ │ │ │ │ │ │ │ @@ -189,57 +190,57 @@ │ │ │ │ else: │ │ │ │ # Check for change of state of existence │ │ │ │ return bool(initial) != bool(data)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeometryCollectionField(GeometryField): │ │ │ │ geom_type = "GEOMETRYCOLLECTION"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class PointField(GeometryField): │ │ │ │ geom_type = "POINT"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiPointField(GeometryField): │ │ │ │ geom_type = "MULTIPOINT"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class LineStringField(GeometryField): │ │ │ │ geom_type = "LINESTRING"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiLineStringField(GeometryField): │ │ │ │ geom_type = "MULTILINESTRING"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class PolygonField(GeometryField): │ │ │ │ geom_type = "POLYGON"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiPolygonField(GeometryField): │ │ │ │ geom_type = "MULTIPOLYGON"
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ @@ -247,35 +248,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,22 +1,22 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ffoorrmmss..ffiieellddss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ffoorrmmss..ffiieellddss ************ │ │ │ │ │ from django import forms │ │ │ │ │ from django.contrib.gis.gdal import GDALException │ │ │ │ │ from django.contrib.gis.geos import GEOSException, GEOSGeometry │ │ │ │ │ from django.core.exceptions import ValidationError │ │ │ │ │ from django.utils.translation import gettext_lazy as _ │ │ │ │ │ │ │ │ │ │ from .widgets import OpenLayersWidget │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeometryField(forms.Field): │ │ │ │ │ """ │ │ │ │ │ This is the basic form field for a Geometry. Any textual input that is │ │ │ │ │ accepted by GEOSGeometry is accepted by this form. By default, │ │ │ │ │ this includes WKT, HEXEWKB, WKB (in a buffer), and GeoJSON. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ @@ -123,64 +123,64 @@ │ │ │ │ │ # Check for change of state of existence │ │ │ │ │ return bool(initial) != bool(data) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeometryCollectionField(GeometryField): │ │ │ │ │ geom_type = "GEOMETRYCOLLECTION" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class PointField(GeometryField): │ │ │ │ │ geom_type = "POINT" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiPointField(GeometryField): │ │ │ │ │ geom_type = "MULTIPOINT" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class LineStringField(GeometryField): │ │ │ │ │ geom_type = "LINESTRING" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiLineStringField(GeometryField): │ │ │ │ │ geom_type = "MULTILINESTRING" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class PolygonField(GeometryField): │ │ │ │ │ geom_type = "POLYGON" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiPolygonField(GeometryField): │ │ │ │ │ geom_type = "MULTIPOLYGON" │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/forms/widgets.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.forms.widgets — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.forms.widgets — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.forms.widgets

│ │ │ │ +  

Codice sorgente per django.contrib.gis.forms.widgets

│ │ │ │  import logging
│ │ │ │  import warnings
│ │ │ │  
│ │ │ │  from django.conf import settings
│ │ │ │  from django.contrib.gis import gdal
│ │ │ │  from django.contrib.gis.geometry import json_regex
│ │ │ │  from django.contrib.gis.geos import GEOSException, GEOSGeometry
│ │ │ │ @@ -82,15 +83,15 @@
│ │ │ │  from django.utils import translation
│ │ │ │  from django.utils.deprecation import RemovedInDjango51Warning
│ │ │ │  
│ │ │ │  logger = logging.getLogger("django.contrib.gis")
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BaseGeometryWidget(Widget): │ │ │ │ """ │ │ │ │ The base class for rich geometry widgets. │ │ │ │ Render a map using the WKT of the geometry. │ │ │ │ """ │ │ │ │ │ │ │ │ geom_type = "GEOMETRY" │ │ │ │ @@ -168,15 +169,15 @@ │ │ │ │ ) │ │ │ │ ) │ │ │ │ return context
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class OpenLayersWidget(BaseGeometryWidget): │ │ │ │ template_name = "gis/openlayers.html" │ │ │ │ map_srid = 3857 │ │ │ │ │ │ │ │ class Media: │ │ │ │ css = { │ │ │ │ "all": ( │ │ │ │ @@ -198,15 +199,15 @@ │ │ │ │ if geom and json_regex.match(value) and self.map_srid != 4326: │ │ │ │ geom.srid = self.map_srid │ │ │ │ return geom
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class OSMWidget(OpenLayersWidget): │ │ │ │ """ │ │ │ │ An OpenLayers/OpenStreetMap-based widget. │ │ │ │ """ │ │ │ │ │ │ │ │ template_name = "gis/openlayers-osm.html" │ │ │ │ default_lon = 5 │ │ │ │ @@ -228,35 +229,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ffoorrmmss..wwiiddggeettss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ffoorrmmss..wwiiddggeettss ************ │ │ │ │ │ import logging │ │ │ │ │ import warnings │ │ │ │ │ │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.contrib.gis import gdal │ │ │ │ │ from django.contrib.gis.geometry import json_regex │ │ │ │ │ from django.contrib.gis.geos import GEOSException, GEOSGeometry │ │ │ │ │ @@ -13,15 +13,15 @@ │ │ │ │ │ from django.utils import translation │ │ │ │ │ from django.utils.deprecation import RemovedInDjango51Warning │ │ │ │ │ │ │ │ │ │ logger = logging.getLogger("django.contrib.gis") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BaseGeometryWidget(Widget): │ │ │ │ │ """ │ │ │ │ │ The base class for rich geometry widgets. │ │ │ │ │ Render a map using the WKT of the geometry. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ geom_type = "GEOMETRY" │ │ │ │ │ @@ -106,15 +106,15 @@ │ │ │ │ │ ) │ │ │ │ │ return context │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class OpenLayersWidget(BaseGeometryWidget): │ │ │ │ │ template_name = "gis/openlayers.html" │ │ │ │ │ map_srid = 3857 │ │ │ │ │ │ │ │ │ │ class Media: │ │ │ │ │ css = { │ │ │ │ │ "all": ( │ │ │ │ │ @@ -137,15 +137,15 @@ │ │ │ │ │ geom.srid = self.map_srid │ │ │ │ │ return geom │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class OSMWidget(OpenLayersWidget): │ │ │ │ │ """ │ │ │ │ │ An OpenLayers/OpenStreetMap-based widget. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ template_name = "gis/openlayers-osm.html" │ │ │ │ │ default_lon = 5 │ │ │ │ │ @@ -155,12 +155,12 @@ │ │ │ │ │ def __init__(self, attrs=None): │ │ │ │ │ super().__init__() │ │ │ │ │ for key in ("default_lon", "default_lat", "default_zoom"): │ │ │ │ │ self.attrs[key] = getattr(self, key) │ │ │ │ │ if attrs: │ │ │ │ │ self.attrs.update(attrs) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/datasource.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.gdal.datasource — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.gdal.datasource — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.gdal.datasource

│ │ │ │ +  

Codice sorgente per django.contrib.gis.gdal.datasource

│ │ │ │  """
│ │ │ │   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
│ │ │ │ @@ -118,15 +119,15 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  # For more information, see the OGR C API documentation:
│ │ │ │  #  https://gdal.org/api/vector_c_api.html
│ │ │ │  #
│ │ │ │  # The OGR_DS_* routines are relevant here.
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class DataSource(GDALBase): │ │ │ │ "Wraps an OGR Data Source object." │ │ │ │ destructor = capi.destroy_ds │ │ │ │ │ │ │ │ def __init__(self, ds_input, ds_driver=False, write=False, encoding="utf-8"): │ │ │ │ # The write flag. │ │ │ │ if write: │ │ │ │ @@ -208,35 +209,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ddaattaassoouurrccee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ddaattaassoouurrccee ************ │ │ │ │ │ """ │ │ │ │ │ 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 │ │ │ │ │ @@ -49,15 +49,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # For more information, see the OGR C API documentation: │ │ │ │ │ # https://gdal.org/api/vector_c_api.html │ │ │ │ │ # │ │ │ │ │ # The OGR_DS_* routines are relevant here. │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class DataSource(GDALBase): │ │ │ │ │ "Wraps an OGR Data Source object." │ │ │ │ │ destructor = capi.destroy_ds │ │ │ │ │ │ │ │ │ │ def __init__(self, ds_input, ds_driver=False, write=False, encoding="utf- │ │ │ │ │ 8"): │ │ │ │ │ # The write flag. │ │ │ │ │ @@ -132,12 +132,12 @@ │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ def name(self): │ │ │ │ │ "Return the name of the data source." │ │ │ │ │ name = capi.get_ds_name(self._ptr) │ │ │ │ │ return force_str(name, self.encoding, strings_only=True) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/driver.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.gdal.driver — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.gdal.driver — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.gdal.driver

│ │ │ │ +  

Codice sorgente per django.contrib.gis.gdal.driver

│ │ │ │  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
│ │ │ │  from django.contrib.gis.gdal.prototypes import raster as rcapi
│ │ │ │  from django.utils.encoding import force_bytes, force_str
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Driver(GDALBase): │ │ │ │ """ │ │ │ │ Wrap a GDAL/OGR Data Source Driver. │ │ │ │ For more information, see the C API documentation: │ │ │ │ https://gdal.org/api/vector_c_api.html │ │ │ │ https://gdal.org/api/raster_c_api.html │ │ │ │ """ │ │ │ │ @@ -160,15 +161,15 @@ │ │ │ │ # will be registered over and over again) │ │ │ │ if not vcapi.get_driver_count(): │ │ │ │ vcapi.register_all() │ │ │ │ if not rcapi.get_driver_count(): │ │ │ │ rcapi.register_all() │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @classmethod │ │ │ │ def driver_count(cls): │ │ │ │ """ │ │ │ │ Return the number of GDAL/OGR data source drivers registered. │ │ │ │ """ │ │ │ │ return vcapi.get_driver_count() + rcapi.get_driver_count()
│ │ │ │ │ │ │ │ @@ -188,35 +189,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,22 +1,22 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ddrriivveerr ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ddrriivveerr ************ │ │ │ │ │ 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 │ │ │ │ │ from django.contrib.gis.gdal.prototypes import raster as rcapi │ │ │ │ │ from django.utils.encoding import force_bytes, force_str │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Driver(GDALBase): │ │ │ │ │ """ │ │ │ │ │ Wrap a GDAL/OGR Data Source Driver. │ │ │ │ │ For more information, see the C API documentation: │ │ │ │ │ https://gdal.org/api/vector_c_api.html │ │ │ │ │ https://gdal.org/api/raster_c_api.html │ │ │ │ │ """ │ │ │ │ │ @@ -92,15 +92,15 @@ │ │ │ │ │ # will be registered over and over again) │ │ │ │ │ if not vcapi.get_driver_count(): │ │ │ │ │ vcapi.register_all() │ │ │ │ │ if not rcapi.get_driver_count(): │ │ │ │ │ rcapi.register_all() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @classmethod │ │ │ │ │ def driver_count(cls): │ │ │ │ │ """ │ │ │ │ │ Return the number of GDAL/OGR data source drivers registered. │ │ │ │ │ """ │ │ │ │ │ return vcapi.get_driver_count() + rcapi.get_driver_count() │ │ │ │ │ │ │ │ │ │ @@ -109,12 +109,12 @@ │ │ │ │ │ @property │ │ │ │ │ def name(self): │ │ │ │ │ """ │ │ │ │ │ Return description/name string for this driver. │ │ │ │ │ """ │ │ │ │ │ return force_str(rcapi.get_driver_description(self.ptr)) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/envelope.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.gdal.envelope — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.gdal.envelope — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.gdal.envelope

│ │ │ │ +  

Codice sorgente per django.contrib.gis.gdal.envelope

│ │ │ │  """
│ │ │ │   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)
│ │ │ │ @@ -98,15 +99,15 @@
│ │ │ │          ("MaxX", c_double),
│ │ │ │          ("MinY", c_double),
│ │ │ │          ("MaxY", c_double),
│ │ │ │      ]
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Envelope: │ │ │ │ """ │ │ │ │ The Envelope object is a C structure that contains the minimum and │ │ │ │ maximum X, Y coordinates for a rectangle bounding box. The naming │ │ │ │ of the variables is compatible with the OGR Envelope structure. │ │ │ │ """ │ │ │ │ │ │ │ │ @@ -174,15 +175,15 @@ │ │ │ │ self._envelope = OGREnvelope() │ │ │ │ self._envelope.MinX = seq[0] │ │ │ │ self._envelope.MinY = seq[1] │ │ │ │ self._envelope.MaxX = seq[2] │ │ │ │ self._envelope.MaxY = seq[3] │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def expand_to_include(self, *args): │ │ │ │ """ │ │ │ │ Modify the envelope to expand to include the boundaries of │ │ │ │ the passed-in 2-tuple (a point), 4-tuple (an extent) or │ │ │ │ envelope. │ │ │ │ """ │ │ │ │ # We provide a number of different signatures for this method, │ │ │ │ @@ -288,35 +289,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..eennvveellooppee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..eennvveellooppee ************ │ │ │ │ │ """ │ │ │ │ │ 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) │ │ │ │ │ @@ -29,15 +29,15 @@ │ │ │ │ │ ("MaxX", c_double), │ │ │ │ │ ("MinY", c_double), │ │ │ │ │ ("MaxY", c_double), │ │ │ │ │ ] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Envelope: │ │ │ │ │ """ │ │ │ │ │ The Envelope object is a C structure that contains the minimum and │ │ │ │ │ maximum X, Y coordinates for a rectangle bounding box. The naming │ │ │ │ │ of the variables is compatible with the OGR Envelope structure. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ @@ -110,15 +110,15 @@ │ │ │ │ │ self._envelope = OGREnvelope() │ │ │ │ │ self._envelope.MinX = seq[0] │ │ │ │ │ self._envelope.MinY = seq[1] │ │ │ │ │ self._envelope.MaxX = seq[2] │ │ │ │ │ self._envelope.MaxY = seq[3] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def expand_to_include(self, *args): │ │ │ │ │ """ │ │ │ │ │ Modify the envelope to expand to include the boundaries of │ │ │ │ │ the passed-in 2-tuple (a point), 4-tuple (an extent) or │ │ │ │ │ envelope. │ │ │ │ │ """ │ │ │ │ │ # We provide a number of different signatures for this method, │ │ │ │ │ @@ -216,12 +216,12 @@ │ │ │ │ │ self.max_y, │ │ │ │ │ self.max_x, │ │ │ │ │ self.min_y, │ │ │ │ │ self.min_x, │ │ │ │ │ self.min_y, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/error.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.gdal.error — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.gdal.error — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.gdal.error

│ │ │ │ +  

Codice sorgente per django.contrib.gis.gdal.error

│ │ │ │  """
│ │ │ │   This module houses the GDAL & SRS Exception objects, and the
│ │ │ │   check_err() routine which checks the status code returned by
│ │ │ │   GDAL/OGR methods.
│ │ │ │  """
│ │ │ │  
│ │ │ │  
│ │ │ │  # #### GDAL & SRS Exceptions ####
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GDALException(Exception): │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SRSException(Exception): │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # #### GDAL/OGR error checking codes and routine #### │ │ │ │ │ │ │ │ @@ -146,35 +147,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,29 +1,29 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..eerrrroorr ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..eerrrroorr ************ │ │ │ │ │ """ │ │ │ │ │ This module houses the GDAL & SRS Exception objects, and the │ │ │ │ │ check_err() routine which checks the status code returned by │ │ │ │ │ GDAL/OGR methods. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # #### GDAL & SRS Exceptions #### │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GDALException(Exception): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SRSException(Exception): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # #### GDAL/OGR error checking codes and routine #### │ │ │ │ │ @@ -67,12 +67,12 @@ │ │ │ │ │ if code == ERR_NONE: │ │ │ │ │ return │ │ │ │ │ elif code in err_dict: │ │ │ │ │ e, msg = err_dict[code] │ │ │ │ │ raise e(msg) │ │ │ │ │ else: │ │ │ │ │ raise GDALException('Unknown error code: "%s"' % code) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/geometries.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.gdal.geometries — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.gdal.geometries — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.gdal.geometries

│ │ │ │ +  

Codice sorgente per django.contrib.gis.gdal.geometries

│ │ │ │  """
│ │ │ │   The OGRGeometry is a wrapper for using the OGR Geometry class
│ │ │ │   (see https://gdal.org/api/ogrgeometry_cpp.html#_CPPv411OGRGeometry).
│ │ │ │   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" unlike
│ │ │ │ @@ -127,15 +128,15 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  # For more information, see the OGR C API source code:
│ │ │ │  #  https://gdal.org/api/vector_c_api.html
│ │ │ │  #
│ │ │ │  # The OGR_G_* routines are relevant here.
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class OGRGeometry(GDALBase): │ │ │ │ """Encapsulate an OGR geometry.""" │ │ │ │ │ │ │ │ destructor = capi.destroy_geom │ │ │ │ │ │ │ │ def __init__(self, geom_input, srs=None): │ │ │ │ """Initialize Geometry on either WKT or an OGR pointer as input.""" │ │ │ │ @@ -224,15 +225,15 @@ │ │ │ │ ) │ │ │ │ │ │ │ │ @staticmethod │ │ │ │ def _from_json(geom_input): │ │ │ │ return capi.from_json(geom_input) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @classmethod │ │ │ │ def from_bbox(cls, bbox): │ │ │ │ "Construct a Polygon from a bounding box (4-tuple)." │ │ │ │ x0, y0, x1, y1 = bbox │ │ │ │ return OGRGeometry( │ │ │ │ "POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))" │ │ │ │ % (x0, y0, x0, y1, x1, y1, x1, y0, x0, y0) │ │ │ │ @@ -240,15 +241,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ @staticmethod │ │ │ │ def from_json(geom_input): │ │ │ │ return OGRGeometry(OGRGeometry._from_json(force_bytes(geom_input))) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @classmethod │ │ │ │ def from_gml(cls, gml_string): │ │ │ │ return cls(capi.from_gml(force_bytes(gml_string)))
│ │ │ │ │ │ │ │ │ │ │ │ # ### Geometry set-like operations ### │ │ │ │ # g = g1 | g2 │ │ │ │ @@ -462,34 +463,34 @@ │ │ │ │ if srs and srs.srid: │ │ │ │ return "SRID=%s;%s" % (srs.srid, self.wkt) │ │ │ │ else: │ │ │ │ return self.wkt │ │ │ │ │ │ │ │ # #### Geometry Methods #### │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def clone(self): │ │ │ │ "Clone this OGR Geometry." │ │ │ │ return OGRGeometry(capi.clone_geom(self.ptr), self.srs)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def close_rings(self): │ │ │ │ """ │ │ │ │ If there are any rings within this geometry that have not been │ │ │ │ closed, this routine will do so by adding the starting point at the │ │ │ │ end. │ │ │ │ """ │ │ │ │ # Closing the open rings. │ │ │ │ capi.geom_close_rings(self.ptr)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def transform(self, coord_trans, clone=False): │ │ │ │ """ │ │ │ │ Transform this geometry to a different spatial reference system. │ │ │ │ May take a CoordTransform object, a SpatialReference object, string │ │ │ │ WKT or PROJ, and/or an integer SRID. By default, return nothing │ │ │ │ and transform the geometry in-place. However, if the `clone` keyword is │ │ │ │ set, return a transformed clone of this geometry. │ │ │ │ @@ -525,64 +526,64 @@ │ │ │ │ ) │ │ │ │ │ │ │ │ # Returning the output of the given function with the other geometry's │ │ │ │ # pointer. │ │ │ │ return func(self.ptr, other.ptr) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def intersects(self, other): │ │ │ │ "Return True if this geometry intersects with the other." │ │ │ │ return self._topology(capi.ogr_intersects, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def equals(self, other): │ │ │ │ "Return True if this geometry is equivalent to the other." │ │ │ │ return self._topology(capi.ogr_equals, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def disjoint(self, other): │ │ │ │ "Return True if this geometry and the other are spatially disjoint." │ │ │ │ return self._topology(capi.ogr_disjoint, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def touches(self, other): │ │ │ │ "Return True if this geometry touches the other." │ │ │ │ return self._topology(capi.ogr_touches, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def crosses(self, other): │ │ │ │ "Return True if this geometry crosses the other." │ │ │ │ return self._topology(capi.ogr_crosses, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def within(self, other): │ │ │ │ "Return True if this geometry is within the other." │ │ │ │ return self._topology(capi.ogr_within, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def contains(self, other): │ │ │ │ "Return True if this geometry contains the other." │ │ │ │ return self._topology(capi.ogr_contains, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def overlaps(self, other): │ │ │ │ "Return True if this geometry overlaps the other." │ │ │ │ return self._topology(capi.ogr_overlaps, other)
│ │ │ │ │ │ │ │ │ │ │ │ # #### Geometry-generation Methods #### │ │ │ │ def _geomgen(self, gen_func, other=None): │ │ │ │ @@ -602,45 +603,45 @@ │ │ │ │ """ │ │ │ │ Return the smallest convex Polygon that contains all the points in │ │ │ │ this Geometry. │ │ │ │ """ │ │ │ │ return self._geomgen(capi.geom_convex_hull) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def difference(self, other): │ │ │ │ """ │ │ │ │ Return a new geometry consisting of the region which is the difference │ │ │ │ of this geometry and the other. │ │ │ │ """ │ │ │ │ return self._geomgen(capi.geom_diff, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def intersection(self, other): │ │ │ │ """ │ │ │ │ Return a new geometry consisting of the region of intersection of this │ │ │ │ geometry and the other. │ │ │ │ """ │ │ │ │ return self._geomgen(capi.geom_intersection, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def sym_difference(self, other): │ │ │ │ """ │ │ │ │ Return a new geometry which is the symmetric difference of this │ │ │ │ geometry and the other. │ │ │ │ """ │ │ │ │ return self._geomgen(capi.geom_sym_diff, other)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def union(self, other): │ │ │ │ """ │ │ │ │ Return a new geometry consisting of the region which is the union of │ │ │ │ this geometry and the other. │ │ │ │ """ │ │ │ │ return self._geomgen(capi.geom_union, other)
│ │ │ │
│ │ │ │ @@ -876,35 +877,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ggeeoommeettrriieess ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ggeeoommeettrriieess ************ │ │ │ │ │ """ │ │ │ │ │ The OGRGeometry is a wrapper for using the OGR Geometry class │ │ │ │ │ (see https://gdal.org/api/ogrgeometry_cpp.html#_CPPv411OGRGeometry). │ │ │ │ │ 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" unlike │ │ │ │ │ @@ -61,15 +61,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # For more information, see the OGR C API source code: │ │ │ │ │ # https://gdal.org/api/vector_c_api.html │ │ │ │ │ # │ │ │ │ │ # The OGR_G_* routines are relevant here. │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class OGRGeometry(GDALBase): │ │ │ │ │ """Encapsulate an OGR geometry.""" │ │ │ │ │ │ │ │ │ │ destructor = capi.destroy_geom │ │ │ │ │ │ │ │ │ │ def __init__(self, geom_input, srs=None): │ │ │ │ │ """Initialize Geometry on either WKT or an OGR pointer as input.""" │ │ │ │ │ @@ -160,15 +160,15 @@ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ @staticmethod │ │ │ │ │ def _from_json(geom_input): │ │ │ │ │ return capi.from_json(geom_input) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @classmethod │ │ │ │ │ def from_bbox(cls, bbox): │ │ │ │ │ "Construct a Polygon from a bounding box (4-tuple)." │ │ │ │ │ x0, y0, x1, y1 = bbox │ │ │ │ │ return OGRGeometry( │ │ │ │ │ "POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))" │ │ │ │ │ % (x0, y0, x0, y1, x1, y1, x1, y0, x0, y0) │ │ │ │ │ @@ -177,15 +177,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @staticmethod │ │ │ │ │ def from_json(geom_input): │ │ │ │ │ return OGRGeometry(OGRGeometry._from_json(force_bytes(geom_input))) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @classmethod │ │ │ │ │ def from_gml(cls, gml_string): │ │ │ │ │ return cls(capi.from_gml(force_bytes(gml_string))) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # ### Geometry set-like operations ### │ │ │ │ │ @@ -403,36 +403,36 @@ │ │ │ │ │ if srs and srs.srid: │ │ │ │ │ return "SRID=%s;%s" % (srs.srid, self.wkt) │ │ │ │ │ else: │ │ │ │ │ return self.wkt │ │ │ │ │ │ │ │ │ │ # #### Geometry Methods #### │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def clone(self): │ │ │ │ │ "Clone this OGR Geometry." │ │ │ │ │ return OGRGeometry(capi.clone_geom(self.ptr), self.srs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def close_rings(self): │ │ │ │ │ """ │ │ │ │ │ If there are any rings within this geometry that have not been │ │ │ │ │ closed, this routine will do so by adding the starting point at the │ │ │ │ │ end. │ │ │ │ │ """ │ │ │ │ │ # Closing the open rings. │ │ │ │ │ capi.geom_close_rings(self.ptr) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def transform(self, coord_trans, clone=False): │ │ │ │ │ """ │ │ │ │ │ Transform this geometry to a different spatial reference system. │ │ │ │ │ May take a CoordTransform object, a SpatialReference object, string │ │ │ │ │ WKT or PROJ, and/or an integer SRID. By default, return nothing │ │ │ │ │ and transform the geometry in-place. However, if the `clone` keyword is │ │ │ │ │ set, return a transformed clone of this geometry. │ │ │ │ │ @@ -470,71 +470,71 @@ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ # Returning the output of the given function with the other geometry's │ │ │ │ │ # pointer. │ │ │ │ │ return func(self.ptr, other.ptr) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def intersects(self, other): │ │ │ │ │ "Return True if this geometry intersects with the other." │ │ │ │ │ return self._topology(capi.ogr_intersects, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def equals(self, other): │ │ │ │ │ "Return True if this geometry is equivalent to the other." │ │ │ │ │ return self._topology(capi.ogr_equals, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def disjoint(self, other): │ │ │ │ │ "Return True if this geometry and the other are spatially disjoint." │ │ │ │ │ return self._topology(capi.ogr_disjoint, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def touches(self, other): │ │ │ │ │ "Return True if this geometry touches the other." │ │ │ │ │ return self._topology(capi.ogr_touches, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def crosses(self, other): │ │ │ │ │ "Return True if this geometry crosses the other." │ │ │ │ │ return self._topology(capi.ogr_crosses, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def within(self, other): │ │ │ │ │ "Return True if this geometry is within the other." │ │ │ │ │ return self._topology(capi.ogr_within, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def contains(self, other): │ │ │ │ │ "Return True if this geometry contains the other." │ │ │ │ │ return self._topology(capi.ogr_contains, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def overlaps(self, other): │ │ │ │ │ "Return True if this geometry overlaps the other." │ │ │ │ │ return self._topology(capi.ogr_overlaps, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # #### Geometry-generation Methods #### │ │ │ │ │ @@ -555,48 +555,48 @@ │ │ │ │ │ """ │ │ │ │ │ Return the smallest convex Polygon that contains all the points in │ │ │ │ │ this Geometry. │ │ │ │ │ """ │ │ │ │ │ return self._geomgen(capi.geom_convex_hull) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def difference(self, other): │ │ │ │ │ """ │ │ │ │ │ Return a new geometry consisting of the region which is the difference │ │ │ │ │ of this geometry and the other. │ │ │ │ │ """ │ │ │ │ │ return self._geomgen(capi.geom_diff, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def intersection(self, other): │ │ │ │ │ """ │ │ │ │ │ Return a new geometry consisting of the region of intersection of this │ │ │ │ │ geometry and the other. │ │ │ │ │ """ │ │ │ │ │ return self._geomgen(capi.geom_intersection, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def sym_difference(self, other): │ │ │ │ │ """ │ │ │ │ │ Return a new geometry which is the symmetric difference of this │ │ │ │ │ geometry and the other. │ │ │ │ │ """ │ │ │ │ │ return self._geomgen(capi.geom_sym_diff, other) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def union(self, other): │ │ │ │ │ """ │ │ │ │ │ Return a new geometry consisting of the region which is the union of │ │ │ │ │ this geometry and the other. │ │ │ │ │ """ │ │ │ │ │ return self._geomgen(capi.geom_union, other) │ │ │ │ │ │ │ │ │ │ @@ -825,12 +825,12 @@ │ │ │ │ │ 2 + OGRGeomType.wkb25bit: LineString, │ │ │ │ │ 3 + OGRGeomType.wkb25bit: Polygon, │ │ │ │ │ 4 + OGRGeomType.wkb25bit: MultiPoint, │ │ │ │ │ 5 + OGRGeomType.wkb25bit: MultiLineString, │ │ │ │ │ 6 + OGRGeomType.wkb25bit: MultiPolygon, │ │ │ │ │ 7 + OGRGeomType.wkb25bit: GeometryCollection, │ │ │ │ │ } │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/geomtype.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.gdal.geomtype — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.gdal.geomtype — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.gdal.geomtype

│ │ │ │ +  

Codice sorgente per django.contrib.gis.gdal.geomtype

│ │ │ │  from django.contrib.gis.gdal.error import GDALException
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class OGRGeomType: │ │ │ │ "Encapsulate OGR Geometry Types." │ │ │ │ │ │ │ │ wkb25bit = -2147483648 │ │ │ │ │ │ │ │ # Dictionary of acceptable OGRwkbGeometryType s and their string names. │ │ │ │ _types = { │ │ │ │ @@ -177,35 +178,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,16 +1,16 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ggeeoommttyyppee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ggeeoommttyyppee ************ │ │ │ │ │ from django.contrib.gis.gdal.error import GDALException │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class OGRGeomType: │ │ │ │ │ "Encapsulate OGR Geometry Types." │ │ │ │ │ │ │ │ │ │ wkb25bit = -2147483648 │ │ │ │ │ │ │ │ │ │ # Dictionary of acceptable OGRwkbGeometryType s and their string names. │ │ │ │ │ _types = { │ │ │ │ │ @@ -98,12 +98,12 @@ │ │ │ │ │ """ │ │ │ │ │ Transform Point, LineString, Polygon, and their 25D equivalents │ │ │ │ │ to their Multi... counterpart. │ │ │ │ │ """ │ │ │ │ │ if self.name.startswith(("Point", "LineString", "Polygon")): │ │ │ │ │ self.num += 3 │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/raster/source.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.gdal.raster.source — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.gdal.raster.source — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.gdal.raster.source

│ │ │ │ +  

Codice sorgente per django.contrib.gis.gdal.raster.source

│ │ │ │  import json
│ │ │ │  import os
│ │ │ │  import sys
│ │ │ │  import uuid
│ │ │ │  from ctypes import (
│ │ │ │      addressof,
│ │ │ │      byref,
│ │ │ │ @@ -137,15 +138,15 @@
│ │ │ │      def y(self, value):
│ │ │ │          gtf = self._raster.geotransform
│ │ │ │          gtf[self.indices[self._prop][1]] = value
│ │ │ │          self._raster.geotransform = gtf
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GDALRaster(GDALRasterBase): │ │ │ │ """ │ │ │ │ Wrap a raster GDAL Data Source object. │ │ │ │ """ │ │ │ │ │ │ │ │ destructor = capi.close_ds │ │ │ │ │ │ │ │ @@ -469,15 +470,15 @@ │ │ │ │ return xmin, ymin, xmax, ymax │ │ │ │ │ │ │ │ @property │ │ │ │ def bands(self): │ │ │ │ return BandList(self) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def warp(self, ds_input, resampling="NearestNeighbour", max_error=0.0): │ │ │ │ """ │ │ │ │ Return a warped GDALRaster with the given input characteristics. │ │ │ │ │ │ │ │ The input is expected to be a dictionary containing the parameters │ │ │ │ of the target raster. Allowed values are width, height, SRID, origin, │ │ │ │ scale, skew, datatype, driver, and name (filename). │ │ │ │ @@ -554,15 +555,15 @@ │ │ │ │ c_void_p(), │ │ │ │ c_void_p(), │ │ │ │ ), │ │ │ │ write=self._write, │ │ │ │ ) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def transform( │ │ │ │ self, srs, driver=None, name=None, resampling="NearestNeighbour", max_error=0.0 │ │ │ │ ): │ │ │ │ """ │ │ │ │ Return a copy of this raster reprojected into the given spatial │ │ │ │ reference system. │ │ │ │ """ │ │ │ │ @@ -629,35 +630,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..rraasstteerr..ssoouurrccee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..rraasstteerr..ssoouurrccee ************ │ │ │ │ │ import json │ │ │ │ │ import os │ │ │ │ │ import sys │ │ │ │ │ import uuid │ │ │ │ │ from ctypes import ( │ │ │ │ │ addressof, │ │ │ │ │ byref, │ │ │ │ │ @@ -68,15 +68,15 @@ │ │ │ │ │ def y(self, value): │ │ │ │ │ gtf = self._raster.geotransform │ │ │ │ │ gtf[self.indices[self._prop][1]] = value │ │ │ │ │ self._raster.geotransform = gtf │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GDALRaster(GDALRasterBase): │ │ │ │ │ """ │ │ │ │ │ Wrap a raster GDAL Data Source object. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ destructor = capi.close_ds │ │ │ │ │ │ │ │ │ │ @@ -409,15 +409,15 @@ │ │ │ │ │ return xmin, ymin, xmax, ymax │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ def bands(self): │ │ │ │ │ return BandList(self) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def warp(self, ds_input, resampling="NearestNeighbour", max_error=0.0): │ │ │ │ │ """ │ │ │ │ │ Return a warped GDALRaster with the given input characteristics. │ │ │ │ │ │ │ │ │ │ The input is expected to be a dictionary containing the parameters │ │ │ │ │ of the target raster. Allowed values are width, height, SRID, origin, │ │ │ │ │ scale, skew, datatype, driver, and name (filename). │ │ │ │ │ @@ -500,15 +500,15 @@ │ │ │ │ │ c_void_p(), │ │ │ │ │ c_void_p(), │ │ │ │ │ ), │ │ │ │ │ write=self._write, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def transform( │ │ │ │ │ self, srs, driver=None, name=None, resampling="NearestNeighbour", │ │ │ │ │ max_error=0.0 │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Return a copy of this raster reprojected into the given spatial │ │ │ │ │ reference system. │ │ │ │ │ @@ -566,12 +566,12 @@ │ │ │ │ │ def info(self): │ │ │ │ │ """ │ │ │ │ │ Return information about this raster in a string format equivalent │ │ │ │ │ to the output of the gdalinfo command line utility. │ │ │ │ │ """ │ │ │ │ │ return capi.get_ds_info(self.ptr, None).decode() │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/gdal/srs.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.gdal.srs — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.gdal.srs — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.gdal.srs

│ │ │ │ +  

Codice sorgente per django.contrib.gis.gdal.srs

│ │ │ │  """
│ │ │ │    The Spatial Reference class, represents OGR Spatial Reference objects.
│ │ │ │  
│ │ │ │    Example:
│ │ │ │    >>> from django.contrib.gis.gdal import SpatialReference
│ │ │ │    >>> srs = SpatialReference('WGS84')
│ │ │ │    >>> print(srs)
│ │ │ │ @@ -111,15 +112,15 @@
│ │ │ │  
│ │ │ │  class AxisOrder(IntEnum):
│ │ │ │      TRADITIONAL = 0
│ │ │ │      AUTHORITY = 1
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SpatialReference(GDALBase): │ │ │ │ """ │ │ │ │ A wrapper for the OGRSpatialReference object. According to the GDAL web site, │ │ │ │ the SpatialReference object "provide[s] services to represent coordinate │ │ │ │ systems (projections and datums) and to transform between them." │ │ │ │ """ │ │ │ │ │ │ │ │ @@ -185,15 +186,15 @@ │ │ │ │ # Importing from either the user input string or an integer SRID. │ │ │ │ if srs_type == "user": │ │ │ │ self.import_user_input(srs_input) │ │ │ │ elif srs_type == "epsg": │ │ │ │ self.import_epsg(srs_input) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def __getitem__(self, target): │ │ │ │ """ │ │ │ │ Return the value of the given string attribute node, None if the node │ │ │ │ doesn't exist. Can also take a tuple as a parameter, (target, child), │ │ │ │ where child is the index of the attribute in the WKT. For example: │ │ │ │ │ │ │ │ >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]' │ │ │ │ @@ -222,76 +223,76 @@ │ │ │ │ │ │ │ │ def __str__(self): │ │ │ │ "Use 'pretty' WKT." │ │ │ │ return self.pretty_wkt │ │ │ │ │ │ │ │ # #### SpatialReference Methods #### │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def attr_value(self, target, index=0): │ │ │ │ """ │ │ │ │ The attribute value for the given target node (e.g. 'PROJCS'). The index │ │ │ │ keyword specifies an index of the child node to return. │ │ │ │ """ │ │ │ │ if not isinstance(target, str) or not isinstance(index, int): │ │ │ │ raise TypeError │ │ │ │ return capi.get_attr_value(self.ptr, force_bytes(target), index)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def auth_name(self, target): │ │ │ │ "Return the authority name for the given string target node." │ │ │ │ return capi.get_auth_name( │ │ │ │ self.ptr, target if target is None else force_bytes(target) │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def auth_code(self, target): │ │ │ │ "Return the authority code for the given string target node." │ │ │ │ return capi.get_auth_code( │ │ │ │ self.ptr, target if target is None else force_bytes(target) │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def clone(self): │ │ │ │ "Return a clone of this SpatialReference object." │ │ │ │ return SpatialReference(capi.clone_srs(self.ptr), axis_order=self.axis_order)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def from_esri(self): │ │ │ │ "Morph this SpatialReference from ESRI's format to EPSG." │ │ │ │ capi.morph_from_esri(self.ptr)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def identify_epsg(self): │ │ │ │ """ │ │ │ │ This method inspects the WKT of this SpatialReference, and will │ │ │ │ add EPSG authority nodes where an EPSG identifier is applicable. │ │ │ │ """ │ │ │ │ capi.identify_epsg(self.ptr)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def to_esri(self): │ │ │ │ "Morph this SpatialReference to ESRI's format." │ │ │ │ capi.morph_to_esri(self.ptr)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate(self): │ │ │ │ "Check to see if the given spatial reference is valid." │ │ │ │ capi.srs_validate(self.ptr)
│ │ │ │ │ │ │ │ │ │ │ │ # #### Name & SRID properties #### │ │ │ │ @property │ │ │ │ @@ -398,43 +399,43 @@ │ │ │ │ Return True if this SpatialReference is a projected coordinate system │ │ │ │ (root node is PROJCS). │ │ │ │ """ │ │ │ │ return bool(capi.isprojected(self.ptr)) │ │ │ │ │ │ │ │ # #### Import Routines ##### │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def import_epsg(self, epsg): │ │ │ │ "Import the Spatial Reference from the EPSG code (an integer)." │ │ │ │ capi.from_epsg(self.ptr, epsg)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def import_proj(self, proj): │ │ │ │ """Import the Spatial Reference from a PROJ string.""" │ │ │ │ capi.from_proj(self.ptr, proj)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def import_user_input(self, user_input): │ │ │ │ "Import the Spatial Reference from the given user input string." │ │ │ │ capi.from_user_input(self.ptr, force_bytes(user_input))
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def import_wkt(self, wkt): │ │ │ │ "Import the Spatial Reference from OGC WKT (string)" │ │ │ │ capi.from_wkt(self.ptr, byref(c_char_p(force_bytes(wkt))))
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def import_xml(self, xml): │ │ │ │ "Import the Spatial Reference from an XML string." │ │ │ │ capi.from_xml(self.ptr, xml)
│ │ │ │ │ │ │ │ │ │ │ │ # #### Export Properties #### │ │ │ │ @property │ │ │ │ @@ -461,15 +462,15 @@ │ │ │ │ def xml(self, dialect=""): │ │ │ │ "Return the XML representation of this Spatial Reference." │ │ │ │ return capi.to_xml(self.ptr, byref(c_char_p()), force_bytes(dialect))
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class CoordTransform(GDALBase): │ │ │ │ "The coordinate system transformation object." │ │ │ │ destructor = capi.destroy_ct │ │ │ │ │ │ │ │ def __init__(self, source, target): │ │ │ │ "Initialize on a source and target SpatialReference objects." │ │ │ │ if not isinstance(source, SpatialReference) or not isinstance( │ │ │ │ @@ -491,35 +492,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ssrrss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggddaall..ssrrss ************ │ │ │ │ │ """ │ │ │ │ │ The Spatial Reference class, represents OGR Spatial Reference objects. │ │ │ │ │ │ │ │ │ │ Example: │ │ │ │ │ >>> from django.contrib.gis.gdal import SpatialReference │ │ │ │ │ >>> srs = SpatialReference('WGS84') │ │ │ │ │ >>> print(srs) │ │ │ │ │ @@ -42,15 +42,15 @@ │ │ │ │ │ │ │ │ │ │ class AxisOrder(IntEnum): │ │ │ │ │ TRADITIONAL = 0 │ │ │ │ │ AUTHORITY = 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SpatialReference(GDALBase): │ │ │ │ │ """ │ │ │ │ │ A wrapper for the OGRSpatialReference object. According to the GDAL web │ │ │ │ │ site, │ │ │ │ │ the SpatialReference object "provide[s] services to represent coordinate │ │ │ │ │ systems (projections and datums) and to transform between them." │ │ │ │ │ """ │ │ │ │ │ @@ -122,15 +122,15 @@ │ │ │ │ │ # Importing from either the user input string or an integer SRID. │ │ │ │ │ if srs_type == "user": │ │ │ │ │ self.import_user_input(srs_input) │ │ │ │ │ elif srs_type == "epsg": │ │ │ │ │ self.import_epsg(srs_input) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def __getitem__(self, target): │ │ │ │ │ """ │ │ │ │ │ Return the value of the given string attribute node, None if the node │ │ │ │ │ doesn't exist. Can also take a tuple as a parameter, (target, child), │ │ │ │ │ where child is the index of the attribute in the WKT. For example: │ │ │ │ │ │ │ │ │ │ >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY │ │ │ │ │ @@ -161,85 +161,85 @@ │ │ │ │ │ │ │ │ │ │ def __str__(self): │ │ │ │ │ "Use 'pretty' WKT." │ │ │ │ │ return self.pretty_wkt │ │ │ │ │ │ │ │ │ │ # #### SpatialReference Methods #### │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def attr_value(self, target, index=0): │ │ │ │ │ """ │ │ │ │ │ The attribute value for the given target node (e.g. 'PROJCS'). The │ │ │ │ │ index │ │ │ │ │ keyword specifies an index of the child node to return. │ │ │ │ │ """ │ │ │ │ │ if not isinstance(target, str) or not isinstance(index, int): │ │ │ │ │ raise TypeError │ │ │ │ │ return capi.get_attr_value(self.ptr, force_bytes(target), index) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def auth_name(self, target): │ │ │ │ │ "Return the authority name for the given string target node." │ │ │ │ │ return capi.get_auth_name( │ │ │ │ │ self.ptr, target if target is None else force_bytes(target) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def auth_code(self, target): │ │ │ │ │ "Return the authority code for the given string target node." │ │ │ │ │ return capi.get_auth_code( │ │ │ │ │ self.ptr, target if target is None else force_bytes(target) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def clone(self): │ │ │ │ │ "Return a clone of this SpatialReference object." │ │ │ │ │ return SpatialReference(capi.clone_srs(self.ptr), │ │ │ │ │ axis_order=self.axis_order) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def from_esri(self): │ │ │ │ │ "Morph this SpatialReference from ESRI's format to EPSG." │ │ │ │ │ capi.morph_from_esri(self.ptr) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def identify_epsg(self): │ │ │ │ │ """ │ │ │ │ │ This method inspects the WKT of this SpatialReference, and will │ │ │ │ │ add EPSG authority nodes where an EPSG identifier is applicable. │ │ │ │ │ """ │ │ │ │ │ capi.identify_epsg(self.ptr) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def to_esri(self): │ │ │ │ │ "Morph this SpatialReference to ESRI's format." │ │ │ │ │ capi.morph_to_esri(self.ptr) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate(self): │ │ │ │ │ "Check to see if the given spatial reference is valid." │ │ │ │ │ capi.srs_validate(self.ptr) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # #### Name & SRID properties #### │ │ │ │ │ @@ -348,47 +348,47 @@ │ │ │ │ │ Return True if this SpatialReference is a projected coordinate system │ │ │ │ │ (root node is PROJCS). │ │ │ │ │ """ │ │ │ │ │ return bool(capi.isprojected(self.ptr)) │ │ │ │ │ │ │ │ │ │ # #### Import Routines ##### │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def import_epsg(self, epsg): │ │ │ │ │ "Import the Spatial Reference from the EPSG code (an integer)." │ │ │ │ │ capi.from_epsg(self.ptr, epsg) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def import_proj(self, proj): │ │ │ │ │ """Import the Spatial Reference from a PROJ string.""" │ │ │ │ │ capi.from_proj(self.ptr, proj) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def import_user_input(self, user_input): │ │ │ │ │ "Import the Spatial Reference from the given user input string." │ │ │ │ │ capi.from_user_input(self.ptr, force_bytes(user_input)) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def import_wkt(self, wkt): │ │ │ │ │ "Import the Spatial Reference from OGC WKT (string)" │ │ │ │ │ capi.from_wkt(self.ptr, byref(c_char_p(force_bytes(wkt)))) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def import_xml(self, xml): │ │ │ │ │ "Import the Spatial Reference from an XML string." │ │ │ │ │ capi.from_xml(self.ptr, xml) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # #### Export Properties #### │ │ │ │ │ @@ -417,15 +417,15 @@ │ │ │ │ │ "Return the XML representation of this Spatial Reference." │ │ │ │ │ return capi.to_xml(self.ptr, byref(c_char_p()), force_bytes(dialect)) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class CoordTransform(GDALBase): │ │ │ │ │ "The coordinate system transformation object." │ │ │ │ │ destructor = capi.destroy_ct │ │ │ │ │ │ │ │ │ │ def __init__(self, source, target): │ │ │ │ │ "Initialize on a source and target SpatialReference objects." │ │ │ │ │ if not isinstance(source, SpatialReference) or not isinstance( │ │ │ │ │ @@ -437,12 +437,12 @@ │ │ │ │ │ self._srs1_name = source.name │ │ │ │ │ self._srs2_name = target.name │ │ │ │ │ │ │ │ │ │ def __str__(self): │ │ │ │ │ return 'Transform from "%s" to "%s"' % (self._srs1_name, │ │ │ │ │ self._srs2_name) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/collections.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.collections — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.collections — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.collections

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.collections

│ │ │ │  """
│ │ │ │   This module houses the Geometry Collection objects:
│ │ │ │   GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
│ │ │ │  """
│ │ │ │  from django.contrib.gis.geos import prototypes as capi
│ │ │ │  from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin
│ │ │ │  from django.contrib.gis.geos.libgeos import GEOM_PTR
│ │ │ │  from django.contrib.gis.geos.linestring import LinearRing, LineString
│ │ │ │  from django.contrib.gis.geos.point import Point
│ │ │ │  from django.contrib.gis.geos.polygon import Polygon
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GeometryCollection(GEOSGeometry): │ │ │ │ _typeid = 7 │ │ │ │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ "Initialize a Geometry Collection from a sequence of Geometry objects." │ │ │ │ # Checking the arguments │ │ │ │ if len(args) == 1: │ │ │ │ @@ -165,31 +166,31 @@ │ │ │ │ │ │ │ │ coords = tuple
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # MultiPoint, MultiLineString, and MultiPolygon class definitions. │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiPoint(GeometryCollection): │ │ │ │ _allowed = Point │ │ │ │ _typeid = 4
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiLineString(LinearGeometryMixin, GeometryCollection): │ │ │ │ _allowed = (LineString, LinearRing) │ │ │ │ _typeid = 5
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultiPolygon(GeometryCollection): │ │ │ │ _allowed = Polygon │ │ │ │ _typeid = 6
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # Setting the allowed types here since GeometryCollection is defined before │ │ │ │ @@ -211,35 +212,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,25 +1,25 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ccoolllleeccttiioonnss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ccoolllleeccttiioonnss ************ │ │ │ │ │ """ │ │ │ │ │ This module houses the Geometry Collection objects: │ │ │ │ │ GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon │ │ │ │ │ """ │ │ │ │ │ from django.contrib.gis.geos import prototypes as capi │ │ │ │ │ from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin │ │ │ │ │ from django.contrib.gis.geos.libgeos import GEOM_PTR │ │ │ │ │ from django.contrib.gis.geos.linestring import LinearRing, LineString │ │ │ │ │ from django.contrib.gis.geos.point import Point │ │ │ │ │ from django.contrib.gis.geos.polygon import Polygon │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GeometryCollection(GEOSGeometry): │ │ │ │ │ _typeid = 7 │ │ │ │ │ │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ "Initialize a Geometry Collection from a sequence of Geometry objects." │ │ │ │ │ # Checking the arguments │ │ │ │ │ if len(args) == 1: │ │ │ │ │ @@ -101,33 +101,33 @@ │ │ │ │ │ coords = tuple │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # MultiPoint, MultiLineString, and MultiPolygon class definitions. │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiPoint(GeometryCollection): │ │ │ │ │ _allowed = Point │ │ │ │ │ _typeid = 4 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiLineString(LinearGeometryMixin, GeometryCollection): │ │ │ │ │ _allowed = (LineString, LinearRing) │ │ │ │ │ _typeid = 5 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultiPolygon(GeometryCollection): │ │ │ │ │ _allowed = Polygon │ │ │ │ │ _typeid = 6 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -138,12 +138,12 @@ │ │ │ │ │ LineString, │ │ │ │ │ LinearRing, │ │ │ │ │ Polygon, │ │ │ │ │ MultiPoint, │ │ │ │ │ MultiLineString, │ │ │ │ │ MultiPolygon, │ │ │ │ │ ) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/error.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.error — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.error — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.error

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.error

│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GEOSException(Exception): │ │ │ │ "The base GEOS exception, indicates a GEOS-related error." │ │ │ │ pass
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ @@ -85,35 +86,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..eerrrroorr ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..eerrrroorr ************ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GEOSException(Exception): │ │ │ │ │ "The base GEOS exception, indicates a GEOS-related error." │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/factory.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.factory — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.factory — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.factory

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.factory

│ │ │ │  from django.contrib.gis.geos.geometry import GEOSGeometry, hex_regex, wkt_regex
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def fromfile(file_h): │ │ │ │ """ │ │ │ │ Given a string file name, returns a GEOSGeometry. The file may contain WKB, │ │ │ │ WKT, or HEX. │ │ │ │ """ │ │ │ │ # If given a file name, get a real handle. │ │ │ │ if isinstance(file_h, str): │ │ │ │ @@ -101,15 +102,15 @@ │ │ │ │ return GEOSGeometry(buf) │ │ │ │ │ │ │ │ return GEOSGeometry(memoryview(buf))
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def fromstr(string, **kwargs): │ │ │ │ "Given a string value, return a GEOSGeometry object." │ │ │ │ return GEOSGeometry(string, **kwargs)
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ @@ -118,35 +119,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,16 +1,16 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ffaaccttoorryy ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ffaaccttoorryy ************ │ │ │ │ │ from django.contrib.gis.geos.geometry import GEOSGeometry, hex_regex, wkt_regex │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def fromfile(file_h): │ │ │ │ │ """ │ │ │ │ │ Given a string file name, returns a GEOSGeometry. The file may contain WKB, │ │ │ │ │ WKT, or HEX. │ │ │ │ │ """ │ │ │ │ │ # If given a file name, get a real handle. │ │ │ │ │ if isinstance(file_h, str): │ │ │ │ │ @@ -33,17 +33,17 @@ │ │ │ │ │ │ │ │ │ │ return GEOSGeometry(memoryview(buf)) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def fromstr(string, **kwargs): │ │ │ │ │ "Given a string value, return a GEOSGeometry object." │ │ │ │ │ return GEOSGeometry(string, **kwargs) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/geometry.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.geometry — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.geometry — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.geometry

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.geometry

│ │ │ │  """
│ │ │ │   This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
│ │ │ │   inherit from this object.
│ │ │ │  """
│ │ │ │  import re
│ │ │ │  from ctypes import addressof, byref, c_double
│ │ │ │  
│ │ │ │ @@ -777,15 +778,15 @@
│ │ │ │          """
│ │ │ │          Return whether or not this Geometry is closed.
│ │ │ │          """
│ │ │ │          return capi.geos_isclosed(self.ptr)
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class GEOSGeometry(GEOSGeometryBase, ListMixin): │ │ │ │ "A class that, generally, encapsulates a GEOS geometry." │ │ │ │ │ │ │ │ def __init__(self, geo_input, srid=None): │ │ │ │ """ │ │ │ │ The base constructor for GEOS geometry objects. It may take the │ │ │ │ @@ -853,35 +854,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ggeeoommeettrryy ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ggeeoommeettrryy ************ │ │ │ │ │ """ │ │ │ │ │ This module contains the 'base' GEOSGeometry object -- all GEOS Geometries │ │ │ │ │ inherit from this object. │ │ │ │ │ """ │ │ │ │ │ import re │ │ │ │ │ from ctypes import addressof, byref, c_double │ │ │ │ │ │ │ │ │ │ @@ -726,15 +726,15 @@ │ │ │ │ │ """ │ │ │ │ │ Return whether or not this Geometry is closed. │ │ │ │ │ """ │ │ │ │ │ return capi.geos_isclosed(self.ptr) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class GEOSGeometry(GEOSGeometryBase, ListMixin): │ │ │ │ │ "A class that, generally, encapsulates a GEOS geometry." │ │ │ │ │ │ │ │ │ │ def __init__(self, geo_input, srid=None): │ │ │ │ │ """ │ │ │ │ │ The base constructor for GEOS geometry objects. It may take the │ │ │ │ │ @@ -794,12 +794,12 @@ │ │ │ │ │ │ │ │ │ │ super().__init__(g, None) │ │ │ │ │ # Set the SRID, if given. │ │ │ │ │ srid = input_srid or srid │ │ │ │ │ if srid and isinstance(srid, int): │ │ │ │ │ self.srid = srid │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/io.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.io — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.io — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.io

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.io

│ │ │ │  """
│ │ │ │  Module that holds classes for performing I/O operations on GEOS geometry
│ │ │ │  objects.  Specifically, this has Python implementations of WKB/WKT
│ │ │ │  reader and writer classes.
│ │ │ │  """
│ │ │ │  from django.contrib.gis.geos.geometry import GEOSGeometry
│ │ │ │  from django.contrib.gis.geos.prototypes.io import (
│ │ │ │ @@ -85,24 +86,24 @@
│ │ │ │  )
│ │ │ │  
│ │ │ │  __all__ = ["WKBWriter", "WKTWriter", "WKBReader", "WKTReader"]
│ │ │ │  
│ │ │ │  
│ │ │ │  # Public classes for (WKB|WKT)Reader, which return GEOSGeometry
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class WKBReader(_WKBReader): │ │ │ │ def read(self, wkb): │ │ │ │ "Return a GEOSGeometry for the given WKB buffer." │ │ │ │ return GEOSGeometry(super().read(wkb))
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class WKTReader(_WKTReader): │ │ │ │ def read(self, wkt): │ │ │ │ "Return a GEOSGeometry for the given WKT string." │ │ │ │ return GEOSGeometry(super().read(wkt))
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -112,35 +113,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..iioo ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..iioo ************ │ │ │ │ │ """ │ │ │ │ │ Module that holds classes for performing I/O operations on GEOS geometry │ │ │ │ │ objects. Specifically, this has Python implementations of WKB/WKT │ │ │ │ │ reader and writer classes. │ │ │ │ │ """ │ │ │ │ │ from django.contrib.gis.geos.geometry import GEOSGeometry │ │ │ │ │ from django.contrib.gis.geos.prototypes.io import ( │ │ │ │ │ @@ -16,28 +16,28 @@ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ __all__ = ["WKBWriter", "WKTWriter", "WKBReader", "WKTReader"] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # Public classes for (WKB|WKT)Reader, which return GEOSGeometry │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class WKBReader(_WKBReader): │ │ │ │ │ def read(self, wkb): │ │ │ │ │ "Return a GEOSGeometry for the given WKB buffer." │ │ │ │ │ return GEOSGeometry(super().read(wkb)) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class WKTReader(_WKTReader): │ │ │ │ │ def read(self, wkt): │ │ │ │ │ "Return a GEOSGeometry for the given WKT string." │ │ │ │ │ return GEOSGeometry(super().read(wkt)) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/linestring.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.linestring — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.linestring — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.linestring

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.linestring

│ │ │ │  from django.contrib.gis.geos import prototypes as capi
│ │ │ │  from django.contrib.gis.geos.coordseq import GEOSCoordSeq
│ │ │ │  from django.contrib.gis.geos.error import GEOSException
│ │ │ │  from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin
│ │ │ │  from django.contrib.gis.geos.point import Point
│ │ │ │  from django.contrib.gis.shortcuts import numpy
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class LineString(LinearGeometryMixin, GEOSGeometry): │ │ │ │ _init_func = capi.create_linestring │ │ │ │ _minlength = 2 │ │ │ │ has_cs = True │ │ │ │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ """ │ │ │ │ @@ -255,15 +256,15 @@ │ │ │ │ else: │ │ │ │ return self._listarr(self._cs.getZ)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # LinearRings are LineStrings used within Polygons. │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class LinearRing(LineString): │ │ │ │ _minlength = 4 │ │ │ │ _init_func = capi.create_linearring │ │ │ │ │ │ │ │ @property │ │ │ │ def is_counterclockwise(self): │ │ │ │ if self.empty: │ │ │ │ @@ -278,35 +279,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,21 +1,21 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..lliinneessttrriinngg ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..lliinneessttrriinngg ************ │ │ │ │ │ from django.contrib.gis.geos import prototypes as capi │ │ │ │ │ from django.contrib.gis.geos.coordseq import GEOSCoordSeq │ │ │ │ │ from django.contrib.gis.geos.error import GEOSException │ │ │ │ │ from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin │ │ │ │ │ from django.contrib.gis.geos.point import Point │ │ │ │ │ from django.contrib.gis.shortcuts import numpy │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class LineString(LinearGeometryMixin, GEOSGeometry): │ │ │ │ │ _init_func = capi.create_linestring │ │ │ │ │ _minlength = 2 │ │ │ │ │ has_cs = True │ │ │ │ │ │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ """ │ │ │ │ │ @@ -191,24 +191,24 @@ │ │ │ │ │ return self._listarr(self._cs.getZ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # LinearRings are LineStrings used within Polygons. │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class LinearRing(LineString): │ │ │ │ │ _minlength = 4 │ │ │ │ │ _init_func = capi.create_linearring │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ def is_counterclockwise(self): │ │ │ │ │ if self.empty: │ │ │ │ │ raise ValueError("Orientation of an empty LinearRing cannot be │ │ │ │ │ determined.") │ │ │ │ │ return self._cs.is_counterclockwise │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/point.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.point — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.point — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.point

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.point

│ │ │ │  from ctypes import c_uint
│ │ │ │  
│ │ │ │  from django.contrib.gis import gdal
│ │ │ │  from django.contrib.gis.geos import prototypes as capi
│ │ │ │  from django.contrib.gis.geos.error import GEOSException
│ │ │ │  from django.contrib.gis.geos.geometry import GEOSGeometry
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Point(GEOSGeometry): │ │ │ │ _minlength = 2 │ │ │ │ _maxlength = 3 │ │ │ │ has_cs = True │ │ │ │ │ │ │ │ def __init__(self, x=None, y=None, z=None, srid=None): │ │ │ │ """ │ │ │ │ @@ -244,35 +245,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,21 +1,21 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ppooiinntt ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ppooiinntt ************ │ │ │ │ │ from ctypes import c_uint │ │ │ │ │ │ │ │ │ │ from django.contrib.gis import gdal │ │ │ │ │ from django.contrib.gis.geos import prototypes as capi │ │ │ │ │ from django.contrib.gis.geos.error import GEOSException │ │ │ │ │ from django.contrib.gis.geos.geometry import GEOSGeometry │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Point(GEOSGeometry): │ │ │ │ │ _minlength = 2 │ │ │ │ │ _maxlength = 3 │ │ │ │ │ has_cs = True │ │ │ │ │ │ │ │ │ │ def __init__(self, x=None, y=None, z=None, srid=None): │ │ │ │ │ """ │ │ │ │ │ @@ -169,12 +169,12 @@ │ │ │ │ │ def tuple(self, tup): │ │ │ │ │ "Set the coordinates of the point with the given tuple." │ │ │ │ │ self._cs[0] = tup │ │ │ │ │ │ │ │ │ │ # The tuple and coords properties │ │ │ │ │ coords = tuple │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/polygon.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.polygon — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.polygon — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.polygon

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.polygon

│ │ │ │  from django.contrib.gis.geos import prototypes as capi
│ │ │ │  from django.contrib.gis.geos.geometry import GEOSGeometry
│ │ │ │  from django.contrib.gis.geos.libgeos import GEOM_PTR
│ │ │ │  from django.contrib.gis.geos.linestring import LinearRing
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Polygon(GEOSGeometry): │ │ │ │ _minlength = 1 │ │ │ │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ """ │ │ │ │ Initialize on an exterior ring and a sequence of holes (both │ │ │ │ instances may be either LinearRing instances, or a tuple/list │ │ │ │ @@ -126,15 +127,15 @@ │ │ │ │ yield self[i] │ │ │ │ │ │ │ │ def __len__(self): │ │ │ │ "Return the number of rings in this Polygon." │ │ │ │ return self.num_interior_rings + 1 │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @classmethod │ │ │ │ def from_bbox(cls, bbox): │ │ │ │ "Construct a Polygon from a bounding box (4-tuple)." │ │ │ │ x0, y0, x1, y1 = bbox │ │ │ │ for z in bbox: │ │ │ │ if not isinstance(z, (float, int)): │ │ │ │ return GEOSGeometry( │ │ │ │ @@ -274,35 +275,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,19 +1,19 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ppoollyyggoonn ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..ppoollyyggoonn ************ │ │ │ │ │ from django.contrib.gis.geos import prototypes as capi │ │ │ │ │ from django.contrib.gis.geos.geometry import GEOSGeometry │ │ │ │ │ from django.contrib.gis.geos.libgeos import GEOM_PTR │ │ │ │ │ from django.contrib.gis.geos.linestring import LinearRing │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Polygon(GEOSGeometry): │ │ │ │ │ _minlength = 1 │ │ │ │ │ │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ """ │ │ │ │ │ Initialize on an exterior ring and a sequence of holes (both │ │ │ │ │ instances may be either LinearRing instances, or a tuple/list │ │ │ │ │ @@ -57,15 +57,15 @@ │ │ │ │ │ yield self[i] │ │ │ │ │ │ │ │ │ │ def __len__(self): │ │ │ │ │ "Return the number of rings in this Polygon." │ │ │ │ │ return self.num_interior_rings + 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @classmethod │ │ │ │ │ def from_bbox(cls, bbox): │ │ │ │ │ "Construct a Polygon from a bounding box (4-tuple)." │ │ │ │ │ x0, y0, x1, y1 = bbox │ │ │ │ │ for z in bbox: │ │ │ │ │ if not isinstance(z, (float, int)): │ │ │ │ │ return GEOSGeometry( │ │ │ │ │ @@ -196,12 +196,12 @@ │ │ │ │ │ for i in range(self.num_interior_rings) │ │ │ │ │ ) │ │ │ │ │ return "%s%s" % ( │ │ │ │ │ self[0].kml, │ │ │ │ │ inner_kml, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/geos/prototypes/io.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.geos.prototypes.io — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.geos.prototypes.io — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.geos.prototypes.io

│ │ │ │ +  

Codice sorgente per django.contrib.gis.geos.prototypes.io

│ │ │ │  import threading
│ │ │ │  from ctypes import POINTER, Structure, byref, c_byte, c_char_p, c_int, c_size_t
│ │ │ │  
│ │ │ │  from django.contrib.gis.geos.base import GEOSBase
│ │ │ │  from django.contrib.gis.geos.libgeos import (
│ │ │ │      GEOM_PTR,
│ │ │ │      GEOSFuncFactory,
│ │ │ │ @@ -249,15 +250,15 @@
│ │ │ │              return wkb_reader_read_hex(self.ptr, wkb_s, len(wkb_s))
│ │ │ │          else:
│ │ │ │              raise TypeError
│ │ │ │  
│ │ │ │  
│ │ │ │  # ### WKB/WKT Writer Classes ###
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class WKTWriter(IOBase): │ │ │ │ _constructor = wkt_writer_create │ │ │ │ ptr_type = WKT_WRITE_PTR │ │ │ │ destructor = wkt_writer_destroy │ │ │ │ │ │ │ │ _trim = False │ │ │ │ _precision = None │ │ │ │ @@ -267,15 +268,15 @@ │ │ │ │ if bool(trim) != self._trim: │ │ │ │ self.trim = trim │ │ │ │ if precision is not None: │ │ │ │ self.precision = precision │ │ │ │ self.outdim = dim │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def write(self, geom): │ │ │ │ "Return the WKT representation of the given geometry." │ │ │ │ return wkt_writer_write(self.ptr, geom.ptr)
│ │ │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ def outdim(self): │ │ │ │ @@ -310,15 +311,15 @@ │ │ │ │ if precision != self._precision: │ │ │ │ self._precision = precision │ │ │ │ wkt_writer_set_precision(self.ptr, -1 if precision is None else precision)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class WKBWriter(IOBase): │ │ │ │ _constructor = wkb_writer_create │ │ │ │ ptr_type = WKB_WRITE_PTR │ │ │ │ destructor = wkb_writer_destroy │ │ │ │ geos_version = geos_version_tuple() │ │ │ │ │ │ │ │ def __init__(self, dim=2): │ │ │ │ @@ -335,30 +336,30 @@ │ │ │ │ # https://trac.osgeo.org/postgis/ticket/3181 │ │ │ │ geom = Point(float("NaN"), float("NaN"), srid=geom.srid) │ │ │ │ else: │ │ │ │ raise ValueError("Empty point is not representable in WKB.") │ │ │ │ return geom │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def write(self, geom): │ │ │ │ "Return the WKB representation of the given geometry." │ │ │ │ from django.contrib.gis.geos import Polygon │ │ │ │ │ │ │ │ geom = self._handle_empty_point(geom) │ │ │ │ wkb = wkb_writer_write(self.ptr, geom.ptr, byref(c_size_t())) │ │ │ │ if self.geos_version < (3, 6, 1) and isinstance(geom, Polygon) and geom.empty: │ │ │ │ # Fix GEOS output for empty polygon. │ │ │ │ # See https://trac.osgeo.org/geos/ticket/680. │ │ │ │ wkb = wkb[:-8] + b"\0" * 4 │ │ │ │ return memoryview(wkb)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def write_hex(self, geom): │ │ │ │ "Return the HEXEWKB representation of the given geometry." │ │ │ │ from django.contrib.gis.geos.polygon import Polygon │ │ │ │ │ │ │ │ geom = self._handle_empty_point(geom) │ │ │ │ wkb = wkb_writer_write_hex(self.ptr, geom.ptr, byref(c_size_t())) │ │ │ │ if self.geos_version < (3, 6, 1) and isinstance(geom, Polygon) and geom.empty: │ │ │ │ @@ -463,35 +464,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..pprroottoottyyppeess..iioo ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..ggeeooss..pprroottoottyyppeess..iioo ************ │ │ │ │ │ import threading │ │ │ │ │ from ctypes import POINTER, Structure, byref, c_byte, c_char_p, c_int, c_size_t │ │ │ │ │ │ │ │ │ │ from django.contrib.gis.geos.base import GEOSBase │ │ │ │ │ from django.contrib.gis.geos.libgeos import ( │ │ │ │ │ GEOM_PTR, │ │ │ │ │ GEOSFuncFactory, │ │ │ │ │ @@ -188,15 +188,15 @@ │ │ │ │ │ return wkb_reader_read_hex(self.ptr, wkb_s, len(wkb_s)) │ │ │ │ │ else: │ │ │ │ │ raise TypeError │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # ### WKB/WKT Writer Classes ### │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class WKTWriter(IOBase): │ │ │ │ │ _constructor = wkt_writer_create │ │ │ │ │ ptr_type = WKT_WRITE_PTR │ │ │ │ │ destructor = wkt_writer_destroy │ │ │ │ │ │ │ │ │ │ _trim = False │ │ │ │ │ _precision = None │ │ │ │ │ @@ -206,15 +206,15 @@ │ │ │ │ │ if bool(trim) != self._trim: │ │ │ │ │ self.trim = trim │ │ │ │ │ if precision is not None: │ │ │ │ │ self.precision = precision │ │ │ │ │ self.outdim = dim │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def write(self, geom): │ │ │ │ │ "Return the WKT representation of the given geometry." │ │ │ │ │ return wkt_writer_write(self.ptr, geom.ptr) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ @@ -254,15 +254,15 @@ │ │ │ │ │ wkt_writer_set_precision(self.ptr, -1 if precision is None else │ │ │ │ │ precision) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class WKBWriter(IOBase): │ │ │ │ │ _constructor = wkb_writer_create │ │ │ │ │ ptr_type = WKB_WRITE_PTR │ │ │ │ │ destructor = wkb_writer_destroy │ │ │ │ │ geos_version = geos_version_tuple() │ │ │ │ │ │ │ │ │ │ def __init__(self, dim=2): │ │ │ │ │ @@ -279,15 +279,15 @@ │ │ │ │ │ # https://trac.osgeo.org/postgis/ticket/3181 │ │ │ │ │ geom = Point(float("NaN"), float("NaN"), srid=geom.srid) │ │ │ │ │ else: │ │ │ │ │ raise ValueError("Empty point is not representable in WKB.") │ │ │ │ │ return geom │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def write(self, geom): │ │ │ │ │ "Return the WKB representation of the given geometry." │ │ │ │ │ from django.contrib.gis.geos import Polygon │ │ │ │ │ │ │ │ │ │ geom = self._handle_empty_point(geom) │ │ │ │ │ wkb = wkb_writer_write(self.ptr, geom.ptr, byref(c_size_t())) │ │ │ │ │ if self.geos_version < (3, 6, 1) and isinstance(geom, Polygon) and │ │ │ │ │ @@ -296,15 +296,15 @@ │ │ │ │ │ # See https://trac.osgeo.org/geos/ticket/680. │ │ │ │ │ wkb = wkb[:-8] + b"\0" * 4 │ │ │ │ │ return memoryview(wkb) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def write_hex(self, geom): │ │ │ │ │ "Return the HEXEWKB representation of the given geometry." │ │ │ │ │ from django.contrib.gis.geos.polygon import Polygon │ │ │ │ │ │ │ │ │ │ geom = self._handle_empty_point(geom) │ │ │ │ │ wkb = wkb_writer_write_hex(self.ptr, geom.ptr, byref(c_size_t())) │ │ │ │ │ if self.geos_version < (3, 6, 1) and isinstance(geom, Polygon) and │ │ │ │ │ @@ -402,12 +402,12 @@ │ │ │ │ │ def ewkb_w(dim=2): │ │ │ │ │ if not thread_context.ewkb_w: │ │ │ │ │ thread_context.ewkb_w = WKBWriter(dim=dim) │ │ │ │ │ thread_context.ewkb_w.srid = True │ │ │ │ │ else: │ │ │ │ │ thread_context.ewkb_w.outdim = dim │ │ │ │ │ return thread_context.ewkb_w │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/measure.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.measure — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.measure — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.measure

│ │ │ │ +  

Codice sorgente per django.contrib.gis.measure

│ │ │ │  # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
│ │ │ │  # All rights reserved.
│ │ │ │  #
│ │ │ │  # Redistribution and use in source and binary forms, with or without modification,
│ │ │ │  # are permitted provided that the following conditions are met:
│ │ │ │  #
│ │ │ │  #   1. Redistributions of source code must retain the above copyright notice,
│ │ │ │ @@ -317,15 +318,15 @@
│ │ │ │          else:
│ │ │ │              raise Exception(
│ │ │ │                  'Could not find a unit keyword associated with "%s"' % unit_str
│ │ │ │              )
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Distance(MeasureBase): │ │ │ │ STANDARD_UNIT = "m" │ │ │ │ UNITS = { │ │ │ │ "chain": 20.1168, │ │ │ │ "chain_benoit": 20.116782, │ │ │ │ "chain_sears": 20.1167645, │ │ │ │ "british_chain_benoit": 20.1167824944, │ │ │ │ @@ -419,15 +420,15 @@ │ │ │ │ "distance": pretty_name(self.__class__), │ │ │ │ } │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Area(MeasureBase): │ │ │ │ STANDARD_UNIT = AREA_PREFIX + Distance.STANDARD_UNIT │ │ │ │ # Getting the square units values and the alias dictionary. │ │ │ │ UNITS = {"%s%s" % (AREA_PREFIX, k): v**2 for k, v in Distance.UNITS.items()} │ │ │ │ ALIAS = {k: "%s%s" % (AREA_PREFIX, v) for k, v in Distance.ALIAS.items()} │ │ │ │ LALIAS = {k.lower(): v for k, v in ALIAS.items()} │ │ │ │ │ │ │ │ @@ -455,35 +456,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..mmeeaassuurree ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..mmeeaassuurree ************ │ │ │ │ │ # Copyright (c) 2007, Robert Coup │ │ │ │ │ # All rights reserved. │ │ │ │ │ # │ │ │ │ │ # Redistribution and use in source and binary forms, with or without │ │ │ │ │ modification, │ │ │ │ │ # are permitted provided that the following conditions are met: │ │ │ │ │ # │ │ │ │ │ @@ -258,15 +258,15 @@ │ │ │ │ │ else: │ │ │ │ │ raise Exception( │ │ │ │ │ 'Could not find a unit keyword associated with "%s"' % unit_str │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Distance(MeasureBase): │ │ │ │ │ STANDARD_UNIT = "m" │ │ │ │ │ UNITS = { │ │ │ │ │ "chain": 20.1168, │ │ │ │ │ "chain_benoit": 20.116782, │ │ │ │ │ "chain_sears": 20.1167645, │ │ │ │ │ "british_chain_benoit": 20.1167824944, │ │ │ │ │ @@ -363,15 +363,15 @@ │ │ │ │ │ } │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Area(MeasureBase): │ │ │ │ │ STANDARD_UNIT = AREA_PREFIX + Distance.STANDARD_UNIT │ │ │ │ │ # Getting the square units values and the alias dictionary. │ │ │ │ │ UNITS = {"%s%s" % (AREA_PREFIX, k): v**2 for k, v in Distance.UNITS.items │ │ │ │ │ ()} │ │ │ │ │ ALIAS = {k: "%s%s" % (AREA_PREFIX, v) for k, v in Distance.ALIAS.items()} │ │ │ │ │ LALIAS = {k.lower(): v for k, v in ALIAS.items()} │ │ │ │ │ @@ -390,12 +390,12 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # Shortcuts │ │ │ │ │ D = Distance │ │ │ │ │ A = Area │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/utils/layermapping.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.utils.layermapping — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.utils.layermapping — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.utils.layermapping

│ │ │ │ +  

Codice sorgente per django.contrib.gis.utils.layermapping

│ │ │ │  # 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/gis/layermapping/
│ │ │ │ @@ -125,15 +126,15 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  class MissingForeignKey(LayerMapError):
│ │ │ │      pass
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class LayerMapping: │ │ │ │ "A class that maps OGR Layers to GeoDjango Models." │ │ │ │ │ │ │ │ # Acceptable 'base' types for a multi-geometry type. │ │ │ │ MULTI_TYPES = { │ │ │ │ 1: OGRGeomType("MultiPoint"), │ │ │ │ 2: OGRGeomType("MultiLineString"), │ │ │ │ @@ -617,15 +618,15 @@ │ │ │ │ """ │ │ │ │ return ( │ │ │ │ geom_type.num in self.MULTI_TYPES │ │ │ │ and model_field.__class__.__name__ == "Multi%s" % geom_type.django │ │ │ │ ) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def save( │ │ │ │ self, │ │ │ │ verbose=False, │ │ │ │ fid_range=False, │ │ │ │ step=False, │ │ │ │ progress=False, │ │ │ │ silent=False, │ │ │ │ @@ -809,35 +810,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..uuttiillss..llaayyeerrmmaappppiinngg ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..uuttiillss..llaayyeerrmmaappppiinngg ************ │ │ │ │ │ # 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/gis/layermapping/ │ │ │ │ │ @@ -56,15 +56,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class MissingForeignKey(LayerMapError): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class LayerMapping: │ │ │ │ │ "A class that maps OGR Layers to GeoDjango Models." │ │ │ │ │ │ │ │ │ │ # Acceptable 'base' types for a multi-geometry type. │ │ │ │ │ MULTI_TYPES = { │ │ │ │ │ 1: OGRGeomType("MultiPoint"), │ │ │ │ │ 2: OGRGeomType("MultiLineString"), │ │ │ │ │ @@ -574,15 +574,15 @@ │ │ │ │ │ """ │ │ │ │ │ return ( │ │ │ │ │ geom_type.num in self.MULTI_TYPES │ │ │ │ │ and model_field.__class__.__name__ == "Multi%s" % geom_type.django │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def save( │ │ │ │ │ self, │ │ │ │ │ verbose=False, │ │ │ │ │ fid_range=False, │ │ │ │ │ step=False, │ │ │ │ │ progress=False, │ │ │ │ │ silent=False, │ │ │ │ │ @@ -770,12 +770,12 @@ │ │ │ │ │ ) │ │ │ │ │ raise │ │ │ │ │ else: │ │ │ │ │ # Otherwise, just calling the previously defined _save() function. │ │ │ │ │ _save() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/gis/utils/ogrinspect.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.gis.utils.ogrinspect — Django 4.2.13 documentation │ │ │ │ + django.contrib.gis.utils.ogrinspect — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.gis.utils.ogrinspect

│ │ │ │ +  

Codice sorgente per django.contrib.gis.utils.ogrinspect

│ │ │ │  """
│ │ │ │  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 (
│ │ │ │ @@ -85,15 +86,15 @@
│ │ │ │      OFTReal,
│ │ │ │      OFTString,
│ │ │ │      OFTTime,
│ │ │ │  )
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def mapping(data_source, geom_name="geom", layer_key=0, multi_geom=False): │ │ │ │ """ │ │ │ │ Given a DataSource, generate a dictionary that may be used │ │ │ │ for invoking the LayerMapping utility. │ │ │ │ │ │ │ │ Keyword Arguments: │ │ │ │ `geom_name` => The name of the geometry field to use for the model. │ │ │ │ @@ -128,15 +129,15 @@ │ │ │ │ gtype.to_multi() │ │ │ │ _mapping[geom_name] = str(gtype).upper() │ │ │ │ return _mapping
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def ogrinspect(*args, **kwargs): │ │ │ │ """ │ │ │ │ Given a data source (either a string or a DataSource object) and a string │ │ │ │ model name this function will generate a GeoDjango model. │ │ │ │ │ │ │ │ Usage: │ │ │ │ │ │ │ │ @@ -352,35 +353,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ggiiss..uuttiillss..ooggrriinnssppeecctt ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ggiiss..uuttiillss..ooggrriinnssppeecctt ************ │ │ │ │ │ """ │ │ │ │ │ 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 ( │ │ │ │ │ @@ -16,15 +16,15 @@ │ │ │ │ │ OFTReal, │ │ │ │ │ OFTString, │ │ │ │ │ OFTTime, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def mapping(data_source, geom_name="geom", layer_key=0, multi_geom=False): │ │ │ │ │ """ │ │ │ │ │ Given a DataSource, generate a dictionary that may be used │ │ │ │ │ for invoking the LayerMapping utility. │ │ │ │ │ │ │ │ │ │ Keyword Arguments: │ │ │ │ │ `geom_name` => The name of the geometry field to use for the model. │ │ │ │ │ @@ -61,15 +61,15 @@ │ │ │ │ │ _mapping[geom_name] = str(gtype).upper() │ │ │ │ │ return _mapping │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def ogrinspect(*args, **kwargs): │ │ │ │ │ """ │ │ │ │ │ Given a data source (either a string or a DataSource object) and a string │ │ │ │ │ model name this function will generate a GeoDjango model. │ │ │ │ │ │ │ │ │ │ Usage: │ │ │ │ │ │ │ │ │ │ @@ -284,12 +284,12 @@ │ │ │ │ │ srid_str = "srid=%s" % srid │ │ │ │ │ │ │ │ │ │ yield " %s = models.%s(%s)" % (geom_name, geom_field, srid_str) │ │ │ │ │ │ │ │ │ │ if name_field: │ │ │ │ │ yield "" │ │ │ │ │ yield " def __str__(self): return self.%s" % name_field │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/messages/api.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.messages.api — Django 4.2.13 documentation │ │ │ │ + django.contrib.messages.api — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.messages.api

│ │ │ │ +  

Codice sorgente per django.contrib.messages.api

│ │ │ │  from django.contrib.messages import constants
│ │ │ │  from django.contrib.messages.storage import default_storage
│ │ │ │  
│ │ │ │  __all__ = (
│ │ │ │      "add_message",
│ │ │ │      "get_messages",
│ │ │ │      "get_level",
│ │ │ │ @@ -89,15 +90,15 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  class MessageFailure(Exception):
│ │ │ │      pass
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def add_message(request, level, message, extra_tags="", fail_silently=False): │ │ │ │ """ │ │ │ │ Attempt to add a message to the request using the 'messages' app. │ │ │ │ """ │ │ │ │ try: │ │ │ │ messages = request._messages │ │ │ │ except AttributeError: │ │ │ │ @@ -113,15 +114,15 @@ │ │ │ │ ) │ │ │ │ else: │ │ │ │ return messages.add(level, message, extra_tags)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_messages(request): │ │ │ │ """ │ │ │ │ Return the message storage on the request if it exists, otherwise return │ │ │ │ an empty list. │ │ │ │ """ │ │ │ │ return getattr(request, "_messages", [])
│ │ │ │ │ │ │ │ @@ -212,35 +213,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..mmeessssaaggeess..aappii ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..mmeessssaaggeess..aappii ************ │ │ │ │ │ from django.contrib.messages import constants │ │ │ │ │ from django.contrib.messages.storage import default_storage │ │ │ │ │ │ │ │ │ │ __all__ = ( │ │ │ │ │ "add_message", │ │ │ │ │ "get_messages", │ │ │ │ │ "get_level", │ │ │ │ │ @@ -20,15 +20,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class MessageFailure(Exception): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def add_message(request, level, message, extra_tags="", fail_silently=False): │ │ │ │ │ """ │ │ │ │ │ Attempt to add a message to the request using the 'messages' app. │ │ │ │ │ """ │ │ │ │ │ try: │ │ │ │ │ messages = request._messages │ │ │ │ │ except AttributeError: │ │ │ │ │ @@ -45,15 +45,15 @@ │ │ │ │ │ else: │ │ │ │ │ return messages.add(level, message, extra_tags) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_messages(request): │ │ │ │ │ """ │ │ │ │ │ Return the message storage on the request if it exists, otherwise return │ │ │ │ │ an empty list. │ │ │ │ │ """ │ │ │ │ │ return getattr(request, "_messages", []) │ │ │ │ │ │ │ │ │ │ @@ -133,12 +133,12 @@ │ │ │ │ │ add_message( │ │ │ │ │ request, │ │ │ │ │ constants.ERROR, │ │ │ │ │ message, │ │ │ │ │ extra_tags=extra_tags, │ │ │ │ │ fail_silently=fail_silently, │ │ │ │ │ ) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/messages/middleware.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.messages.middleware — Django 4.2.13 documentation │ │ │ │ + django.contrib.messages.middleware — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.messages.middleware

│ │ │ │ +  

Codice sorgente per django.contrib.messages.middleware

│ │ │ │  from django.conf import settings
│ │ │ │  from django.contrib.messages.storage import default_storage
│ │ │ │  from django.utils.deprecation import MiddlewareMixin
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MessageMiddleware(MiddlewareMixin): │ │ │ │ """ │ │ │ │ Middleware that handles temporary messages. │ │ │ │ """ │ │ │ │ │ │ │ │ def process_request(self, request): │ │ │ │ request._messages = default_storage(request) │ │ │ │ @@ -108,35 +109,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,18 +1,18 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..mmeessssaaggeess..mmiiddddlleewwaarree ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..mmeessssaaggeess..mmiiddddlleewwaarree ************ │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.contrib.messages.storage import default_storage │ │ │ │ │ from django.utils.deprecation import MiddlewareMixin │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MessageMiddleware(MiddlewareMixin): │ │ │ │ │ """ │ │ │ │ │ Middleware that handles temporary messages. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def process_request(self, request): │ │ │ │ │ request._messages = default_storage(request) │ │ │ │ │ @@ -27,12 +27,12 @@ │ │ │ │ │ # messages storage, so make no assumption that it will be there. │ │ │ │ │ if hasattr(request, "_messages"): │ │ │ │ │ unstored_messages = request._messages.update(response) │ │ │ │ │ if unstored_messages and settings.DEBUG: │ │ │ │ │ raise ValueError("Not all temporary messages could be stored.") │ │ │ │ │ return response │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/constraints.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.postgres.constraints — Django 4.2.13 documentation │ │ │ │ + django.contrib.postgres.constraints — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.postgres.constraints

│ │ │ │ +  

Codice sorgente per django.contrib.postgres.constraints

│ │ │ │  import warnings
│ │ │ │  
│ │ │ │  from django.contrib.postgres.indexes import OpClass
│ │ │ │  from django.core.exceptions import ValidationError
│ │ │ │  from django.db import DEFAULT_DB_ALIAS, NotSupportedError
│ │ │ │  from django.db.backends.ddl_references import Expressions, Statement, Table
│ │ │ │  from django.db.models import BaseConstraint, Deferrable, F, Q
│ │ │ │ @@ -88,15 +89,15 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  class ExclusionConstraintExpression(IndexExpression):
│ │ │ │      template = "%(expressions)s WITH %(operator)s"
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ExclusionConstraint(BaseConstraint): │ │ │ │ template = ( │ │ │ │ "CONSTRAINT %(name)s EXCLUDE USING %(index_type)s " │ │ │ │ "(%(expressions)s)%(include)s%(where)s%(deferrable)s" │ │ │ │ ) │ │ │ │ │ │ │ │ def __init__( │ │ │ │ @@ -315,35 +316,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..ccoonnssttrraaiinnttss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..ccoonnssttrraaiinnttss ************ │ │ │ │ │ import warnings │ │ │ │ │ │ │ │ │ │ from django.contrib.postgres.indexes import OpClass │ │ │ │ │ from django.core.exceptions import ValidationError │ │ │ │ │ from django.db import DEFAULT_DB_ALIAS, NotSupportedError │ │ │ │ │ from django.db.backends.ddl_references import Expressions, Statement, Table │ │ │ │ │ from django.db.models import BaseConstraint, Deferrable, F, Q │ │ │ │ │ @@ -19,15 +19,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class ExclusionConstraintExpression(IndexExpression): │ │ │ │ │ template = "%(expressions)s WITH %(operator)s" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ExclusionConstraint(BaseConstraint): │ │ │ │ │ template = ( │ │ │ │ │ "CONSTRAINT %(name)s EXCLUDE USING %(index_type)s " │ │ │ │ │ "(%(expressions)s)%(include)s%(where)s%(deferrable)s" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ │ @@ -248,12 +248,12 @@ │ │ │ │ │ else: │ │ │ │ │ if (self.condition & Exists(queryset.filter(self.condition))).check │ │ │ │ │ ( │ │ │ │ │ replacement_map, using=using │ │ │ │ │ ): │ │ │ │ │ raise ValidationError(self.get_violation_error_message()) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/functions.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.postgres.functions — Django 4.2.13 documentation │ │ │ │ + django.contrib.postgres.functions — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.postgres.functions

│ │ │ │ +  

Codice sorgente per django.contrib.postgres.functions

│ │ │ │  from django.db.models import DateTimeField, Func, UUIDField
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RandomUUID(Func): │ │ │ │ template = "GEN_RANDOM_UUID()" │ │ │ │ output_field = UUIDField()
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class TransactionNow(Func): │ │ │ │ template = "CURRENT_TIMESTAMP" │ │ │ │ output_field = DateTimeField()
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ @@ -96,35 +97,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,27 +1,27 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..ffuunnccttiioonnss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..ffuunnccttiioonnss ************ │ │ │ │ │ from django.db.models import DateTimeField, Func, UUIDField │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RandomUUID(Func): │ │ │ │ │ template = "GEN_RANDOM_UUID()" │ │ │ │ │ output_field = UUIDField() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TransactionNow(Func): │ │ │ │ │ template = "CURRENT_TIMESTAMP" │ │ │ │ │ output_field = DateTimeField() │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/indexes.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.postgres.indexes — Django 4.2.13 documentation │ │ │ │ + django.contrib.postgres.indexes — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.postgres.indexes

│ │ │ │ +  

Codice sorgente per django.contrib.postgres.indexes

│ │ │ │  from django.db import NotSupportedError
│ │ │ │  from django.db.models import Func, Index
│ │ │ │  from django.utils.functional import cached_property
│ │ │ │  
│ │ │ │  __all__ = [
│ │ │ │      "BloomIndex",
│ │ │ │      "BrinIndex",
│ │ │ │ @@ -112,15 +113,15 @@
│ │ │ │          pass
│ │ │ │  
│ │ │ │      def get_with_params(self):
│ │ │ │          return []
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BloomIndex(PostgresIndex): │ │ │ │ suffix = "bloom" │ │ │ │ │ │ │ │ def __init__(self, *expressions, length=None, columns=(), **kwargs): │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ if len(self.fields) > 32: │ │ │ │ raise ValueError("Bloom indexes support a maximum of 32 fields.") │ │ │ │ @@ -156,15 +157,15 @@ │ │ │ │ "col%d = %d" % (i, v) for i, v in enumerate(self.columns, start=1) │ │ │ │ ) │ │ │ │ return with_params
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BrinIndex(PostgresIndex): │ │ │ │ suffix = "brin" │ │ │ │ │ │ │ │ def __init__( │ │ │ │ self, *expressions, autosummarize=None, pages_per_range=None, **kwargs │ │ │ │ ): │ │ │ │ if pages_per_range is not None and pages_per_range <= 0: │ │ │ │ @@ -190,15 +191,15 @@ │ │ │ │ if self.pages_per_range is not None: │ │ │ │ with_params.append("pages_per_range = %d" % self.pages_per_range) │ │ │ │ return with_params
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BTreeIndex(PostgresIndex): │ │ │ │ suffix = "btree" │ │ │ │ │ │ │ │ def __init__(self, *expressions, fillfactor=None, **kwargs): │ │ │ │ self.fillfactor = fillfactor │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ │ │ │ │ @@ -213,15 +214,15 @@ │ │ │ │ if self.fillfactor is not None: │ │ │ │ with_params.append("fillfactor = %d" % self.fillfactor) │ │ │ │ return with_params
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GinIndex(PostgresIndex): │ │ │ │ suffix = "gin" │ │ │ │ │ │ │ │ def __init__( │ │ │ │ self, *expressions, fastupdate=None, gin_pending_list_limit=None, **kwargs │ │ │ │ ): │ │ │ │ self.fastupdate = fastupdate │ │ │ │ @@ -245,15 +246,15 @@ │ │ │ │ if self.fastupdate is not None: │ │ │ │ with_params.append("fastupdate = %s" % ("on" if self.fastupdate else "off")) │ │ │ │ return with_params
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GistIndex(PostgresIndex): │ │ │ │ suffix = "gist" │ │ │ │ │ │ │ │ def __init__(self, *expressions, buffering=None, fillfactor=None, **kwargs): │ │ │ │ self.buffering = buffering │ │ │ │ self.fillfactor = fillfactor │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ @@ -273,15 +274,15 @@ │ │ │ │ if self.fillfactor is not None: │ │ │ │ with_params.append("fillfactor = %d" % self.fillfactor) │ │ │ │ return with_params
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class HashIndex(PostgresIndex): │ │ │ │ suffix = "hash" │ │ │ │ │ │ │ │ def __init__(self, *expressions, fillfactor=None, **kwargs): │ │ │ │ self.fillfactor = fillfactor │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ │ │ │ │ @@ -296,15 +297,15 @@ │ │ │ │ if self.fillfactor is not None: │ │ │ │ with_params.append("fillfactor = %d" % self.fillfactor) │ │ │ │ return with_params
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SpGistIndex(PostgresIndex): │ │ │ │ suffix = "spgist" │ │ │ │ │ │ │ │ def __init__(self, *expressions, fillfactor=None, **kwargs): │ │ │ │ self.fillfactor = fillfactor │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ │ │ │ │ @@ -326,15 +327,15 @@ │ │ │ │ and not schema_editor.connection.features.supports_covering_spgist_indexes │ │ │ │ ): │ │ │ │ raise NotSupportedError("Covering SP-GiST indexes require PostgreSQL 14+.")
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class OpClass(Func): │ │ │ │ template = "%(expressions)s %(name)s" │ │ │ │ │ │ │ │ def __init__(self, expression, name): │ │ │ │ super().__init__(expression, name=name)
│ │ │ │ │ │ │ │
│ │ │ │ @@ -345,35 +346,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..iinnddeexxeess ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..iinnddeexxeess ************ │ │ │ │ │ from django.db import NotSupportedError │ │ │ │ │ from django.db.models import Func, Index │ │ │ │ │ from django.utils.functional import cached_property │ │ │ │ │ │ │ │ │ │ __all__ = [ │ │ │ │ │ "BloomIndex", │ │ │ │ │ "BrinIndex", │ │ │ │ │ @@ -44,15 +44,15 @@ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ def get_with_params(self): │ │ │ │ │ return [] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BloomIndex(PostgresIndex): │ │ │ │ │ suffix = "bloom" │ │ │ │ │ │ │ │ │ │ def __init__(self, *expressions, length=None, columns=(), **kwargs): │ │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ │ if len(self.fields) > 32: │ │ │ │ │ raise ValueError("Bloom indexes support a maximum of 32 fields.") │ │ │ │ │ @@ -91,15 +91,15 @@ │ │ │ │ │ ) │ │ │ │ │ return with_params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BrinIndex(PostgresIndex): │ │ │ │ │ suffix = "brin" │ │ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ │ self, *expressions, autosummarize=None, pages_per_range=None, **kwargs │ │ │ │ │ ): │ │ │ │ │ if pages_per_range is not None and pages_per_range <= 0: │ │ │ │ │ @@ -127,15 +127,15 @@ │ │ │ │ │ with_params.append("pages_per_range = %d" % self.pages_per_range) │ │ │ │ │ return with_params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BTreeIndex(PostgresIndex): │ │ │ │ │ suffix = "btree" │ │ │ │ │ │ │ │ │ │ def __init__(self, *expressions, fillfactor=None, **kwargs): │ │ │ │ │ self.fillfactor = fillfactor │ │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ │ │ │ │ │ │ @@ -151,15 +151,15 @@ │ │ │ │ │ with_params.append("fillfactor = %d" % self.fillfactor) │ │ │ │ │ return with_params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GinIndex(PostgresIndex): │ │ │ │ │ suffix = "gin" │ │ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ │ self, *expressions, fastupdate=None, gin_pending_list_limit=None, │ │ │ │ │ **kwargs │ │ │ │ │ ): │ │ │ │ │ @@ -186,15 +186,15 @@ │ │ │ │ │ else "off")) │ │ │ │ │ return with_params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GistIndex(PostgresIndex): │ │ │ │ │ suffix = "gist" │ │ │ │ │ │ │ │ │ │ def __init__(self, *expressions, buffering=None, fillfactor=None, │ │ │ │ │ **kwargs): │ │ │ │ │ self.buffering = buffering │ │ │ │ │ self.fillfactor = fillfactor │ │ │ │ │ @@ -217,15 +217,15 @@ │ │ │ │ │ with_params.append("fillfactor = %d" % self.fillfactor) │ │ │ │ │ return with_params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class HashIndex(PostgresIndex): │ │ │ │ │ suffix = "hash" │ │ │ │ │ │ │ │ │ │ def __init__(self, *expressions, fillfactor=None, **kwargs): │ │ │ │ │ self.fillfactor = fillfactor │ │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ │ │ │ │ │ │ @@ -241,15 +241,15 @@ │ │ │ │ │ with_params.append("fillfactor = %d" % self.fillfactor) │ │ │ │ │ return with_params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SpGistIndex(PostgresIndex): │ │ │ │ │ suffix = "spgist" │ │ │ │ │ │ │ │ │ │ def __init__(self, *expressions, fillfactor=None, **kwargs): │ │ │ │ │ self.fillfactor = fillfactor │ │ │ │ │ super().__init__(*expressions, **kwargs) │ │ │ │ │ │ │ │ │ │ @@ -274,19 +274,19 @@ │ │ │ │ │ raise NotSupportedError("Covering SP-GiST indexes require │ │ │ │ │ PostgreSQL 14+.") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class OpClass(Func): │ │ │ │ │ template = "%(expressions)s %(name)s" │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, name): │ │ │ │ │ super().__init__(expression, name=name) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/search.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.postgres.search — Django 4.2.13 documentation │ │ │ │ + django.contrib.postgres.search — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ @@ -493,35 +494,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..sseeaarrcchh ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..sseeaarrcchh ************ │ │ │ │ │ from django.db.models import ( │ │ │ │ │ CharField, │ │ │ │ │ Expression, │ │ │ │ │ Field, │ │ │ │ │ FloatField, │ │ │ │ │ Func, │ │ │ │ │ Lookup, │ │ │ │ │ @@ -31,15 +31,15 @@ │ │ │ │ │ lhs, lhs_params = self.process_lhs(qn, connection) │ │ │ │ │ rhs, rhs_params = self.process_rhs(qn, connection) │ │ │ │ │ params = lhs_params + rhs_params │ │ │ │ │ return "%s @@ %s" % (lhs, rhs), params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SearchVectorField(Field): │ │ │ │ │ def db_type(self, connection): │ │ │ │ │ return "tsvector" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ register_combinable_fields( │ │ │ │ │ SearchVectorField, SearchVectorCombinable.ADD, SearchVectorField, │ │ │ │ │ SearchVectorField │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SearchVector(SearchVectorCombinable, Func): │ │ │ │ │ function = "to_tsvector" │ │ │ │ │ arg_joiner = " || ' ' || " │ │ │ │ │ output_field = SearchVectorField() │ │ │ │ │ │ │ │ │ │ def __init__(self, *expressions, config=None, weight=None): │ │ │ │ │ super().__init__(*expressions) │ │ │ │ │ @@ -196,15 +196,15 @@ │ │ │ │ │ return self._combine(other, self.BITAND, False) │ │ │ │ │ │ │ │ │ │ def __rand__(self, other): │ │ │ │ │ return self._combine(other, self.BITAND, True) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SearchQuery(SearchQueryCombinable, Func): │ │ │ │ │ output_field = SearchQueryField() │ │ │ │ │ SEARCH_TYPES = { │ │ │ │ │ "plain": "plainto_tsquery", │ │ │ │ │ "phrase": "phraseto_tsquery", │ │ │ │ │ "raw": "to_tsquery", │ │ │ │ │ "websearch": "websearch_to_tsquery", │ │ │ │ │ @@ -256,15 +256,15 @@ │ │ │ │ │ super().__init__(lhs, connector, rhs, output_field) │ │ │ │ │ │ │ │ │ │ def __str__(self): │ │ │ │ │ return "(%s)" % super().__str__() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SearchRank(Func): │ │ │ │ │ function = "ts_rank" │ │ │ │ │ output_field = FloatField() │ │ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ │ self, │ │ │ │ │ vector, │ │ │ │ │ @@ -293,15 +293,15 @@ │ │ │ │ │ self.function = "ts_rank_cd" │ │ │ │ │ super().__init__(*expressions) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SearchHeadline(Func): │ │ │ │ │ function = "ts_headline" │ │ │ │ │ template = "%(function)s(%(expressions)s%(options)s)" │ │ │ │ │ output_field = TextField() │ │ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ │ self, │ │ │ │ │ @@ -381,59 +381,59 @@ │ │ │ │ │ def __init__(self, string, expression, **extra): │ │ │ │ │ if not hasattr(string, "resolve_expression"): │ │ │ │ │ string = Value(string) │ │ │ │ │ super().__init__(string, expression, **extra) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TrigramSimilarity(TrigramBase): │ │ │ │ │ function = "SIMILARITY" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TrigramDistance(TrigramBase): │ │ │ │ │ function = "" │ │ │ │ │ arg_joiner = " <-> " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TrigramWordDistance(TrigramWordBase): │ │ │ │ │ function = "" │ │ │ │ │ arg_joiner = " <<-> " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TrigramStrictWordDistance(TrigramWordBase): │ │ │ │ │ function = "" │ │ │ │ │ arg_joiner = " <<<-> " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TrigramWordSimilarity(TrigramWordBase): │ │ │ │ │ function = "WORD_SIMILARITY" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TrigramStrictWordSimilarity(TrigramWordBase): │ │ │ │ │ function = "STRICT_WORD_SIMILARITY" │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/postgres/validators.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.postgres.validators — Django 4.2.13 documentation │ │ │ │ + django.contrib.postgres.validators — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.postgres.validators

│ │ │ │ +  

Codice sorgente per django.contrib.postgres.validators

│ │ │ │  from django.core.exceptions import ValidationError
│ │ │ │  from django.core.validators import (
│ │ │ │      MaxLengthValidator,
│ │ │ │      MaxValueValidator,
│ │ │ │      MinLengthValidator,
│ │ │ │      MinValueValidator,
│ │ │ │  )
│ │ │ │ @@ -100,15 +101,15 @@
│ │ │ │          "List contains %(show_value)d items, it should contain no fewer than "
│ │ │ │          "%(limit_value)d.",
│ │ │ │          "limit_value",
│ │ │ │      )
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class KeysValidator: │ │ │ │ """A validator designed for HStore to require/restrict keys.""" │ │ │ │ │ │ │ │ messages = { │ │ │ │ "missing_keys": _("Some keys were missing: %(keys)s"), │ │ │ │ "extra_keys": _("Some unknown keys were provided: %(keys)s"), │ │ │ │ @@ -146,27 +147,27 @@ │ │ │ │ and self.messages == other.messages │ │ │ │ and self.strict == other.strict │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RangeMaxValueValidator(MaxValueValidator): │ │ │ │ def compare(self, a, b): │ │ │ │ return a.upper is None or a.upper > b │ │ │ │ │ │ │ │ message = _( │ │ │ │ "Ensure that the upper bound of the range is not greater than %(limit_value)s." │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RangeMinValueValidator(MinValueValidator): │ │ │ │ def compare(self, a, b): │ │ │ │ return a.lower is None or a.lower < b │ │ │ │ │ │ │ │ message = _( │ │ │ │ "Ensure that the lower bound of the range is not less than %(limit_value)s." │ │ │ │ )
│ │ │ │ @@ -179,35 +180,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..vvaalliiddaattoorrss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ppoossttggrreess..vvaalliiddaattoorrss ************ │ │ │ │ │ from django.core.exceptions import ValidationError │ │ │ │ │ from django.core.validators import ( │ │ │ │ │ MaxLengthValidator, │ │ │ │ │ MaxValueValidator, │ │ │ │ │ MinLengthValidator, │ │ │ │ │ MinValueValidator, │ │ │ │ │ ) │ │ │ │ │ @@ -31,15 +31,15 @@ │ │ │ │ │ "List contains %(show_value)d items, it should contain no fewer than " │ │ │ │ │ "%(limit_value)d.", │ │ │ │ │ "limit_value", │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class KeysValidator: │ │ │ │ │ """A validator designed for HStore to require/restrict keys.""" │ │ │ │ │ │ │ │ │ │ messages = { │ │ │ │ │ "missing_keys": _("Some keys were missing: %(keys)s"), │ │ │ │ │ "extra_keys": _("Some unknown keys were provided: %(keys)s"), │ │ │ │ │ @@ -78,36 +78,36 @@ │ │ │ │ │ and self.strict == other.strict │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RangeMaxValueValidator(MaxValueValidator): │ │ │ │ │ def compare(self, a, b): │ │ │ │ │ return a.upper is None or a.upper > b │ │ │ │ │ │ │ │ │ │ message = _( │ │ │ │ │ "Ensure that the upper bound of the range is not greater than % │ │ │ │ │ (limit_value)s." │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RangeMinValueValidator(MinValueValidator): │ │ │ │ │ def compare(self, a, b): │ │ │ │ │ return a.lower is None or a.lower < b │ │ │ │ │ │ │ │ │ │ message = _( │ │ │ │ │ "Ensure that the lower bound of the range is not less than % │ │ │ │ │ (limit_value)s." │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sessions/exceptions.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.sessions.exceptions — Django 4.2.13 documentation │ │ │ │ + django.contrib.sessions.exceptions — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.sessions.exceptions

│ │ │ │ +  

Codice sorgente per django.contrib.sessions.exceptions

│ │ │ │  from django.core.exceptions import BadRequest, SuspiciousOperation
│ │ │ │  
│ │ │ │  
│ │ │ │  class InvalidSessionKey(SuspiciousOperation):
│ │ │ │      """Invalid characters in session key"""
│ │ │ │  
│ │ │ │      pass
│ │ │ │ @@ -83,15 +84,15 @@
│ │ │ │  class SuspiciousSession(SuspiciousOperation):
│ │ │ │      """The session may be tampered with"""
│ │ │ │  
│ │ │ │      pass
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SessionInterrupted(BadRequest): │ │ │ │ """The session was interrupted.""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -101,35 +102,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..sseessssiioonnss..eexxcceeppttiioonnss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..sseessssiioonnss..eexxcceeppttiioonnss ************ │ │ │ │ │ from django.core.exceptions import BadRequest, SuspiciousOperation │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class InvalidSessionKey(SuspiciousOperation): │ │ │ │ │ """Invalid characters in session key""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ @@ -14,18 +14,18 @@ │ │ │ │ │ class SuspiciousSession(SuspiciousOperation): │ │ │ │ │ """The session may be tampered with""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SessionInterrupted(BadRequest): │ │ │ │ │ """The session was interrupted.""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sessions/middleware.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.sessions.middleware — Django 4.2.13 documentation │ │ │ │ + django.contrib.sessions.middleware — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.sessions.middleware

│ │ │ │ +  

Codice sorgente per django.contrib.sessions.middleware

│ │ │ │  import time
│ │ │ │  from importlib import import_module
│ │ │ │  
│ │ │ │  from django.conf import settings
│ │ │ │  from django.contrib.sessions.backends.base import UpdateError
│ │ │ │  from django.contrib.sessions.exceptions import SessionInterrupted
│ │ │ │  from django.utils.cache import patch_vary_headers
│ │ │ │  from django.utils.deprecation import MiddlewareMixin
│ │ │ │  from django.utils.http import http_date
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SessionMiddleware(MiddlewareMixin): │ │ │ │ def __init__(self, get_response): │ │ │ │ super().__init__(get_response) │ │ │ │ engine = import_module(settings.SESSION_ENGINE) │ │ │ │ self.SessionStore = engine.SessionStore │ │ │ │ │ │ │ │ def process_request(self, request): │ │ │ │ @@ -159,35 +160,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,24 +1,24 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..sseessssiioonnss..mmiiddddlleewwaarree ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..sseessssiioonnss..mmiiddddlleewwaarree ************ │ │ │ │ │ import time │ │ │ │ │ from importlib import import_module │ │ │ │ │ │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.contrib.sessions.backends.base import UpdateError │ │ │ │ │ from django.contrib.sessions.exceptions import SessionInterrupted │ │ │ │ │ from django.utils.cache import patch_vary_headers │ │ │ │ │ from django.utils.deprecation import MiddlewareMixin │ │ │ │ │ from django.utils.http import http_date │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SessionMiddleware(MiddlewareMixin): │ │ │ │ │ def __init__(self, get_response): │ │ │ │ │ super().__init__(get_response) │ │ │ │ │ engine = import_module(settings.SESSION_ENGINE) │ │ │ │ │ self.SessionStore = engine.SessionStore │ │ │ │ │ │ │ │ │ │ def process_request(self, request): │ │ │ │ │ @@ -78,12 +78,12 @@ │ │ │ │ │ path=settings.SESSION_COOKIE_PATH, │ │ │ │ │ secure=settings.SESSION_COOKIE_SECURE or None, │ │ │ │ │ httponly=settings.SESSION_COOKIE_HTTPONLY or None, │ │ │ │ │ samesite=settings.SESSION_COOKIE_SAMESITE, │ │ │ │ │ ) │ │ │ │ │ return response │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sitemaps.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.sitemaps — Django 4.2.13 documentation │ │ │ │ + django.contrib.sitemaps — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.sitemaps

│ │ │ │ +  

Codice sorgente per django.contrib.sitemaps

│ │ │ │  import warnings
│ │ │ │  from urllib.parse import urlencode
│ │ │ │  from urllib.request import urlopen
│ │ │ │  
│ │ │ │  from django.apps import apps as django_apps
│ │ │ │  from django.conf import settings
│ │ │ │  from django.core import paginator
│ │ │ │ @@ -87,15 +88,15 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  class SitemapNotFound(Exception):
│ │ │ │      pass
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def ping_google(sitemap_url=None, ping_url=PING_URL, sitemap_uses_https=True): │ │ │ │ """ │ │ │ │ Alert Google that the sitemap for the current site has been updated. │ │ │ │ If sitemap_url is provided, it should be an absolute path to the sitemap │ │ │ │ for this site -- e.g., '/sitemap.xml'. If sitemap_url is not provided, this │ │ │ │ function will attempt to deduce it by using urls.reverse(). │ │ │ │ """ │ │ │ │ @@ -131,15 +132,15 @@ │ │ │ │ Site = django_apps.get_model("sites.Site") │ │ │ │ current_site = Site.objects.get_current() │ │ │ │ scheme = "https" if sitemap_uses_https else "http" │ │ │ │ return "%s://%s%s" % (scheme, current_site.domain, sitemap_url) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Sitemap: │ │ │ │ # This limit is defined by Google. See the index documentation at │ │ │ │ # https://www.sitemaps.org/protocol.html#index. │ │ │ │ limit = 50000 │ │ │ │ │ │ │ │ # If protocol is None, the URLs in the sitemap will use the protocol │ │ │ │ # with which the sitemap was requested. │ │ │ │ @@ -167,15 +168,15 @@ │ │ │ │ # Split the (item, lang_code) tuples again for the location, │ │ │ │ # priority, lastmod and changefreq method calls. │ │ │ │ item, lang_code = item │ │ │ │ return attr(item) │ │ │ │ return attr │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_languages_for_item(self, item): │ │ │ │ """Languages for which this item is displayed.""" │ │ │ │ return self._languages()
│ │ │ │ │ │ │ │ │ │ │ │ def _languages(self): │ │ │ │ if self.languages is not None: │ │ │ │ @@ -203,21 +204,21 @@ │ │ │ │ return self._get("location", item) │ │ │ │ │ │ │ │ @property │ │ │ │ def paginator(self): │ │ │ │ return paginator.Paginator(self._items(), self.limit) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def items(self): │ │ │ │ return []
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def location(self, item): │ │ │ │ return item.get_absolute_url()
│ │ │ │ │ │ │ │ │ │ │ │ def get_protocol(self, protocol=None): │ │ │ │ # Determine protocol │ │ │ │ if self.protocol is None and protocol is None: │ │ │ │ @@ -250,15 +251,15 @@ │ │ │ │ │ │ │ │ def get_urls(self, page=1, site=None, protocol=None): │ │ │ │ protocol = self.get_protocol(protocol) │ │ │ │ domain = self.get_domain(site) │ │ │ │ return self._urls(page, protocol, domain) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_latest_lastmod(self): │ │ │ │ if not hasattr(self, "lastmod"): │ │ │ │ return None │ │ │ │ if callable(self.lastmod): │ │ │ │ try: │ │ │ │ return max([self.lastmod(item) for item in self.items()], default=None) │ │ │ │ except TypeError: │ │ │ │ @@ -321,15 +322,15 @@ │ │ │ │ self.latest_lastmod = latest_lastmod │ │ │ │ │ │ │ │ return urls
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class GenericSitemap(Sitemap): │ │ │ │ priority = None │ │ │ │ changefreq = None │ │ │ │ │ │ │ │ def __init__(self, info_dict, priority=None, changefreq=None, protocol=None): │ │ │ │ self.queryset = info_dict["queryset"] │ │ │ │ self.date_field = info_dict.get("date_field") │ │ │ │ @@ -363,35 +364,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ssiitteemmaappss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ssiitteemmaappss ************ │ │ │ │ │ import warnings │ │ │ │ │ from urllib.parse import urlencode │ │ │ │ │ from urllib.request import urlopen │ │ │ │ │ │ │ │ │ │ from django.apps import apps as django_apps │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.core import paginator │ │ │ │ │ @@ -18,15 +18,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class SitemapNotFound(Exception): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def ping_google(sitemap_url=None, ping_url=PING_URL, sitemap_uses_https=True): │ │ │ │ │ """ │ │ │ │ │ Alert Google that the sitemap for the current site has been updated. │ │ │ │ │ If sitemap_url is provided, it should be an absolute path to the sitemap │ │ │ │ │ for this site -- e.g., '/sitemap.xml'. If sitemap_url is not provided, this │ │ │ │ │ function will attempt to deduce it by using urls.reverse(). │ │ │ │ │ """ │ │ │ │ │ @@ -64,15 +64,15 @@ │ │ │ │ │ Site = django_apps.get_model("sites.Site") │ │ │ │ │ current_site = Site.objects.get_current() │ │ │ │ │ scheme = "https" if sitemap_uses_https else "http" │ │ │ │ │ return "%s://%s%s" % (scheme, current_site.domain, sitemap_url) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Sitemap: │ │ │ │ │ # This limit is defined by Google. See the index documentation at │ │ │ │ │ # https://www.sitemaps.org/protocol.html#index. │ │ │ │ │ limit = 50000 │ │ │ │ │ │ │ │ │ │ # If protocol is None, the URLs in the sitemap will use the protocol │ │ │ │ │ # with which the sitemap was requested. │ │ │ │ │ @@ -100,15 +100,15 @@ │ │ │ │ │ # Split the (item, lang_code) tuples again for the location, │ │ │ │ │ # priority, lastmod and changefreq method calls. │ │ │ │ │ item, lang_code = item │ │ │ │ │ return attr(item) │ │ │ │ │ return attr │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_languages_for_item(self, item): │ │ │ │ │ """Languages for which this item is displayed.""" │ │ │ │ │ return self._languages() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def _languages(self): │ │ │ │ │ @@ -139,22 +139,22 @@ │ │ │ │ │ return self._get("location", item) │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ def paginator(self): │ │ │ │ │ return paginator.Paginator(self._items(), self.limit) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def items(self): │ │ │ │ │ return [] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def location(self, item): │ │ │ │ │ return item.get_absolute_url() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def get_protocol(self, protocol=None): │ │ │ │ │ # Determine protocol │ │ │ │ │ @@ -189,15 +189,15 @@ │ │ │ │ │ │ │ │ │ │ def get_urls(self, page=1, site=None, protocol=None): │ │ │ │ │ protocol = self.get_protocol(protocol) │ │ │ │ │ domain = self.get_domain(site) │ │ │ │ │ return self._urls(page, protocol, domain) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_latest_lastmod(self): │ │ │ │ │ if not hasattr(self, "lastmod"): │ │ │ │ │ return None │ │ │ │ │ if callable(self.lastmod): │ │ │ │ │ try: │ │ │ │ │ return max([self.lastmod(item) for item in self.items()], │ │ │ │ │ default=None) │ │ │ │ │ @@ -265,15 +265,15 @@ │ │ │ │ │ │ │ │ │ │ return urls │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class GenericSitemap(Sitemap): │ │ │ │ │ priority = None │ │ │ │ │ changefreq = None │ │ │ │ │ │ │ │ │ │ def __init__(self, info_dict, priority=None, changefreq=None, │ │ │ │ │ protocol=None): │ │ │ │ │ self.queryset = info_dict["queryset"] │ │ │ │ │ @@ -296,12 +296,12 @@ │ │ │ │ │ return ( │ │ │ │ │ self.queryset.order_by("-" + self.date_field) │ │ │ │ │ .values_list(self.date_field, flat=True) │ │ │ │ │ .first() │ │ │ │ │ ) │ │ │ │ │ return None │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/contrib/sites/middleware.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.contrib.sites.middleware — Django 4.2.13 documentation │ │ │ │ + django.contrib.sites.middleware — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.contrib.sites.middleware

│ │ │ │ +  

Codice sorgente per django.contrib.sites.middleware

│ │ │ │  from django.utils.deprecation import MiddlewareMixin
│ │ │ │  
│ │ │ │  from .shortcuts import get_current_site
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class CurrentSiteMiddleware(MiddlewareMixin): │ │ │ │ """ │ │ │ │ Middleware that sets `site` attribute to request object. │ │ │ │ """ │ │ │ │ │ │ │ │ def process_request(self, request): │ │ │ │ request.site = get_current_site(request)
│ │ │ │ @@ -94,35 +95,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,24 +1,24 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoonnttrriibb..ssiitteess..mmiiddddlleewwaarree ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoonnttrriibb..ssiitteess..mmiiddddlleewwaarree ************ │ │ │ │ │ from django.utils.deprecation import MiddlewareMixin │ │ │ │ │ │ │ │ │ │ from .shortcuts import get_current_site │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class CurrentSiteMiddleware(MiddlewareMixin): │ │ │ │ │ """ │ │ │ │ │ Middleware that sets `site` attribute to request object. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def process_request(self, request): │ │ │ │ │ request.site = get_current_site(request) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/checks/messages.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.checks.messages — Django 4.2.13 documentation │ │ │ │ + django.core.checks.messages — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.checks.messages

│ │ │ │ +  

Codice sorgente per django.core.checks.messages

│ │ │ │  # Levels
│ │ │ │  DEBUG = 10
│ │ │ │  INFO = 20
│ │ │ │  WARNING = 30
│ │ │ │  ERROR = 40
│ │ │ │  CRITICAL = 50
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class CheckMessage: │ │ │ │ def __init__(self, level, msg, hint=None, obj=None, id=None): │ │ │ │ if not isinstance(level, int): │ │ │ │ raise TypeError("The first argument should be level.") │ │ │ │ self.level = level │ │ │ │ self.msg = msg │ │ │ │ self.hint = hint │ │ │ │ @@ -129,47 +130,47 @@ │ │ │ │ from django.conf import settings │ │ │ │ │ │ │ │ return self.id in settings.SILENCED_SYSTEM_CHECKS
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Debug(CheckMessage): │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ super().__init__(DEBUG, *args, **kwargs)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Info(CheckMessage): │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ super().__init__(INFO, *args, **kwargs)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Warning(CheckMessage): │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ super().__init__(WARNING, *args, **kwargs)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Error(CheckMessage): │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ super().__init__(ERROR, *args, **kwargs)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Critical(CheckMessage): │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ super().__init__(CRITICAL, *args, **kwargs)
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ @@ -178,35 +179,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,21 +1,21 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..cchheecckkss..mmeessssaaggeess ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..cchheecckkss..mmeessssaaggeess ************ │ │ │ │ │ # Levels │ │ │ │ │ DEBUG = 10 │ │ │ │ │ INFO = 20 │ │ │ │ │ WARNING = 30 │ │ │ │ │ ERROR = 40 │ │ │ │ │ CRITICAL = 50 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class CheckMessage: │ │ │ │ │ def __init__(self, level, msg, hint=None, obj=None, id=None): │ │ │ │ │ if not isinstance(level, int): │ │ │ │ │ raise TypeError("The first argument should be level.") │ │ │ │ │ self.level = level │ │ │ │ │ self.msg = msg │ │ │ │ │ self.hint = hint │ │ │ │ │ @@ -62,53 +62,53 @@ │ │ │ │ │ │ │ │ │ │ return self.id in settings.SILENCED_SYSTEM_CHECKS │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Debug(CheckMessage): │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ super().__init__(DEBUG, *args, **kwargs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Info(CheckMessage): │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ super().__init__(INFO, *args, **kwargs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Warning(CheckMessage): │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ super().__init__(WARNING, *args, **kwargs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Error(CheckMessage): │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ super().__init__(ERROR, *args, **kwargs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Critical(CheckMessage): │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ super().__init__(CRITICAL, *args, **kwargs) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/exceptions.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.exceptions — Django 4.2.13 documentation │ │ │ │ + django.core.exceptions — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.exceptions

│ │ │ │ +  

Codice sorgente per django.core.exceptions

│ │ │ │  """
│ │ │ │  Global Django exception and warning classes.
│ │ │ │  """
│ │ │ │  import operator
│ │ │ │  
│ │ │ │  from django.utils.hashable import make_hashable
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FieldDoesNotExist(Exception): │ │ │ │ """The requested model field does not exist""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AppRegistryNotReady(Exception): │ │ │ │ """The django.apps registry is not populated yet""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ObjectDoesNotExist(Exception): │ │ │ │ """The requested object does not exist""" │ │ │ │ │ │ │ │ silent_variable_failure = True
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MultipleObjectsReturned(Exception): │ │ │ │ """The query returned multiple objects when only one was expected.""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SuspiciousOperation(Exception): │ │ │ │ """The user did something suspicious"""
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class SuspiciousMultipartForm(SuspiciousOperation): │ │ │ │ """Suspect MIME request in multipart form data""" │ │ │ │ @@ -170,81 +171,81 @@ │ │ │ │ settings.DATA_UPLOAD_MAX_MEMORY_SIZE. │ │ │ │ """ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RequestAborted(Exception): │ │ │ │ """The request was closed before it was completed, or timed out.""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BadRequest(Exception): │ │ │ │ """The request is malformed and cannot be processed.""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class PermissionDenied(Exception): │ │ │ │ """The user did not have permission to do that""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ViewDoesNotExist(Exception): │ │ │ │ """The requested view does not exist""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MiddlewareNotUsed(Exception): │ │ │ │ """This middleware is not used in this server configuration""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ImproperlyConfigured(Exception): │ │ │ │ """Django is somehow improperly configured""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FieldError(Exception): │ │ │ │ """Some kind of problem with a model field.""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ NON_FIELD_ERRORS = "__all__" │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ValidationError(Exception): │ │ │ │ """An error while validating data.""" │ │ │ │ │ │ │ │ def __init__(self, message, code=None, params=None): │ │ │ │ """ │ │ │ │ The `message` argument can be a single error, a list of errors, or a │ │ │ │ dictionary that maps field names to lists of errors. What we define as │ │ │ │ @@ -345,33 +346,33 @@ │ │ │ │ if hasattr(self, "error_dict"): │ │ │ │ return hash(make_hashable(self.error_dict)) │ │ │ │ return hash(tuple(sorted(self.error_list, key=operator.attrgetter("message"))))
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class EmptyResultSet(Exception): │ │ │ │ """A database query predicate is impossible.""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FullResultSet(Exception): │ │ │ │ """A database query predicate is matches everything.""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class SynchronousOnlyOperation(Exception): │ │ │ │ """The user tried to call a sync-only function from an async context.""" │ │ │ │ │ │ │ │ pass
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -381,35 +382,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,61 +1,61 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..eexxcceeppttiioonnss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..eexxcceeppttiioonnss ************ │ │ │ │ │ """ │ │ │ │ │ Global Django exception and warning classes. │ │ │ │ │ """ │ │ │ │ │ import operator │ │ │ │ │ │ │ │ │ │ from django.utils.hashable import make_hashable │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FieldDoesNotExist(Exception): │ │ │ │ │ """The requested model field does not exist""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AppRegistryNotReady(Exception): │ │ │ │ │ """The django.apps registry is not populated yet""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ObjectDoesNotExist(Exception): │ │ │ │ │ """The requested object does not exist""" │ │ │ │ │ │ │ │ │ │ silent_variable_failure = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MultipleObjectsReturned(Exception): │ │ │ │ │ """The query returned multiple objects when only one was expected.""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SuspiciousOperation(Exception): │ │ │ │ │ """The user did something suspicious""" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class SuspiciousMultipartForm(SuspiciousOperation): │ │ │ │ │ @@ -106,88 +106,88 @@ │ │ │ │ │ settings.DATA_UPLOAD_MAX_MEMORY_SIZE. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RequestAborted(Exception): │ │ │ │ │ """The request was closed before it was completed, or timed out.""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BadRequest(Exception): │ │ │ │ │ """The request is malformed and cannot be processed.""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class PermissionDenied(Exception): │ │ │ │ │ """The user did not have permission to do that""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ViewDoesNotExist(Exception): │ │ │ │ │ """The requested view does not exist""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MiddlewareNotUsed(Exception): │ │ │ │ │ """This middleware is not used in this server configuration""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ImproperlyConfigured(Exception): │ │ │ │ │ """Django is somehow improperly configured""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FieldError(Exception): │ │ │ │ │ """Some kind of problem with a model field.""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ NON_FIELD_ERRORS = "__all__" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ValidationError(Exception): │ │ │ │ │ """An error while validating data.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, message, code=None, params=None): │ │ │ │ │ """ │ │ │ │ │ The `message` argument can be a single error, a list of errors, or a │ │ │ │ │ dictionary that maps field names to lists of errors. What we define as │ │ │ │ │ @@ -292,38 +292,38 @@ │ │ │ │ │ return hash(tuple(sorted(self.error_list, key=operator.attrgetter │ │ │ │ │ ("message")))) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class EmptyResultSet(Exception): │ │ │ │ │ """A database query predicate is impossible.""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FullResultSet(Exception): │ │ │ │ │ """A database query predicate is matches everything.""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class SynchronousOnlyOperation(Exception): │ │ │ │ │ """The user tried to call a sync-only function from an async context.""" │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/files/base.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.files.base — Django 4.2.13 documentation │ │ │ │ + django.core.files.base — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.files.base

│ │ │ │ +  

Codice sorgente per django.core.files.base

│ │ │ │  import os
│ │ │ │  from io import BytesIO, StringIO, UnsupportedOperation
│ │ │ │  
│ │ │ │  from django.core.files.utils import FileProxyMixin
│ │ │ │  from django.utils.functional import cached_property
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class File(FileProxyMixin): │ │ │ │ DEFAULT_CHUNK_SIZE = 64 * 2**10 │ │ │ │ │ │ │ │ def __init__(self, file, name=None): │ │ │ │ self.file = file │ │ │ │ if name is None: │ │ │ │ name = getattr(file, "name", None) │ │ │ │ @@ -117,15 +118,15 @@ │ │ │ │ self.file.seek(0, os.SEEK_END) │ │ │ │ size = self.file.tell() │ │ │ │ self.file.seek(pos) │ │ │ │ return size │ │ │ │ raise AttributeError("Unable to determine the file's size.") │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def chunks(self, chunk_size=None): │ │ │ │ """ │ │ │ │ Read the file and yield chunks of ``chunk_size`` bytes (defaults to │ │ │ │ ``File.DEFAULT_CHUNK_SIZE``). │ │ │ │ """ │ │ │ │ chunk_size = chunk_size or self.DEFAULT_CHUNK_SIZE │ │ │ │ try: │ │ │ │ @@ -137,28 +138,28 @@ │ │ │ │ data = self.read(chunk_size) │ │ │ │ if not data: │ │ │ │ break │ │ │ │ yield data
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def multiple_chunks(self, chunk_size=None): │ │ │ │ """ │ │ │ │ Return ``True`` if you can expect multiple chunks. │ │ │ │ │ │ │ │ NB: If a particular file representation is in memory, subclasses should │ │ │ │ always return ``False`` -- there's no good reason to read from memory in │ │ │ │ chunks. │ │ │ │ """ │ │ │ │ return self.size > (chunk_size or self.DEFAULT_CHUNK_SIZE)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def __iter__(self): │ │ │ │ # Iterate over this file-like object by newlines │ │ │ │ buffer_ = None │ │ │ │ for chunk in self.chunks(): │ │ │ │ for line in chunk.splitlines(True): │ │ │ │ if buffer_: │ │ │ │ if endswith_cr(buffer_) and not equals_lf(line): │ │ │ │ @@ -186,35 +187,35 @@ │ │ │ │ def __enter__(self): │ │ │ │ return self │ │ │ │ │ │ │ │ def __exit__(self, exc_type, exc_value, tb): │ │ │ │ self.close() │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def open(self, mode=None): │ │ │ │ if not self.closed: │ │ │ │ self.seek(0) │ │ │ │ elif self.name and os.path.exists(self.name): │ │ │ │ self.file = open(self.name, mode or self.mode) │ │ │ │ else: │ │ │ │ raise ValueError("The file cannot be reopened.") │ │ │ │ return self
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def close(self): │ │ │ │ self.file.close()
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ContentFile(File): │ │ │ │ """ │ │ │ │ A File-like object that takes just raw content, rather than an actual file. │ │ │ │ """ │ │ │ │ │ │ │ │ def __init__(self, content, name=None): │ │ │ │ stream_class = StringIO if isinstance(content, str) else BytesIO │ │ │ │ @@ -261,35 +262,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,20 +1,20 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ffiilleess..bbaassee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ffiilleess..bbaassee ************ │ │ │ │ │ import os │ │ │ │ │ from io import BytesIO, StringIO, UnsupportedOperation │ │ │ │ │ │ │ │ │ │ from django.core.files.utils import FileProxyMixin │ │ │ │ │ from django.utils.functional import cached_property │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class File(FileProxyMixin): │ │ │ │ │ DEFAULT_CHUNK_SIZE = 64 * 2**10 │ │ │ │ │ │ │ │ │ │ def __init__(self, file, name=None): │ │ │ │ │ self.file = file │ │ │ │ │ if name is None: │ │ │ │ │ name = getattr(file, "name", None) │ │ │ │ │ @@ -48,15 +48,15 @@ │ │ │ │ │ self.file.seek(0, os.SEEK_END) │ │ │ │ │ size = self.file.tell() │ │ │ │ │ self.file.seek(pos) │ │ │ │ │ return size │ │ │ │ │ raise AttributeError("Unable to determine the file's size.") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def chunks(self, chunk_size=None): │ │ │ │ │ """ │ │ │ │ │ Read the file and yield chunks of ``chunk_size`` bytes (defaults to │ │ │ │ │ ``File.DEFAULT_CHUNK_SIZE``). │ │ │ │ │ """ │ │ │ │ │ chunk_size = chunk_size or self.DEFAULT_CHUNK_SIZE │ │ │ │ │ try: │ │ │ │ │ @@ -69,30 +69,30 @@ │ │ │ │ │ if not data: │ │ │ │ │ break │ │ │ │ │ yield data │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def multiple_chunks(self, chunk_size=None): │ │ │ │ │ """ │ │ │ │ │ Return ``True`` if you can expect multiple chunks. │ │ │ │ │ │ │ │ │ │ NB: If a particular file representation is in memory, subclasses should │ │ │ │ │ always return ``False`` -- there's no good reason to read from memory │ │ │ │ │ in │ │ │ │ │ chunks. │ │ │ │ │ """ │ │ │ │ │ return self.size > (chunk_size or self.DEFAULT_CHUNK_SIZE) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def __iter__(self): │ │ │ │ │ # Iterate over this file-like object by newlines │ │ │ │ │ buffer_ = None │ │ │ │ │ for chunk in self.chunks(): │ │ │ │ │ for line in chunk.splitlines(True): │ │ │ │ │ if buffer_: │ │ │ │ │ if endswith_cr(buffer_) and not equals_lf(line): │ │ │ │ │ @@ -121,37 +121,37 @@ │ │ │ │ │ def __enter__(self): │ │ │ │ │ return self │ │ │ │ │ │ │ │ │ │ def __exit__(self, exc_type, exc_value, tb): │ │ │ │ │ self.close() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def open(self, mode=None): │ │ │ │ │ if not self.closed: │ │ │ │ │ self.seek(0) │ │ │ │ │ elif self.name and os.path.exists(self.name): │ │ │ │ │ self.file = open(self.name, mode or self.mode) │ │ │ │ │ else: │ │ │ │ │ raise ValueError("The file cannot be reopened.") │ │ │ │ │ return self │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def close(self): │ │ │ │ │ self.file.close() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ContentFile(File): │ │ │ │ │ """ │ │ │ │ │ A File-like object that takes just raw content, rather than an actual file. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def __init__(self, content, name=None): │ │ │ │ │ stream_class = StringIO if isinstance(content, str) else BytesIO │ │ │ │ │ @@ -187,12 +187,12 @@ │ │ │ │ │ """Return True if line (a text or bytestring) ends with '\n'.""" │ │ │ │ │ return line.endswith("\n" if isinstance(line, str) else b"\n") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def equals_lf(line): │ │ │ │ │ """Return True if line (a text or bytestring) equals '\n'.""" │ │ │ │ │ return line == ("\n" if isinstance(line, str) else b"\n") │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/files/images.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.files.images — Django 4.2.13 documentation │ │ │ │ + django.core.files.images — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.files.images

│ │ │ │ +  

Codice sorgente per django.core.files.images

│ │ │ │  """
│ │ │ │  Utility functions for handling images.
│ │ │ │  
│ │ │ │  Requires Pillow as you might imagine.
│ │ │ │  """
│ │ │ │  import struct
│ │ │ │  import zlib
│ │ │ │  
│ │ │ │  from django.core.files import File
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ImageFile(File): │ │ │ │ """ │ │ │ │ A mixin for use alongside django.core.files.base.File, which provides │ │ │ │ additional features for dealing with images. │ │ │ │ """ │ │ │ │ │ │ │ │ @property │ │ │ │ @@ -170,35 +171,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,24 +1,24 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ffiilleess..iimmaaggeess ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ffiilleess..iimmaaggeess ************ │ │ │ │ │ """ │ │ │ │ │ Utility functions for handling images. │ │ │ │ │ │ │ │ │ │ Requires Pillow as you might imagine. │ │ │ │ │ """ │ │ │ │ │ import struct │ │ │ │ │ import zlib │ │ │ │ │ │ │ │ │ │ from django.core.files import File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ImageFile(File): │ │ │ │ │ """ │ │ │ │ │ A mixin for use alongside django.core.files.base.File, which provides │ │ │ │ │ additional features for dealing with images. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ @@ -90,12 +90,12 @@ │ │ │ │ │ chunk_size *= 2 │ │ │ │ │ return (None, None) │ │ │ │ │ finally: │ │ │ │ │ if close: │ │ │ │ │ file.close() │ │ │ │ │ else: │ │ │ │ │ file.seek(file_pos) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/base.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.files.storage.base — Django 4.2.13 documentation │ │ │ │ + django.core.files.storage.base — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.files.storage.base

│ │ │ │ +  

Codice sorgente per django.core.files.storage.base

│ │ │ │  import os
│ │ │ │  import pathlib
│ │ │ │  
│ │ │ │  from django.core.exceptions import SuspiciousFileOperation
│ │ │ │  from django.core.files import File
│ │ │ │  from django.core.files.utils import validate_file_name
│ │ │ │  from django.utils.crypto import get_random_string
│ │ │ │  from django.utils.text import get_valid_filename
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Storage: │ │ │ │ """ │ │ │ │ A base storage class, providing some default behaviors that all other │ │ │ │ storage systems can inherit or override, as necessary. │ │ │ │ """ │ │ │ │ │ │ │ │ # The following methods represent a public interface to private methods. │ │ │ │ # These shouldn't be overridden by subclasses unless absolutely necessary. │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def open(self, name, mode="rb"): │ │ │ │ """Retrieve the specified file from storage.""" │ │ │ │ return self._open(name, mode)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def save(self, name, content, max_length=None): │ │ │ │ """ │ │ │ │ Save new content to the file specified by name. The content should be │ │ │ │ a proper File object or any Python file-like object, ready to be read │ │ │ │ from the beginning. │ │ │ │ """ │ │ │ │ # Get the proper name for the file, as it will actually be saved. │ │ │ │ @@ -120,36 +121,36 @@ │ │ │ │ validate_file_name(name, allow_relative_path=True) │ │ │ │ return name
│ │ │ │ │ │ │ │ │ │ │ │ # These methods are part of the public API, with default implementations. │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_valid_name(self, name): │ │ │ │ """ │ │ │ │ Return a filename, based on the provided filename, that's suitable for │ │ │ │ use in the target storage system. │ │ │ │ """ │ │ │ │ return get_valid_filename(name)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_alternative_name(self, file_root, file_ext): │ │ │ │ """ │ │ │ │ Return an alternative filename, by adding an underscore and a random 7 │ │ │ │ character alphanumeric string (before the file extension, if one │ │ │ │ exists) to the filename. │ │ │ │ """ │ │ │ │ return "%s_%s%s" % (file_root, get_random_string(7), file_ext)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_available_name(self, name, max_length=None): │ │ │ │ """ │ │ │ │ Return a filename that's free on the target storage system and │ │ │ │ available for new content to be written to. │ │ │ │ """ │ │ │ │ name = str(name).replace("\\", "/") │ │ │ │ dir_name, file_name = os.path.split(name) │ │ │ │ @@ -185,15 +186,15 @@ │ │ │ │ name = os.path.join( │ │ │ │ dir_name, self.get_alternative_name(file_root, file_ext) │ │ │ │ ) │ │ │ │ return name
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def generate_filename(self, filename): │ │ │ │ """ │ │ │ │ Validate the filename by calling get_valid_name() and return a filename │ │ │ │ to be passed to the save() method. │ │ │ │ """ │ │ │ │ filename = str(filename).replace("\\", "/") │ │ │ │ # `filename` may include a path as returned by FileField.upload_to. │ │ │ │ @@ -202,107 +203,107 @@ │ │ │ │ raise SuspiciousFileOperation( │ │ │ │ "Detected path traversal attempt in '%s'" % dirname │ │ │ │ ) │ │ │ │ return os.path.normpath(os.path.join(dirname, self.get_valid_name(filename)))
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def path(self, name): │ │ │ │ """ │ │ │ │ Return a local filesystem path where the file can be retrieved using │ │ │ │ Python's built-in open() function. Storage systems that can't be │ │ │ │ accessed using open() should *not* implement this method. │ │ │ │ """ │ │ │ │ raise NotImplementedError("This backend doesn't support absolute paths.")
│ │ │ │ │ │ │ │ │ │ │ │ # The following methods form the public API for storage systems, but with │ │ │ │ # no default implementations. Subclasses must implement *all* of these. │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def delete(self, name): │ │ │ │ """ │ │ │ │ Delete the specified file from the storage system. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of Storage must provide a delete() method" │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def exists(self, name): │ │ │ │ """ │ │ │ │ Return True if a file referenced by the given name already exists in the │ │ │ │ storage system, or False if the name is available for a new file. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of Storage must provide an exists() method" │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def listdir(self, path): │ │ │ │ """ │ │ │ │ List the contents of the specified path. Return a 2-tuple of lists: │ │ │ │ the first item being directories, the second item being files. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of Storage must provide a listdir() method" │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def size(self, name): │ │ │ │ """ │ │ │ │ Return the total size, in bytes, of the file specified by name. │ │ │ │ """ │ │ │ │ raise NotImplementedError("subclasses of Storage must provide a size() method")
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def url(self, name): │ │ │ │ """ │ │ │ │ Return an absolute URL where the file's contents can be accessed │ │ │ │ directly by a web browser. │ │ │ │ """ │ │ │ │ raise NotImplementedError("subclasses of Storage must provide a url() method")
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_accessed_time(self, name): │ │ │ │ """ │ │ │ │ Return the last accessed time (as a datetime) of the file specified by │ │ │ │ name. The datetime will be timezone-aware if USE_TZ=True. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of Storage must provide a get_accessed_time() method" │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_created_time(self, name): │ │ │ │ """ │ │ │ │ Return the creation time (as a datetime) of the file specified by name. │ │ │ │ The datetime will be timezone-aware if USE_TZ=True. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of Storage must provide a get_created_time() method" │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_modified_time(self, name): │ │ │ │ """ │ │ │ │ Return the last modified time (as a datetime) of the file specified by │ │ │ │ name. The datetime will be timezone-aware if USE_TZ=True. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of Storage must provide a get_modified_time() method" │ │ │ │ @@ -317,35 +318,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,42 +1,42 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ffiilleess..ssttoorraaggee..bbaassee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ffiilleess..ssttoorraaggee..bbaassee ************ │ │ │ │ │ import os │ │ │ │ │ import pathlib │ │ │ │ │ │ │ │ │ │ from django.core.exceptions import SuspiciousFileOperation │ │ │ │ │ from django.core.files import File │ │ │ │ │ from django.core.files.utils import validate_file_name │ │ │ │ │ from django.utils.crypto import get_random_string │ │ │ │ │ from django.utils.text import get_valid_filename │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Storage: │ │ │ │ │ """ │ │ │ │ │ A base storage class, providing some default behaviors that all other │ │ │ │ │ storage systems can inherit or override, as necessary. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ # The following methods represent a public interface to private methods. │ │ │ │ │ # These shouldn't be overridden by subclasses unless absolutely necessary. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def open(self, name, mode="rb"): │ │ │ │ │ """Retrieve the specified file from storage.""" │ │ │ │ │ return self._open(name, mode) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def save(self, name, content, max_length=None): │ │ │ │ │ """ │ │ │ │ │ Save new content to the file specified by name. The content should be │ │ │ │ │ a proper File object or any Python file-like object, ready to be read │ │ │ │ │ from the beginning. │ │ │ │ │ """ │ │ │ │ │ # Get the proper name for the file, as it will actually be saved. │ │ │ │ │ @@ -53,38 +53,38 @@ │ │ │ │ │ return name │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # These methods are part of the public API, with default implementations. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_valid_name(self, name): │ │ │ │ │ """ │ │ │ │ │ Return a filename, based on the provided filename, that's suitable for │ │ │ │ │ use in the target storage system. │ │ │ │ │ """ │ │ │ │ │ return get_valid_filename(name) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_alternative_name(self, file_root, file_ext): │ │ │ │ │ """ │ │ │ │ │ Return an alternative filename, by adding an underscore and a random 7 │ │ │ │ │ character alphanumeric string (before the file extension, if one │ │ │ │ │ exists) to the filename. │ │ │ │ │ """ │ │ │ │ │ return "%s_%s%s" % (file_root, get_random_string(7), file_ext) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_available_name(self, name, max_length=None): │ │ │ │ │ """ │ │ │ │ │ Return a filename that's free on the target storage system and │ │ │ │ │ available for new content to be written to. │ │ │ │ │ """ │ │ │ │ │ name = str(name).replace("\\", "/") │ │ │ │ │ dir_name, file_name = os.path.split(name) │ │ │ │ │ @@ -121,15 +121,15 @@ │ │ │ │ │ dir_name, self.get_alternative_name(file_root, file_ext) │ │ │ │ │ ) │ │ │ │ │ return name │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def generate_filename(self, filename): │ │ │ │ │ """ │ │ │ │ │ Validate the filename by calling get_valid_name() and return a filename │ │ │ │ │ to be passed to the save() method. │ │ │ │ │ """ │ │ │ │ │ filename = str(filename).replace("\\", "/") │ │ │ │ │ # `filename` may include a path as returned by FileField.upload_to. │ │ │ │ │ @@ -140,15 +140,15 @@ │ │ │ │ │ ) │ │ │ │ │ return os.path.normpath(os.path.join(dirname, self.get_valid_name │ │ │ │ │ (filename))) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def path(self, name): │ │ │ │ │ """ │ │ │ │ │ Return a local filesystem path where the file can be retrieved using │ │ │ │ │ Python's built-in open() function. Storage systems that can't be │ │ │ │ │ accessed using open() should *not* implement this method. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError("This backend doesn't support absolute │ │ │ │ │ @@ -156,111 +156,111 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ # The following methods form the public API for storage systems, but with │ │ │ │ │ # no default implementations. Subclasses must implement *all* of these. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def delete(self, name): │ │ │ │ │ """ │ │ │ │ │ Delete the specified file from the storage system. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of Storage must provide a delete() method" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def exists(self, name): │ │ │ │ │ """ │ │ │ │ │ Return True if a file referenced by the given name already exists in │ │ │ │ │ the │ │ │ │ │ storage system, or False if the name is available for a new file. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of Storage must provide an exists() method" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def listdir(self, path): │ │ │ │ │ """ │ │ │ │ │ List the contents of the specified path. Return a 2-tuple of lists: │ │ │ │ │ the first item being directories, the second item being files. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of Storage must provide a listdir() method" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def size(self, name): │ │ │ │ │ """ │ │ │ │ │ Return the total size, in bytes, of the file specified by name. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError("subclasses of Storage must provide a size() │ │ │ │ │ method") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def url(self, name): │ │ │ │ │ """ │ │ │ │ │ Return an absolute URL where the file's contents can be accessed │ │ │ │ │ directly by a web browser. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError("subclasses of Storage must provide a url() │ │ │ │ │ method") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_accessed_time(self, name): │ │ │ │ │ """ │ │ │ │ │ Return the last accessed time (as a datetime) of the file specified by │ │ │ │ │ name. The datetime will be timezone-aware if USE_TZ=True. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of Storage must provide a get_accessed_time() method" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_created_time(self, name): │ │ │ │ │ """ │ │ │ │ │ Return the creation time (as a datetime) of the file specified by name. │ │ │ │ │ The datetime will be timezone-aware if USE_TZ=True. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of Storage must provide a get_created_time() method" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_modified_time(self, name): │ │ │ │ │ """ │ │ │ │ │ Return the last modified time (as a datetime) of the file specified by │ │ │ │ │ name. The datetime will be timezone-aware if USE_TZ=True. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of Storage must provide a get_modified_time() method" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/filesystem.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.files.storage.filesystem — Django 4.2.13 documentation │ │ │ │ + django.core.files.storage.filesystem — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.files.storage.filesystem

│ │ │ │ +  

Codice sorgente per django.core.files.storage.filesystem

│ │ │ │  import os
│ │ │ │  from datetime import datetime, timezone
│ │ │ │  from urllib.parse import urljoin
│ │ │ │  
│ │ │ │  from django.conf import settings
│ │ │ │  from django.core.files import File, locks
│ │ │ │  from django.core.files.move import file_move_safe
│ │ │ │ @@ -85,15 +86,15 @@
│ │ │ │  from django.utils.functional import cached_property
│ │ │ │  
│ │ │ │  from .base import Storage
│ │ │ │  from .mixins import StorageSettingsMixin
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible(path="django.core.files.storage.FileSystemStorage") │ │ │ │ class FileSystemStorage(Storage, StorageSettingsMixin): │ │ │ │ """ │ │ │ │ Standard filesystem storage │ │ │ │ """ │ │ │ │ │ │ │ │ # The combination of O_CREAT and O_EXCL makes os.open() raise OSError if │ │ │ │ @@ -272,15 +273,15 @@ │ │ │ │ tz = timezone.utc if settings.USE_TZ else None │ │ │ │ return datetime.fromtimestamp(ts, tz=tz) │ │ │ │ │ │ │ │ def get_accessed_time(self, name): │ │ │ │ return self._datetime_from_timestamp(os.path.getatime(self.path(name))) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_created_time(self, name): │ │ │ │ return self._datetime_from_timestamp(os.path.getctime(self.path(name)))
│ │ │ │ │ │ │ │ │ │ │ │ def get_modified_time(self, name): │ │ │ │ return self._datetime_from_timestamp(os.path.getmtime(self.path(name)))
│ │ │ │ │ │ │ │ @@ -292,35 +293,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ffiilleess..ssttoorraaggee..ffiilleessyysstteemm ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ffiilleess..ssttoorraaggee..ffiilleessyysstteemm ************ │ │ │ │ │ import os │ │ │ │ │ from datetime import datetime, timezone │ │ │ │ │ from urllib.parse import urljoin │ │ │ │ │ │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.core.files import File, locks │ │ │ │ │ from django.core.files.move import file_move_safe │ │ │ │ │ @@ -16,15 +16,15 @@ │ │ │ │ │ from django.utils.functional import cached_property │ │ │ │ │ │ │ │ │ │ from .base import Storage │ │ │ │ │ from .mixins import StorageSettingsMixin │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible(path="django.core.files.storage.FileSystemStorage") │ │ │ │ │ class FileSystemStorage(Storage, StorageSettingsMixin): │ │ │ │ │ """ │ │ │ │ │ Standard filesystem storage │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ # The combination of O_CREAT and O_EXCL makes os.open() raise OSError if │ │ │ │ │ @@ -208,21 +208,21 @@ │ │ │ │ │ tz = timezone.utc if settings.USE_TZ else None │ │ │ │ │ return datetime.fromtimestamp(ts, tz=tz) │ │ │ │ │ │ │ │ │ │ def get_accessed_time(self, name): │ │ │ │ │ return self._datetime_from_timestamp(os.path.getatime(self.path(name))) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_created_time(self, name): │ │ │ │ │ return self._datetime_from_timestamp(os.path.getctime(self.path(name))) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def get_modified_time(self, name): │ │ │ │ │ return self._datetime_from_timestamp(os.path.getmtime(self.path(name))) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage/memory.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.files.storage.memory — Django 4.2.13 documentation │ │ │ │ + django.core.files.storage.memory — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.files.storage.memory

│ │ │ │ +  

Codice sorgente per django.core.files.storage.memory

│ │ │ │  """
│ │ │ │  Based on dj-inmemorystorage (BSD) by Cody Soyland, Seán Hayes, Tore Birkeland,
│ │ │ │  and Nick Presta.
│ │ │ │  """
│ │ │ │  
│ │ │ │  import errno
│ │ │ │  import io
│ │ │ │ @@ -231,15 +232,15 @@
│ │ │ │          if name in self._children:
│ │ │ │              self._update_accessed_time()
│ │ │ │              self._update_modified_time()
│ │ │ │              del self._children[name]
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible(path="django.core.files.storage.InMemoryStorage") │ │ │ │ class InMemoryStorage(Storage, StorageSettingsMixin): │ │ │ │ """A storage saving files in memory.""" │ │ │ │ │ │ │ │ def __init__( │ │ │ │ self, │ │ │ │ location=None, │ │ │ │ @@ -372,35 +373,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ffiilleess..ssttoorraaggee..mmeemmoorryy ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ffiilleess..ssttoorraaggee..mmeemmoorryy ************ │ │ │ │ │ """ │ │ │ │ │ Based on dj-inmemorystorage (BSD) by Cody Soyland, Seán Hayes, Tore Birkeland, │ │ │ │ │ and Nick Presta. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ import errno │ │ │ │ │ import io │ │ │ │ │ @@ -166,15 +166,15 @@ │ │ │ │ │ if name in self._children: │ │ │ │ │ self._update_accessed_time() │ │ │ │ │ self._update_modified_time() │ │ │ │ │ del self._children[name] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible(path="django.core.files.storage.InMemoryStorage") │ │ │ │ │ class InMemoryStorage(Storage, StorageSettingsMixin): │ │ │ │ │ """A storage saving files in memory.""" │ │ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ │ self, │ │ │ │ │ location=None, │ │ │ │ │ @@ -300,12 +300,12 @@ │ │ │ │ │ file_node = self._resolve(name) │ │ │ │ │ return file_node.created_time │ │ │ │ │ │ │ │ │ │ def get_modified_time(self, name): │ │ │ │ │ file_node = self._resolve(name) │ │ │ │ │ return file_node.modified_time │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/files/storage.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.files.storage — Django 4.2.13 documentation │ │ │ │ + django.core.files.storage — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.files.storage

│ │ │ │ +  

Codice sorgente per django.core.files.storage

│ │ │ │  import warnings
│ │ │ │  
│ │ │ │  from django.conf import DEFAULT_STORAGE_ALIAS, settings
│ │ │ │  from django.utils.deprecation import RemovedInDjango51Warning
│ │ │ │  from django.utils.functional import LazyObject
│ │ │ │  from django.utils.module_loading import import_string
│ │ │ │  
│ │ │ │ @@ -98,27 +99,27 @@
│ │ │ │  GET_STORAGE_CLASS_DEPRECATED_MSG = (
│ │ │ │      "django.core.files.storage.get_storage_class is deprecated in favor of "
│ │ │ │      "using django.core.files.storage.storages."
│ │ │ │  )
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_storage_class(import_path=None): │ │ │ │ warnings.warn( │ │ │ │ GET_STORAGE_CLASS_DEPRECATED_MSG, │ │ │ │ RemovedInDjango51Warning, │ │ │ │ stacklevel=2, │ │ │ │ ) │ │ │ │ return import_string(import_path or settings.DEFAULT_FILE_STORAGE)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class DefaultStorage(LazyObject): │ │ │ │ def _setup(self): │ │ │ │ self._wrapped = storages[DEFAULT_STORAGE_ALIAS]
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ storages = StorageHandler() │ │ │ │ @@ -131,35 +132,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ffiilleess..ssttoorraaggee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ffiilleess..ssttoorraaggee ************ │ │ │ │ │ import warnings │ │ │ │ │ │ │ │ │ │ from django.conf import DEFAULT_STORAGE_ALIAS, settings │ │ │ │ │ from django.utils.deprecation import RemovedInDjango51Warning │ │ │ │ │ from django.utils.functional import LazyObject │ │ │ │ │ from django.utils.module_loading import import_string │ │ │ │ │ │ │ │ │ │ @@ -29,35 +29,35 @@ │ │ │ │ │ GET_STORAGE_CLASS_DEPRECATED_MSG = ( │ │ │ │ │ "django.core.files.storage.get_storage_class is deprecated in favor of " │ │ │ │ │ "using django.core.files.storage.storages." │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_storage_class(import_path=None): │ │ │ │ │ warnings.warn( │ │ │ │ │ GET_STORAGE_CLASS_DEPRECATED_MSG, │ │ │ │ │ RemovedInDjango51Warning, │ │ │ │ │ stacklevel=2, │ │ │ │ │ ) │ │ │ │ │ return import_string(import_path or settings.DEFAULT_FILE_STORAGE) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class DefaultStorage(LazyObject): │ │ │ │ │ def _setup(self): │ │ │ │ │ self._wrapped = storages[DEFAULT_STORAGE_ALIAS] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ storages = StorageHandler() │ │ │ │ │ default_storage = DefaultStorage() │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/files/uploadedfile.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.files.uploadedfile — Django 4.2.13 documentation │ │ │ │ + django.core.files.uploadedfile — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.files.uploadedfile

│ │ │ │ +  

Codice sorgente per django.core.files.uploadedfile

│ │ │ │  """
│ │ │ │  Classes representing uploaded files.
│ │ │ │  """
│ │ │ │  
│ │ │ │  import os
│ │ │ │  from io import BytesIO
│ │ │ │  
│ │ │ │ @@ -88,15 +89,15 @@
│ │ │ │      "TemporaryUploadedFile",
│ │ │ │      "InMemoryUploadedFile",
│ │ │ │      "SimpleUploadedFile",
│ │ │ │  )
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class UploadedFile(File): │ │ │ │ """ │ │ │ │ An abstract uploaded file (``TemporaryUploadedFile`` and │ │ │ │ ``InMemoryUploadedFile`` are the built-in concrete subclasses). │ │ │ │ │ │ │ │ An ``UploadedFile`` object behaves somewhat like a file object and │ │ │ │ represents some file data that the user submitted with a form. │ │ │ │ @@ -140,29 +141,29 @@ │ │ │ │ self._name = name │ │ │ │ │ │ │ │ name = property(_get_name, _set_name)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class TemporaryUploadedFile(UploadedFile): │ │ │ │ """ │ │ │ │ A file uploaded to a temporary location (i.e. stream-to-disk). │ │ │ │ """ │ │ │ │ │ │ │ │ def __init__(self, name, content_type, size, charset, content_type_extra=None): │ │ │ │ _, ext = os.path.splitext(name) │ │ │ │ file = tempfile.NamedTemporaryFile( │ │ │ │ suffix=".upload" + ext, dir=settings.FILE_UPLOAD_TEMP_DIR │ │ │ │ ) │ │ │ │ super().__init__(file, name, content_type, size, charset, content_type_extra) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def temporary_file_path(self): │ │ │ │ """Return the full path of this file.""" │ │ │ │ return self.file.name
│ │ │ │ │ │ │ │ │ │ │ │ def close(self): │ │ │ │ try: │ │ │ │ @@ -172,15 +173,15 @@ │ │ │ │ # it. Still sets self.file.close_called and calls │ │ │ │ # self.file.file.close() before the exception. │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class InMemoryUploadedFile(UploadedFile): │ │ │ │ """ │ │ │ │ A file uploaded into memory (i.e. stream-to-memory). │ │ │ │ """ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ self, │ │ │ │ @@ -241,35 +242,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ffiilleess..uuppllooaaddeeddffiillee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ffiilleess..uuppllooaaddeeddffiillee ************ │ │ │ │ │ """ │ │ │ │ │ Classes representing uploaded files. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ import os │ │ │ │ │ from io import BytesIO │ │ │ │ │ │ │ │ │ │ @@ -19,15 +19,15 @@ │ │ │ │ │ "TemporaryUploadedFile", │ │ │ │ │ "InMemoryUploadedFile", │ │ │ │ │ "SimpleUploadedFile", │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class UploadedFile(File): │ │ │ │ │ """ │ │ │ │ │ An abstract uploaded file (``TemporaryUploadedFile`` and │ │ │ │ │ ``InMemoryUploadedFile`` are the built-in concrete subclasses). │ │ │ │ │ │ │ │ │ │ An ``UploadedFile`` object behaves somewhat like a file object and │ │ │ │ │ represents some file data that the user submitted with a form. │ │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │ │ │ │ │ │ │ name = property(_get_name, _set_name) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TemporaryUploadedFile(UploadedFile): │ │ │ │ │ """ │ │ │ │ │ A file uploaded to a temporary location (i.e. stream-to-disk). │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def __init__(self, name, content_type, size, charset, │ │ │ │ │ content_type_extra=None): │ │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │ │ file = tempfile.NamedTemporaryFile( │ │ │ │ │ suffix=".upload" + ext, dir=settings.FILE_UPLOAD_TEMP_DIR │ │ │ │ │ ) │ │ │ │ │ super().__init__(file, name, content_type, size, charset, │ │ │ │ │ content_type_extra) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def temporary_file_path(self): │ │ │ │ │ """Return the full path of this file.""" │ │ │ │ │ return self.file.name │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def close(self): │ │ │ │ │ @@ -110,15 +110,15 @@ │ │ │ │ │ # self.file.file.close() before the exception. │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class InMemoryUploadedFile(UploadedFile): │ │ │ │ │ """ │ │ │ │ │ A file uploaded into memory (i.e. stream-to-memory). │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ │ self, │ │ │ │ │ @@ -171,12 +171,12 @@ │ │ │ │ │ - content │ │ │ │ │ """ │ │ │ │ │ return cls( │ │ │ │ │ file_dict["filename"], │ │ │ │ │ file_dict["content"], │ │ │ │ │ file_dict.get("content-type", "text/plain"), │ │ │ │ │ ) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/files/uploadhandler.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.files.uploadhandler — Django 4.2.13 documentation │ │ │ │ + django.core.files.uploadhandler — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.files.uploadhandler

│ │ │ │ +  

Codice sorgente per django.core.files.uploadhandler

│ │ │ │  """
│ │ │ │  Base file upload handler classes, and the built-in concrete subclasses
│ │ │ │  """
│ │ │ │  import os
│ │ │ │  from io import BytesIO
│ │ │ │  
│ │ │ │  from django.conf import settings
│ │ │ │ @@ -135,15 +136,15 @@
│ │ │ │      run should raise this exception instead of returning None.
│ │ │ │      """
│ │ │ │  
│ │ │ │      pass
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FileUploadHandler: │ │ │ │ """ │ │ │ │ Base class for streaming upload handlers. │ │ │ │ """ │ │ │ │ │ │ │ │ chunk_size = 64 * 2**10 # : The default chunk size is 64 KB. │ │ │ │ │ │ │ │ @@ -152,15 +153,15 @@ │ │ │ │ self.content_type = None │ │ │ │ self.content_length = None │ │ │ │ self.charset = None │ │ │ │ self.content_type_extra = None │ │ │ │ self.request = request │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def handle_raw_input( │ │ │ │ self, input_data, META, content_length, boundary, encoding=None │ │ │ │ ): │ │ │ │ """ │ │ │ │ Handle the raw input from the client. │ │ │ │ │ │ │ │ Parameters: │ │ │ │ @@ -175,15 +176,15 @@ │ │ │ │ :boundary: The boundary from the Content-Type header. Be sure to │ │ │ │ prepend two '--'. │ │ │ │ """ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def new_file( │ │ │ │ self, │ │ │ │ field_name, │ │ │ │ file_name, │ │ │ │ content_type, │ │ │ │ content_length, │ │ │ │ charset=None, │ │ │ │ @@ -200,63 +201,63 @@ │ │ │ │ self.content_type = content_type │ │ │ │ self.content_length = content_length │ │ │ │ self.charset = charset │ │ │ │ self.content_type_extra = content_type_extra
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def receive_data_chunk(self, raw_data, start): │ │ │ │ """ │ │ │ │ Receive data from the streamed upload parser. ``start`` is the position │ │ │ │ in the file of the chunk. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of FileUploadHandler must provide a receive_data_chunk() method" │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def file_complete(self, file_size): │ │ │ │ """ │ │ │ │ Signal that a file has completed. File size corresponds to the actual │ │ │ │ size accumulated by all the chunks. │ │ │ │ │ │ │ │ Subclasses should return a valid ``UploadedFile`` object. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of FileUploadHandler must provide a file_complete() method" │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def upload_complete(self): │ │ │ │ """ │ │ │ │ Signal that the upload is complete. Subclasses should perform cleanup │ │ │ │ that is necessary for this handler. │ │ │ │ """ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def upload_interrupted(self): │ │ │ │ """ │ │ │ │ Signal that the upload was interrupted. Subclasses should perform │ │ │ │ cleanup that is necessary for this handler. │ │ │ │ """ │ │ │ │ pass
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class TemporaryFileUploadHandler(FileUploadHandler): │ │ │ │ """ │ │ │ │ Upload handler that streams data into a temporary file. │ │ │ │ """ │ │ │ │ │ │ │ │ def new_file(self, *args, **kwargs): │ │ │ │ """ │ │ │ │ @@ -283,15 +284,15 @@ │ │ │ │ os.remove(temp_location) │ │ │ │ except FileNotFoundError: │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class MemoryFileUploadHandler(FileUploadHandler): │ │ │ │ """ │ │ │ │ File upload handler to stream uploads into memory (used for small files). │ │ │ │ """ │ │ │ │ │ │ │ │ def handle_raw_input( │ │ │ │ self, input_data, META, content_length, boundary, encoding=None │ │ │ │ @@ -357,35 +358,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ffiilleess..uuppllooaaddhhaannddlleerr ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ffiilleess..uuppllooaaddhhaannddlleerr ************ │ │ │ │ │ """ │ │ │ │ │ Base file upload handler classes, and the built-in concrete subclasses │ │ │ │ │ """ │ │ │ │ │ import os │ │ │ │ │ from io import BytesIO │ │ │ │ │ │ │ │ │ │ from django.conf import settings │ │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │ │ run should raise this exception instead of returning None. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FileUploadHandler: │ │ │ │ │ """ │ │ │ │ │ Base class for streaming upload handlers. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ chunk_size = 64 * 2**10 # : The default chunk size is 64 KB. │ │ │ │ │ │ │ │ │ │ @@ -86,15 +86,15 @@ │ │ │ │ │ self.content_type = None │ │ │ │ │ self.content_length = None │ │ │ │ │ self.charset = None │ │ │ │ │ self.content_type_extra = None │ │ │ │ │ self.request = request │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def handle_raw_input( │ │ │ │ │ self, input_data, META, content_length, boundary, encoding=None │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Handle the raw input from the client. │ │ │ │ │ │ │ │ │ │ Parameters: │ │ │ │ │ @@ -110,15 +110,15 @@ │ │ │ │ │ prepend two '--'. │ │ │ │ │ """ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def new_file( │ │ │ │ │ self, │ │ │ │ │ field_name, │ │ │ │ │ file_name, │ │ │ │ │ content_type, │ │ │ │ │ content_length, │ │ │ │ │ charset=None, │ │ │ │ │ @@ -136,29 +136,29 @@ │ │ │ │ │ self.content_length = content_length │ │ │ │ │ self.charset = charset │ │ │ │ │ self.content_type_extra = content_type_extra │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def receive_data_chunk(self, raw_data, start): │ │ │ │ │ """ │ │ │ │ │ Receive data from the streamed upload parser. ``start`` is the position │ │ │ │ │ in the file of the chunk. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of FileUploadHandler must provide a receive_data_chunk │ │ │ │ │ () method" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def file_complete(self, file_size): │ │ │ │ │ """ │ │ │ │ │ Signal that a file has completed. File size corresponds to the actual │ │ │ │ │ size accumulated by all the chunks. │ │ │ │ │ │ │ │ │ │ Subclasses should return a valid ``UploadedFile`` object. │ │ │ │ │ """ │ │ │ │ │ @@ -166,39 +166,39 @@ │ │ │ │ │ "subclasses of FileUploadHandler must provide a file_complete() │ │ │ │ │ method" │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def upload_complete(self): │ │ │ │ │ """ │ │ │ │ │ Signal that the upload is complete. Subclasses should perform cleanup │ │ │ │ │ that is necessary for this handler. │ │ │ │ │ """ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def upload_interrupted(self): │ │ │ │ │ """ │ │ │ │ │ Signal that the upload was interrupted. Subclasses should perform │ │ │ │ │ cleanup that is necessary for this handler. │ │ │ │ │ """ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TemporaryFileUploadHandler(FileUploadHandler): │ │ │ │ │ """ │ │ │ │ │ Upload handler that streams data into a temporary file. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def new_file(self, *args, **kwargs): │ │ │ │ │ """ │ │ │ │ │ @@ -227,15 +227,15 @@ │ │ │ │ │ except FileNotFoundError: │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class MemoryFileUploadHandler(FileUploadHandler): │ │ │ │ │ """ │ │ │ │ │ File upload handler to stream uploads into memory (used for small files). │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def handle_raw_input( │ │ │ │ │ self, input_data, META, content_length, boundary, encoding=None │ │ │ │ │ @@ -290,12 +290,12 @@ │ │ │ │ │ >>> load_handler( │ │ │ │ │ ... 'django.core.files.uploadhandler.TemporaryFileUploadHandler', │ │ │ │ │ ... request, │ │ │ │ │ ... ) │ │ │ │ │ │ │ │ │ │ """ │ │ │ │ │ return import_string(path)(*args, **kwargs) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/mail/message.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.mail.message — Django 4.2.13 documentation │ │ │ │ + django.core.mail.message — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.mail.message

│ │ │ │ +  

Codice sorgente per django.core.mail.message

│ │ │ │  import mimetypes
│ │ │ │  from email import charset as Charset
│ │ │ │  from email import encoders as Encoders
│ │ │ │  from email import generator, message_from_string
│ │ │ │  from email.errors import HeaderParseError
│ │ │ │  from email.header import Header
│ │ │ │  from email.headerregistry import Address, parser
│ │ │ │ @@ -258,15 +259,15 @@
│ │ │ │  
│ │ │ │      def __setitem__(self, name, val):
│ │ │ │          name, val = forbid_multi_line_headers(name, val, self.encoding)
│ │ │ │          MIMEMultipart.__setitem__(self, name, val)
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class EmailMessage: │ │ │ │ """A container for email information.""" │ │ │ │ │ │ │ │ content_subtype = "plain" │ │ │ │ mixed_subtype = "mixed" │ │ │ │ encoding = None # None => use settings default │ │ │ │ │ │ │ │ @@ -576,35 +577,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..mmaaiill..mmeessssaaggee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..mmaaiill..mmeessssaaggee ************ │ │ │ │ │ import mimetypes │ │ │ │ │ from email import charset as Charset │ │ │ │ │ from email import encoders as Encoders │ │ │ │ │ from email import generator, message_from_string │ │ │ │ │ from email.errors import HeaderParseError │ │ │ │ │ from email.header import Header │ │ │ │ │ from email.headerregistry import Address, parser │ │ │ │ │ @@ -194,15 +194,15 @@ │ │ │ │ │ │ │ │ │ │ def __setitem__(self, name, val): │ │ │ │ │ name, val = forbid_multi_line_headers(name, val, self.encoding) │ │ │ │ │ MIMEMultipart.__setitem__(self, name, val) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class EmailMessage: │ │ │ │ │ """A container for email information.""" │ │ │ │ │ │ │ │ │ │ content_subtype = "plain" │ │ │ │ │ mixed_subtype = "mixed" │ │ │ │ │ encoding = None # None => use settings default │ │ │ │ │ │ │ │ │ │ @@ -502,12 +502,12 @@ │ │ │ │ │ _subtype=self.alternative_subtype, encoding=encoding │ │ │ │ │ ) │ │ │ │ │ if self.body: │ │ │ │ │ msg.attach(body_msg) │ │ │ │ │ for alternative in self.alternatives: │ │ │ │ │ msg.attach(self._create_mime_attachment(*alternative)) │ │ │ │ │ return msg │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/mail.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.mail — Django 4.2.13 documentation │ │ │ │ + django.core.mail — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.mail

│ │ │ │ +  

Codice sorgente per django.core.mail

│ │ │ │  """
│ │ │ │  Tools for sending email.
│ │ │ │  """
│ │ │ │  from django.conf import settings
│ │ │ │  
│ │ │ │  # Imported for backwards compatibility and for the sake
│ │ │ │  # of a cleaner namespace. These symbols used to be in
│ │ │ │ @@ -109,30 +110,30 @@
│ │ │ │      "send_mass_mail",
│ │ │ │      "mail_admins",
│ │ │ │      "mail_managers",
│ │ │ │  ]
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_connection(backend=None, fail_silently=False, **kwds): │ │ │ │ """Load an email backend and return an instance of it. │ │ │ │ │ │ │ │ If backend is None (default), use settings.EMAIL_BACKEND. │ │ │ │ │ │ │ │ Both fail_silently and other keyword arguments are used in the │ │ │ │ constructor of the backend. │ │ │ │ """ │ │ │ │ klass = import_string(backend or settings.EMAIL_BACKEND) │ │ │ │ return klass(fail_silently=fail_silently, **kwds)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def send_mail( │ │ │ │ subject, │ │ │ │ message, │ │ │ │ from_email, │ │ │ │ recipient_list, │ │ │ │ fail_silently=False, │ │ │ │ auth_user=None, │ │ │ │ @@ -163,15 +164,15 @@ │ │ │ │ mail.attach_alternative(html_message, "text/html") │ │ │ │ │ │ │ │ return mail.send()
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def send_mass_mail( │ │ │ │ datatuple, fail_silently=False, auth_user=None, auth_password=None, connection=None │ │ │ │ ): │ │ │ │ """ │ │ │ │ Given a datatuple of (subject, message, from_email, recipient_list), send │ │ │ │ each message to each recipient list. Return the number of emails sent. │ │ │ │ │ │ │ │ @@ -193,15 +194,15 @@ │ │ │ │ for subject, message, sender, recipient in datatuple │ │ │ │ ] │ │ │ │ return connection.send_messages(messages)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def mail_admins( │ │ │ │ subject, message, fail_silently=False, connection=None, html_message=None │ │ │ │ ): │ │ │ │ """Send a message to the admins, as defined by the ADMINS setting.""" │ │ │ │ if not settings.ADMINS: │ │ │ │ return │ │ │ │ if not all(isinstance(a, (list, tuple)) and len(a) == 2 for a in settings.ADMINS): │ │ │ │ @@ -216,15 +217,15 @@ │ │ │ │ if html_message: │ │ │ │ mail.attach_alternative(html_message, "text/html") │ │ │ │ mail.send(fail_silently=fail_silently)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def mail_managers( │ │ │ │ subject, message, fail_silently=False, connection=None, html_message=None │ │ │ │ ): │ │ │ │ """Send a message to the managers, as defined by the MANAGERS setting.""" │ │ │ │ if not settings.MANAGERS: │ │ │ │ return │ │ │ │ if not all(isinstance(a, (list, tuple)) and len(a) == 2 for a in settings.MANAGERS): │ │ │ │ @@ -248,35 +249,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..mmaaiill ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..mmaaiill ************ │ │ │ │ │ """ │ │ │ │ │ Tools for sending email. │ │ │ │ │ """ │ │ │ │ │ from django.conf import settings │ │ │ │ │ │ │ │ │ │ # Imported for backwards compatibility and for the sake │ │ │ │ │ # of a cleaner namespace. These symbols used to be in │ │ │ │ │ @@ -40,15 +40,15 @@ │ │ │ │ │ "send_mass_mail", │ │ │ │ │ "mail_admins", │ │ │ │ │ "mail_managers", │ │ │ │ │ ] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_connection(backend=None, fail_silently=False, **kwds): │ │ │ │ │ """Load an email backend and return an instance of it. │ │ │ │ │ │ │ │ │ │ If backend is None (default), use settings.EMAIL_BACKEND. │ │ │ │ │ │ │ │ │ │ Both fail_silently and other keyword arguments are used in the │ │ │ │ │ constructor of the backend. │ │ │ │ │ @@ -56,15 +56,15 @@ │ │ │ │ │ klass = import_string(backend or settings.EMAIL_BACKEND) │ │ │ │ │ return klass(fail_silently=fail_silently, **kwds) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def send_mail( │ │ │ │ │ subject, │ │ │ │ │ message, │ │ │ │ │ from_email, │ │ │ │ │ recipient_list, │ │ │ │ │ fail_silently=False, │ │ │ │ │ auth_user=None, │ │ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │ │ │ │ │ │ │ return mail.send() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def send_mass_mail( │ │ │ │ │ datatuple, fail_silently=False, auth_user=None, auth_password=None, │ │ │ │ │ connection=None │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Given a datatuple of (subject, message, from_email, recipient_list), send │ │ │ │ │ each message to each recipient list. Return the number of emails sent. │ │ │ │ │ @@ -129,15 +129,15 @@ │ │ │ │ │ ] │ │ │ │ │ return connection.send_messages(messages) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def mail_admins( │ │ │ │ │ subject, message, fail_silently=False, connection=None, html_message=None │ │ │ │ │ ): │ │ │ │ │ """Send a message to the admins, as defined by the ADMINS setting.""" │ │ │ │ │ if not settings.ADMINS: │ │ │ │ │ return │ │ │ │ │ if not all(isinstance(a, (list, tuple)) and len(a) == 2 for a in │ │ │ │ │ @@ -154,15 +154,15 @@ │ │ │ │ │ mail.attach_alternative(html_message, "text/html") │ │ │ │ │ mail.send(fail_silently=fail_silently) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def mail_managers( │ │ │ │ │ subject, message, fail_silently=False, connection=None, html_message=None │ │ │ │ │ ): │ │ │ │ │ """Send a message to the managers, as defined by the MANAGERS setting.""" │ │ │ │ │ if not settings.MANAGERS: │ │ │ │ │ return │ │ │ │ │ if not all(isinstance(a, (list, tuple)) and len(a) == 2 for a in │ │ │ │ │ @@ -175,12 +175,12 @@ │ │ │ │ │ [a[1] for a in settings.MANAGERS], │ │ │ │ │ connection=connection, │ │ │ │ │ ) │ │ │ │ │ if html_message: │ │ │ │ │ mail.attach_alternative(html_message, "text/html") │ │ │ │ │ mail.send(fail_silently=fail_silently) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/management/base.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.management.base — Django 4.2.13 documentation │ │ │ │ + django.core.management.base — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.management.base

│ │ │ │ +  

Codice sorgente per django.core.management.base

│ │ │ │  """
│ │ │ │  Base classes for writing management commands (named commands which can
│ │ │ │  be executed through ``django-admin`` or ``manage.py``).
│ │ │ │  """
│ │ │ │  import argparse
│ │ │ │  import os
│ │ │ │  import sys
│ │ │ │ @@ -88,15 +89,15 @@
│ │ │ │  from django.core.management.color import color_style, no_style
│ │ │ │  from django.db import DEFAULT_DB_ALIAS, connections
│ │ │ │  
│ │ │ │  ALL_CHECKS = "__all__"
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class CommandError(Exception): │ │ │ │ """ │ │ │ │ Exception class indicating a problem while executing a management │ │ │ │ command. │ │ │ │ │ │ │ │ If this exception is raised during the execution of a management │ │ │ │ command, it will be caught and turned into a nicely-printed error │ │ │ │ @@ -253,15 +254,15 @@ │ │ │ │ if ending and not msg.endswith(ending): │ │ │ │ msg += ending │ │ │ │ style_func = style_func or self.style_func │ │ │ │ self._out.write(style_func(msg)) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BaseCommand: │ │ │ │ """ │ │ │ │ The base class from which all management commands ultimately │ │ │ │ derive. │ │ │ │ │ │ │ │ Use this class if you want access to all of the mechanisms which │ │ │ │ parse the command-line arguments and work out what code to call in │ │ │ │ @@ -358,26 +359,26 @@ │ │ │ │ if ( │ │ │ │ not isinstance(self.requires_system_checks, (list, tuple)) │ │ │ │ and self.requires_system_checks != ALL_CHECKS │ │ │ │ ): │ │ │ │ raise TypeError("requires_system_checks must be a list or tuple.") │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_version(self): │ │ │ │ """ │ │ │ │ Return the Django version, which should be correct for all built-in │ │ │ │ Django commands. User-supplied commands can override this method to │ │ │ │ return their own version. │ │ │ │ """ │ │ │ │ return django.get_version()
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def create_parser(self, prog_name, subcommand, **kwargs): │ │ │ │ """ │ │ │ │ Create and return the ``ArgumentParser`` which will be used to │ │ │ │ parse the arguments to this command. │ │ │ │ """ │ │ │ │ kwargs.setdefault("formatter_class", DjangoHelpFormatter) │ │ │ │ parser = CommandParser( │ │ │ │ @@ -448,15 +449,15 @@ │ │ │ │ help="Skip system checks.", │ │ │ │ ) │ │ │ │ self.add_arguments(parser) │ │ │ │ return parser
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def add_arguments(self, parser): │ │ │ │ """ │ │ │ │ Entry point for subclassed commands to add custom arguments. │ │ │ │ """ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ @@ -512,15 +513,15 @@ │ │ │ │ connections.close_all() │ │ │ │ except ImproperlyConfigured: │ │ │ │ # Ignore if connections aren't setup at this point (e.g. no │ │ │ │ # configured settings). │ │ │ │ pass │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def execute(self, *args, **options): │ │ │ │ """ │ │ │ │ Try to execute this command, performing system checks if needed (as │ │ │ │ controlled by the ``requires_system_checks`` attribute, except if │ │ │ │ force-skipped). │ │ │ │ """ │ │ │ │ if options["force_color"] and options["no_color"]: │ │ │ │ @@ -554,15 +555,15 @@ │ │ │ │ self.style.SQL_KEYWORD(connection.ops.end_transaction_sql()), │ │ │ │ ) │ │ │ │ self.stdout.write(output) │ │ │ │ return output
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def check( │ │ │ │ self, │ │ │ │ app_configs=None, │ │ │ │ tags=None, │ │ │ │ display_num_errors=False, │ │ │ │ include_deployment_checks=False, │ │ │ │ fail_level=checks.ERROR, │ │ │ │ @@ -686,15 +687,15 @@ │ │ │ │ ) │ │ │ │ ) │ │ │ │ self.stdout.write( │ │ │ │ self.style.NOTICE("Run 'python manage.py migrate' to apply them.") │ │ │ │ ) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def handle(self, *args, **options): │ │ │ │ """ │ │ │ │ The actual logic of the command. Subclasses must implement │ │ │ │ this method. │ │ │ │ """ │ │ │ │ raise NotImplementedError( │ │ │ │ "subclasses of BaseCommand must provide a handle() method" │ │ │ │ @@ -791,35 +792,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..mmaannaaggeemmeenntt..bbaassee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..mmaannaaggeemmeenntt..bbaassee ************ │ │ │ │ │ """ │ │ │ │ │ Base classes for writing management commands (named commands which can │ │ │ │ │ be executed through ``django-admin`` or ``manage.py``). │ │ │ │ │ """ │ │ │ │ │ import argparse │ │ │ │ │ import os │ │ │ │ │ import sys │ │ │ │ │ @@ -19,15 +19,15 @@ │ │ │ │ │ from django.core.management.color import color_style, no_style │ │ │ │ │ from django.db import DEFAULT_DB_ALIAS, connections │ │ │ │ │ │ │ │ │ │ ALL_CHECKS = "__all__" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class CommandError(Exception): │ │ │ │ │ """ │ │ │ │ │ Exception class indicating a problem while executing a management │ │ │ │ │ command. │ │ │ │ │ │ │ │ │ │ If this exception is raised during the execution of a management │ │ │ │ │ command, it will be caught and turned into a nicely-printed error │ │ │ │ │ @@ -188,15 +188,15 @@ │ │ │ │ │ if ending and not msg.endswith(ending): │ │ │ │ │ msg += ending │ │ │ │ │ style_func = style_func or self.style_func │ │ │ │ │ self._out.write(style_func(msg)) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BaseCommand: │ │ │ │ │ """ │ │ │ │ │ The base class from which all management commands ultimately │ │ │ │ │ derive. │ │ │ │ │ │ │ │ │ │ Use this class if you want access to all of the mechanisms which │ │ │ │ │ parse the command-line arguments and work out what code to call in │ │ │ │ │ @@ -296,27 +296,27 @@ │ │ │ │ │ if ( │ │ │ │ │ not isinstance(self.requires_system_checks, (list, tuple)) │ │ │ │ │ and self.requires_system_checks != ALL_CHECKS │ │ │ │ │ ): │ │ │ │ │ raise TypeError("requires_system_checks must be a list or tuple.") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_version(self): │ │ │ │ │ """ │ │ │ │ │ Return the Django version, which should be correct for all built-in │ │ │ │ │ Django commands. User-supplied commands can override this method to │ │ │ │ │ return their own version. │ │ │ │ │ """ │ │ │ │ │ return django.get_version() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def create_parser(self, prog_name, subcommand, **kwargs): │ │ │ │ │ """ │ │ │ │ │ Create and return the ``ArgumentParser`` which will be used to │ │ │ │ │ parse the arguments to this command. │ │ │ │ │ """ │ │ │ │ │ kwargs.setdefault("formatter_class", DjangoHelpFormatter) │ │ │ │ │ parser = CommandParser( │ │ │ │ │ @@ -390,15 +390,15 @@ │ │ │ │ │ ) │ │ │ │ │ self.add_arguments(parser) │ │ │ │ │ return parser │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def add_arguments(self, parser): │ │ │ │ │ """ │ │ │ │ │ Entry point for subclassed commands to add custom arguments. │ │ │ │ │ """ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -455,15 +455,15 @@ │ │ │ │ │ connections.close_all() │ │ │ │ │ except ImproperlyConfigured: │ │ │ │ │ # Ignore if connections aren't setup at this point (e.g. no │ │ │ │ │ # configured settings). │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def execute(self, *args, **options): │ │ │ │ │ """ │ │ │ │ │ Try to execute this command, performing system checks if needed (as │ │ │ │ │ controlled by the ``requires_system_checks`` attribute, except if │ │ │ │ │ force-skipped). │ │ │ │ │ """ │ │ │ │ │ if options["force_color"] and options["no_color"]: │ │ │ │ │ @@ -502,15 +502,15 @@ │ │ │ │ │ ) │ │ │ │ │ self.stdout.write(output) │ │ │ │ │ return output │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def check( │ │ │ │ │ self, │ │ │ │ │ app_configs=None, │ │ │ │ │ tags=None, │ │ │ │ │ display_num_errors=False, │ │ │ │ │ include_deployment_checks=False, │ │ │ │ │ fail_level=checks.ERROR, │ │ │ │ │ @@ -644,15 +644,15 @@ │ │ │ │ │ ) │ │ │ │ │ self.stdout.write( │ │ │ │ │ self.style.NOTICE("Run 'python manage.py migrate' to apply │ │ │ │ │ them.") │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def handle(self, *args, **options): │ │ │ │ │ """ │ │ │ │ │ The actual logic of the command. Subclasses must implement │ │ │ │ │ this method. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of BaseCommand must provide a handle() method" │ │ │ │ │ @@ -740,12 +740,12 @@ │ │ │ │ │ """ │ │ │ │ │ Perform the command's actions for ``label``, which will be the │ │ │ │ │ string as given on the command line. │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError( │ │ │ │ │ "subclasses of LabelCommand must provide a handle_label() method" │ │ │ │ │ ) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/paginator.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.paginator — Django 4.2.13 documentation │ │ │ │ + django.core.paginator — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.paginator

│ │ │ │ +  

Codice sorgente per django.core.paginator

│ │ │ │  import collections.abc
│ │ │ │  import inspect
│ │ │ │  import warnings
│ │ │ │  from math import ceil
│ │ │ │  
│ │ │ │  from django.utils.functional import cached_property
│ │ │ │  from django.utils.inspect import method_has_no_args
│ │ │ │ @@ -82,36 +83,36 @@
│ │ │ │  
│ │ │ │  
│ │ │ │  class UnorderedObjectListWarning(RuntimeWarning):
│ │ │ │      pass
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class InvalidPage(Exception): │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class PageNotAnInteger(InvalidPage): │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class EmptyPage(InvalidPage): │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Paginator: │ │ │ │ # Translators: String used to replace omitted page numbers in elided page │ │ │ │ # range generated by paginators, e.g. [1, 2, '…', 5, 6, 7, '…', 9, 10]. │ │ │ │ ELLIPSIS = _("…") │ │ │ │ │ │ │ │ def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True): │ │ │ │ self.object_list = object_list │ │ │ │ @@ -135,15 +136,15 @@ │ │ │ │ if number < 1: │ │ │ │ raise EmptyPage(_("That page number is less than 1")) │ │ │ │ if number > self.num_pages: │ │ │ │ raise EmptyPage(_("That page contains no results")) │ │ │ │ return number │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_page(self, number): │ │ │ │ """ │ │ │ │ Return a valid page, even if the page argument isn't a number or isn't │ │ │ │ in range. │ │ │ │ """ │ │ │ │ try: │ │ │ │ number = self.validate_number(number) │ │ │ │ @@ -151,15 +152,15 @@ │ │ │ │ number = 1 │ │ │ │ except EmptyPage: │ │ │ │ number = self.num_pages │ │ │ │ return self.page(number)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def page(self, number): │ │ │ │ """Return a Page object for the given 1-based page number.""" │ │ │ │ number = self.validate_number(number) │ │ │ │ bottom = (number - 1) * self.per_page │ │ │ │ top = bottom + self.per_page │ │ │ │ if top + self.orphans >= self.count: │ │ │ │ top = self.count │ │ │ │ @@ -216,15 +217,15 @@ │ │ │ │ "Pagination may yield inconsistent results with an unordered " │ │ │ │ "object_list: {}.".format(obj_list_repr), │ │ │ │ UnorderedObjectListWarning, │ │ │ │ stacklevel=3, │ │ │ │ ) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_elided_page_range(self, number=1, *, on_each_side=3, on_ends=2): │ │ │ │ """ │ │ │ │ Return a 1-based range of pages with some values elided. │ │ │ │ │ │ │ │ If the page range is larger than a given size, the whole range is not │ │ │ │ provided and a compact form is returned instead, e.g. for a paginator │ │ │ │ with 50 pages, if page 43 were the current page, the output, with the │ │ │ │ @@ -252,15 +253,15 @@ │ │ │ │ else: │ │ │ │ yield from range(number + 1, self.num_pages + 1)
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Page(collections.abc.Sequence): │ │ │ │ def __init__(self, object_list, number, paginator): │ │ │ │ self.object_list = object_list │ │ │ │ self.number = number │ │ │ │ self.paginator = paginator │ │ │ │ │ │ │ │ def __repr__(self): │ │ │ │ @@ -278,58 +279,58 @@ │ │ │ │ # The object_list is converted to a list so that if it was a QuerySet │ │ │ │ # it won't be a database hit per __getitem__. │ │ │ │ if not isinstance(self.object_list, list): │ │ │ │ self.object_list = list(self.object_list) │ │ │ │ return self.object_list[index] │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def has_next(self): │ │ │ │ return self.number < self.paginator.num_pages
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def has_previous(self): │ │ │ │ return self.number > 1
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def has_other_pages(self): │ │ │ │ return self.has_previous() or self.has_next()
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def next_page_number(self): │ │ │ │ return self.paginator.validate_number(self.number + 1)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def previous_page_number(self): │ │ │ │ return self.paginator.validate_number(self.number - 1)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def start_index(self): │ │ │ │ """ │ │ │ │ Return the 1-based index of the first object on this page, │ │ │ │ relative to total objects in the paginator. │ │ │ │ """ │ │ │ │ # Special case, return zero if no items. │ │ │ │ if self.paginator.count == 0: │ │ │ │ return 0 │ │ │ │ return (self.paginator.per_page * (self.number - 1)) + 1
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def end_index(self): │ │ │ │ """ │ │ │ │ Return the 1-based index of the last object on this page, │ │ │ │ relative to total objects found (hits). │ │ │ │ """ │ │ │ │ # Special case for the last page because there can be orphans. │ │ │ │ if self.number == self.paginator.num_pages: │ │ │ │ @@ -345,35 +346,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ppaaggiinnaattoorr ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ppaaggiinnaattoorr ************ │ │ │ │ │ import collections.abc │ │ │ │ │ import inspect │ │ │ │ │ import warnings │ │ │ │ │ from math import ceil │ │ │ │ │ │ │ │ │ │ from django.utils.functional import cached_property │ │ │ │ │ from django.utils.inspect import method_has_no_args │ │ │ │ │ @@ -13,39 +13,39 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ class UnorderedObjectListWarning(RuntimeWarning): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class InvalidPage(Exception): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class PageNotAnInteger(InvalidPage): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class EmptyPage(InvalidPage): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Paginator: │ │ │ │ │ # Translators: String used to replace omitted page numbers in elided page │ │ │ │ │ # range generated by paginators, e.g. [1, 2, '…', 5, 6, 7, '…', 9, 10]. │ │ │ │ │ ELLIPSIS = _("…") │ │ │ │ │ │ │ │ │ │ def __init__(self, object_list, per_page, orphans=0, │ │ │ │ │ allow_empty_first_page=True): │ │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ │ if number < 1: │ │ │ │ │ raise EmptyPage(_("That page number is less than 1")) │ │ │ │ │ if number > self.num_pages: │ │ │ │ │ raise EmptyPage(_("That page contains no results")) │ │ │ │ │ return number │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_page(self, number): │ │ │ │ │ """ │ │ │ │ │ Return a valid page, even if the page argument isn't a number or isn't │ │ │ │ │ in range. │ │ │ │ │ """ │ │ │ │ │ try: │ │ │ │ │ number = self.validate_number(number) │ │ │ │ │ @@ -87,15 +87,15 @@ │ │ │ │ │ except EmptyPage: │ │ │ │ │ number = self.num_pages │ │ │ │ │ return self.page(number) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def page(self, number): │ │ │ │ │ """Return a Page object for the given 1-based page number.""" │ │ │ │ │ number = self.validate_number(number) │ │ │ │ │ bottom = (number - 1) * self.per_page │ │ │ │ │ top = bottom + self.per_page │ │ │ │ │ if top + self.orphans >= self.count: │ │ │ │ │ top = self.count │ │ │ │ │ @@ -153,15 +153,15 @@ │ │ │ │ │ "Pagination may yield inconsistent results with an unordered " │ │ │ │ │ "object_list: {}.".format(obj_list_repr), │ │ │ │ │ UnorderedObjectListWarning, │ │ │ │ │ stacklevel=3, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_elided_page_range(self, number=1, *, on_each_side=3, on_ends=2): │ │ │ │ │ """ │ │ │ │ │ Return a 1-based range of pages with some values elided. │ │ │ │ │ │ │ │ │ │ If the page range is larger than a given size, the whole range is not │ │ │ │ │ provided and a compact form is returned instead, e.g. for a paginator │ │ │ │ │ with 50 pages, if page 43 were the current page, the output, with the │ │ │ │ │ @@ -190,15 +190,15 @@ │ │ │ │ │ yield from range(number + 1, self.num_pages + 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Page(collections.abc.Sequence): │ │ │ │ │ def __init__(self, object_list, number, paginator): │ │ │ │ │ self.object_list = object_list │ │ │ │ │ self.number = number │ │ │ │ │ self.paginator = paginator │ │ │ │ │ │ │ │ │ │ def __repr__(self): │ │ │ │ │ @@ -216,73 +216,73 @@ │ │ │ │ │ # The object_list is converted to a list so that if it was a QuerySet │ │ │ │ │ # it won't be a database hit per __getitem__. │ │ │ │ │ if not isinstance(self.object_list, list): │ │ │ │ │ self.object_list = list(self.object_list) │ │ │ │ │ return self.object_list[index] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def has_next(self): │ │ │ │ │ return self.number < self.paginator.num_pages │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def has_previous(self): │ │ │ │ │ return self.number > 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def has_other_pages(self): │ │ │ │ │ return self.has_previous() or self.has_next() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def next_page_number(self): │ │ │ │ │ return self.paginator.validate_number(self.number + 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def previous_page_number(self): │ │ │ │ │ return self.paginator.validate_number(self.number - 1) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def start_index(self): │ │ │ │ │ """ │ │ │ │ │ Return the 1-based index of the first object on this page, │ │ │ │ │ relative to total objects in the paginator. │ │ │ │ │ """ │ │ │ │ │ # Special case, return zero if no items. │ │ │ │ │ if self.paginator.count == 0: │ │ │ │ │ return 0 │ │ │ │ │ return (self.paginator.per_page * (self.number - 1)) + 1 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def end_index(self): │ │ │ │ │ """ │ │ │ │ │ Return the 1-based index of the last object on this page, │ │ │ │ │ relative to total objects found (hits). │ │ │ │ │ """ │ │ │ │ │ # Special case for the last page because there can be orphans. │ │ │ │ │ if self.number == self.paginator.num_pages: │ │ │ │ │ return self.paginator.count │ │ │ │ │ return self.number * self.paginator.per_page │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/signing.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.signing — Django 4.2.13 documentation │ │ │ │ + django.core.signing — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.signing

│ │ │ │ +  

Codice sorgente per django.core.signing

│ │ │ │  """
│ │ │ │  Functions for creating and restoring url-safe signed JSON objects.
│ │ │ │  
│ │ │ │  The format used looks like this:
│ │ │ │  
│ │ │ │  >>> signing.dumps("hello")
│ │ │ │  'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk'
│ │ │ │ @@ -200,15 +201,15 @@
│ │ │ │          return json.dumps(obj, separators=(",", ":")).encode("latin-1")
│ │ │ │  
│ │ │ │      def loads(self, data):
│ │ │ │          return json.loads(data.decode("latin-1"))
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def dumps( │ │ │ │ obj, key=None, salt="django.core.signing", serializer=JSONSerializer, compress=False │ │ │ │ ): │ │ │ │ """ │ │ │ │ Return URL-safe, hmac signed base64 compressed JSON string. If key is │ │ │ │ None, use settings.SECRET_KEY instead. The hmac algorithm is the default │ │ │ │ Signer algorithm. │ │ │ │ @@ -227,15 +228,15 @@ │ │ │ │ return TimestampSigner(key=key, salt=salt).sign_object( │ │ │ │ obj, serializer=serializer, compress=compress │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def loads( │ │ │ │ s, │ │ │ │ key=None, │ │ │ │ salt="django.core.signing", │ │ │ │ serializer=JSONSerializer, │ │ │ │ max_age=None, │ │ │ │ fallback_keys=None, │ │ │ │ @@ -252,15 +253,15 @@ │ │ │ │ serializer=serializer, │ │ │ │ max_age=max_age, │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Signer: │ │ │ │ # RemovedInDjango51Warning: When the deprecation ends, replace with: │ │ │ │ # def __init__( │ │ │ │ # self, *, key=None, sep=":", salt=None, algorithm=None, fallback_keys=None │ │ │ │ # ): │ │ │ │ def __init__( │ │ │ │ self, │ │ │ │ @@ -355,28 +356,28 @@ │ │ │ │ if decompress: │ │ │ │ data = zlib.decompress(data) │ │ │ │ return serializer().loads(data)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class TimestampSigner(Signer): │ │ │ │ def timestamp(self): │ │ │ │ return b62_encode(int(time.time())) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def sign(self, value): │ │ │ │ value = "%s%s%s" % (value, self.sep, self.timestamp()) │ │ │ │ return super().sign(value)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def unsign(self, value, max_age=None): │ │ │ │ """ │ │ │ │ Retrieve original value and check it wasn't signed more │ │ │ │ than max_age seconds ago. │ │ │ │ """ │ │ │ │ result = super().unsign(value) │ │ │ │ value, timestamp = result.rsplit(self.sep, 1) │ │ │ │ @@ -399,35 +400,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..ssiiggnniinngg ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..ssiiggnniinngg ************ │ │ │ │ │ """ │ │ │ │ │ Functions for creating and restoring url-safe signed JSON objects. │ │ │ │ │ │ │ │ │ │ The format used looks like this: │ │ │ │ │ │ │ │ │ │ >>> signing.dumps("hello") │ │ │ │ │ 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' │ │ │ │ │ @@ -134,15 +134,15 @@ │ │ │ │ │ return json.dumps(obj, separators=(",", ":")).encode("latin-1") │ │ │ │ │ │ │ │ │ │ def loads(self, data): │ │ │ │ │ return json.loads(data.decode("latin-1")) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def dumps( │ │ │ │ │ obj, key=None, salt="django.core.signing", serializer=JSONSerializer, │ │ │ │ │ compress=False │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Return URL-safe, hmac signed base64 compressed JSON string. If key is │ │ │ │ │ None, use settings.SECRET_KEY instead. The hmac algorithm is the default │ │ │ │ │ @@ -163,15 +163,15 @@ │ │ │ │ │ obj, serializer=serializer, compress=compress │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def loads( │ │ │ │ │ s, │ │ │ │ │ key=None, │ │ │ │ │ salt="django.core.signing", │ │ │ │ │ serializer=JSONSerializer, │ │ │ │ │ max_age=None, │ │ │ │ │ fallback_keys=None, │ │ │ │ │ @@ -189,15 +189,15 @@ │ │ │ │ │ max_age=max_age, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Signer: │ │ │ │ │ # RemovedInDjango51Warning: When the deprecation ends, replace with: │ │ │ │ │ # def __init__( │ │ │ │ │ # self, *, key=None, sep=":", salt=None, algorithm=None, │ │ │ │ │ fallback_keys=None │ │ │ │ │ # ): │ │ │ │ │ def __init__( │ │ │ │ │ @@ -296,29 +296,29 @@ │ │ │ │ │ data = zlib.decompress(data) │ │ │ │ │ return serializer().loads(data) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class TimestampSigner(Signer): │ │ │ │ │ def timestamp(self): │ │ │ │ │ return b62_encode(int(time.time())) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def sign(self, value): │ │ │ │ │ value = "%s%s%s" % (value, self.sep, self.timestamp()) │ │ │ │ │ return super().sign(value) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def unsign(self, value, max_age=None): │ │ │ │ │ """ │ │ │ │ │ Retrieve original value and check it wasn't signed more │ │ │ │ │ than max_age seconds ago. │ │ │ │ │ """ │ │ │ │ │ result = super().unsign(value) │ │ │ │ │ value, timestamp = result.rsplit(self.sep, 1) │ │ │ │ │ @@ -330,12 +330,12 @@ │ │ │ │ │ age = time.time() - timestamp │ │ │ │ │ if age > max_age: │ │ │ │ │ raise SignatureExpired("Signature age %s > %s seconds" % (age, │ │ │ │ │ max_age)) │ │ │ │ │ return value │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/core/validators.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.core.validators — Django 4.2.13 documentation │ │ │ │ + django.core.validators — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.core.validators

│ │ │ │ +  

Codice sorgente per django.core.validators

│ │ │ │  import ipaddress
│ │ │ │  import math
│ │ │ │  import re
│ │ │ │  from pathlib import Path
│ │ │ │  from urllib.parse import urlsplit, urlunsplit
│ │ │ │  
│ │ │ │  from django.core.exceptions import ValidationError
│ │ │ │ @@ -86,15 +87,15 @@
│ │ │ │  from django.utils.translation import ngettext_lazy
│ │ │ │  
│ │ │ │  # These values, if given to validate(), will trigger the self.required check.
│ │ │ │  EMPTY_VALUES = (None, "", [], (), {})
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class RegexValidator: │ │ │ │ regex = "" │ │ │ │ message = _("Enter a valid value.") │ │ │ │ code = "invalid" │ │ │ │ inverse_match = False │ │ │ │ flags = 0 │ │ │ │ @@ -138,15 +139,15 @@ │ │ │ │ and (self.code == other.code) │ │ │ │ and (self.inverse_match == other.inverse_match) │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class URLValidator(RegexValidator): │ │ │ │ ul = "\u00a1-\uffff" # Unicode letters range (must not be a raw string). │ │ │ │ │ │ │ │ # IP patterns │ │ │ │ ipv4_re = ( │ │ │ │ r"(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)" │ │ │ │ @@ -247,15 +248,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ def validate_integer(value): │ │ │ │ return integer_validator(value) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class EmailValidator: │ │ │ │ message = _("Enter a valid email address.") │ │ │ │ code = "invalid" │ │ │ │ user_regex = _lazy_re_compile( │ │ │ │ # dot-atom │ │ │ │ r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*\Z" │ │ │ │ @@ -350,15 +351,15 @@ │ │ │ │ "hyphens." │ │ │ │ ), │ │ │ │ "invalid", │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate_ipv4_address(value): │ │ │ │ try: │ │ │ │ ipaddress.IPv4Address(value) │ │ │ │ except ValueError: │ │ │ │ raise ValidationError( │ │ │ │ _("Enter a valid IPv4 address."), code="invalid", params={"value": value} │ │ │ │ ) │ │ │ │ @@ -372,25 +373,25 @@ │ │ │ │ code="invalid", │ │ │ │ params={"value": value}, │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate_ipv6_address(value): │ │ │ │ if not is_valid_ipv6_address(value): │ │ │ │ raise ValidationError( │ │ │ │ _("Enter a valid IPv6 address."), code="invalid", params={"value": value} │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate_ipv46_address(value): │ │ │ │ try: │ │ │ │ validate_ipv4_address(value) │ │ │ │ except ValidationError: │ │ │ │ try: │ │ │ │ validate_ipv6_address(value) │ │ │ │ except ValidationError: │ │ │ │ @@ -424,15 +425,15 @@ │ │ │ │ raise ValueError( │ │ │ │ "The protocol '%s' is unknown. Supported: %s" │ │ │ │ % (protocol, list(ip_address_validator_map)) │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def int_list_validator(sep=",", message=None, code="invalid", allow_negative=False): │ │ │ │ regexp = _lazy_re_compile( │ │ │ │ r"^%(neg)s\d+(?:%(sep)s%(neg)s\d+)*\Z" │ │ │ │ % { │ │ │ │ "neg": "(-)?" if allow_negative else "", │ │ │ │ "sep": re.escape(sep), │ │ │ │ } │ │ │ │ @@ -478,51 +479,51 @@ │ │ │ │ return a is not b │ │ │ │ │ │ │ │ def clean(self, x): │ │ │ │ return x │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class MaxValueValidator(BaseValidator): │ │ │ │ message = _("Ensure this value is less than or equal to %(limit_value)s.") │ │ │ │ code = "max_value" │ │ │ │ │ │ │ │ def compare(self, a, b): │ │ │ │ return a > b
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class MinValueValidator(BaseValidator): │ │ │ │ message = _("Ensure this value is greater than or equal to %(limit_value)s.") │ │ │ │ code = "min_value" │ │ │ │ │ │ │ │ def compare(self, a, b): │ │ │ │ return a < b
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class StepValueValidator(BaseValidator): │ │ │ │ message = _("Ensure this value is a multiple of step size %(limit_value)s.") │ │ │ │ code = "step_size" │ │ │ │ │ │ │ │ def compare(self, a, b): │ │ │ │ return not math.isclose(math.remainder(a, b), 0, abs_tol=1e-9)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class MinLengthValidator(BaseValidator): │ │ │ │ message = ngettext_lazy( │ │ │ │ "Ensure this value has at least %(limit_value)d character (it has " │ │ │ │ "%(show_value)d).", │ │ │ │ "Ensure this value has at least %(limit_value)d characters (it has " │ │ │ │ "%(show_value)d).", │ │ │ │ @@ -535,15 +536,15 @@ │ │ │ │ │ │ │ │ def clean(self, x): │ │ │ │ return len(x)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class MaxLengthValidator(BaseValidator): │ │ │ │ message = ngettext_lazy( │ │ │ │ "Ensure this value has at most %(limit_value)d character (it has " │ │ │ │ "%(show_value)d).", │ │ │ │ "Ensure this value has at most %(limit_value)d characters (it has " │ │ │ │ "%(show_value)d).", │ │ │ │ @@ -556,15 +557,15 @@ │ │ │ │ │ │ │ │ def clean(self, x): │ │ │ │ return len(x)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class DecimalValidator: │ │ │ │ """ │ │ │ │ Validate that the input does not exceed the maximum number of digits │ │ │ │ expected, otherwise raise ValidationError. │ │ │ │ """ │ │ │ │ │ │ │ │ @@ -647,15 +648,15 @@ │ │ │ │ and self.max_digits == other.max_digits │ │ │ │ and self.decimal_places == other.decimal_places │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class FileExtensionValidator: │ │ │ │ message = _( │ │ │ │ "File extension “%(extension)s” is not allowed. " │ │ │ │ "Allowed extensions are: %(allowed_extensions)s." │ │ │ │ ) │ │ │ │ code = "invalid_extension" │ │ │ │ @@ -704,24 +705,24 @@ │ │ │ │ return [] │ │ │ │ else: │ │ │ │ Image.init() │ │ │ │ return [ext.lower()[1:] for ext in Image.EXTENSION] │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate_image_file_extension(value): │ │ │ │ return FileExtensionValidator(allowed_extensions=get_available_image_extensions())( │ │ │ │ value │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @deconstructible │ │ │ │ class ProhibitNullCharactersValidator: │ │ │ │ """Validate that the string doesn't contain the null character.""" │ │ │ │ │ │ │ │ message = _("Null characters are not allowed.") │ │ │ │ code = "null_characters_not_allowed" │ │ │ │ │ │ │ │ @@ -750,35 +751,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ccoorree..vvaalliiddaattoorrss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ccoorree..vvaalliiddaattoorrss ************ │ │ │ │ │ import ipaddress │ │ │ │ │ import math │ │ │ │ │ import re │ │ │ │ │ from pathlib import Path │ │ │ │ │ from urllib.parse import urlsplit, urlunsplit │ │ │ │ │ │ │ │ │ │ from django.core.exceptions import ValidationError │ │ │ │ │ @@ -17,15 +17,15 @@ │ │ │ │ │ from django.utils.translation import ngettext_lazy │ │ │ │ │ │ │ │ │ │ # These values, if given to validate(), will trigger the self.required check. │ │ │ │ │ EMPTY_VALUES = (None, "", [], (), {}) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class RegexValidator: │ │ │ │ │ regex = "" │ │ │ │ │ message = _("Enter a valid value.") │ │ │ │ │ code = "invalid" │ │ │ │ │ inverse_match = False │ │ │ │ │ flags = 0 │ │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │ │ and (self.inverse_match == other.inverse_match) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class URLValidator(RegexValidator): │ │ │ │ │ ul = "\u00a1-\uffff" # Unicode letters range (must not be a raw string). │ │ │ │ │ │ │ │ │ │ # IP patterns │ │ │ │ │ ipv4_re = ( │ │ │ │ │ r"(?:0|25[0-5]|2[0-4][0-9]|1[0-9]?[0-9]?|[1-9][0-9]?)" │ │ │ │ │ @@ -191,15 +191,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def validate_integer(value): │ │ │ │ │ return integer_validator(value) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class EmailValidator: │ │ │ │ │ message = _("Enter a valid email address.") │ │ │ │ │ code = "invalid" │ │ │ │ │ user_regex = _lazy_re_compile( │ │ │ │ │ # dot-atom │ │ │ │ │ r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*\Z" │ │ │ │ │ @@ -303,15 +303,15 @@ │ │ │ │ │ "hyphens." │ │ │ │ │ ), │ │ │ │ │ "invalid", │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate_ipv4_address(value): │ │ │ │ │ try: │ │ │ │ │ ipaddress.IPv4Address(value) │ │ │ │ │ except ValueError: │ │ │ │ │ raise ValidationError( │ │ │ │ │ _("Enter a valid IPv4 address."), code="invalid", params={"value": │ │ │ │ │ value} │ │ │ │ │ @@ -327,27 +327,27 @@ │ │ │ │ │ params={"value": value}, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate_ipv6_address(value): │ │ │ │ │ if not is_valid_ipv6_address(value): │ │ │ │ │ raise ValidationError( │ │ │ │ │ _("Enter a valid IPv6 address."), code="invalid", params={"value": │ │ │ │ │ value} │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate_ipv46_address(value): │ │ │ │ │ try: │ │ │ │ │ validate_ipv4_address(value) │ │ │ │ │ except ValidationError: │ │ │ │ │ try: │ │ │ │ │ validate_ipv6_address(value) │ │ │ │ │ except ValidationError: │ │ │ │ │ @@ -383,15 +383,15 @@ │ │ │ │ │ raise ValueError( │ │ │ │ │ "The protocol '%s' is unknown. Supported: %s" │ │ │ │ │ % (protocol, list(ip_address_validator_map)) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def int_list_validator(sep=",", message=None, code="invalid", │ │ │ │ │ allow_negative=False): │ │ │ │ │ regexp = _lazy_re_compile( │ │ │ │ │ r"^%(neg)s\d+(?:%(sep)s%(neg)s\d+)*\Z" │ │ │ │ │ % { │ │ │ │ │ "neg": "(-)?" if allow_negative else "", │ │ │ │ │ "sep": re.escape(sep), │ │ │ │ │ @@ -441,56 +441,56 @@ │ │ │ │ │ return a is not b │ │ │ │ │ │ │ │ │ │ def clean(self, x): │ │ │ │ │ return x │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class MaxValueValidator(BaseValidator): │ │ │ │ │ message = _("Ensure this value is less than or equal to %(limit_value)s.") │ │ │ │ │ code = "max_value" │ │ │ │ │ │ │ │ │ │ def compare(self, a, b): │ │ │ │ │ return a > b │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class MinValueValidator(BaseValidator): │ │ │ │ │ message = _("Ensure this value is greater than or equal to % │ │ │ │ │ (limit_value)s.") │ │ │ │ │ code = "min_value" │ │ │ │ │ │ │ │ │ │ def compare(self, a, b): │ │ │ │ │ return a < b │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class StepValueValidator(BaseValidator): │ │ │ │ │ message = _("Ensure this value is a multiple of step size % │ │ │ │ │ (limit_value)s.") │ │ │ │ │ code = "step_size" │ │ │ │ │ │ │ │ │ │ def compare(self, a, b): │ │ │ │ │ return not math.isclose(math.remainder(a, b), 0, abs_tol=1e-9) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class MinLengthValidator(BaseValidator): │ │ │ │ │ message = ngettext_lazy( │ │ │ │ │ "Ensure this value has at least %(limit_value)d character (it has " │ │ │ │ │ "%(show_value)d).", │ │ │ │ │ "Ensure this value has at least %(limit_value)d characters (it has " │ │ │ │ │ "%(show_value)d).", │ │ │ │ │ @@ -504,15 +504,15 @@ │ │ │ │ │ def clean(self, x): │ │ │ │ │ return len(x) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class MaxLengthValidator(BaseValidator): │ │ │ │ │ message = ngettext_lazy( │ │ │ │ │ "Ensure this value has at most %(limit_value)d character (it has " │ │ │ │ │ "%(show_value)d).", │ │ │ │ │ "Ensure this value has at most %(limit_value)d characters (it has " │ │ │ │ │ "%(show_value)d).", │ │ │ │ │ @@ -526,15 +526,15 @@ │ │ │ │ │ def clean(self, x): │ │ │ │ │ return len(x) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class DecimalValidator: │ │ │ │ │ """ │ │ │ │ │ Validate that the input does not exceed the maximum number of digits │ │ │ │ │ expected, otherwise raise ValidationError. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ @@ -622,15 +622,15 @@ │ │ │ │ │ and self.decimal_places == other.decimal_places │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class FileExtensionValidator: │ │ │ │ │ message = _( │ │ │ │ │ "File extension “%(extension)s” is not allowed. " │ │ │ │ │ "Allowed extensions are: %(allowed_extensions)s." │ │ │ │ │ ) │ │ │ │ │ code = "invalid_extension" │ │ │ │ │ @@ -681,26 +681,26 @@ │ │ │ │ │ return [] │ │ │ │ │ else: │ │ │ │ │ Image.init() │ │ │ │ │ return [ext.lower()[1:] for ext in Image.EXTENSION] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate_image_file_extension(value): │ │ │ │ │ return FileExtensionValidator │ │ │ │ │ (allowed_extensions=get_available_image_extensions())( │ │ │ │ │ value │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class ProhibitNullCharactersValidator: │ │ │ │ │ """Validate that the string doesn't contain the null character.""" │ │ │ │ │ │ │ │ │ │ message = _("Null characters are not allowed.") │ │ │ │ │ code = "null_characters_not_allowed" │ │ │ │ │ │ │ │ │ │ @@ -718,12 +718,12 @@ │ │ │ │ │ def __eq__(self, other): │ │ │ │ │ return ( │ │ │ │ │ isinstance(other, self.__class__) │ │ │ │ │ and self.message == other.message │ │ │ │ │ and self.code == other.code │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/backends/base/schema.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.backends.base.schema — Django 4.2.13 documentation │ │ │ │ + django.db.backends.base.schema — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.backends.base.schema

│ │ │ │ +  

Codice sorgente per django.db.backends.base.schema

│ │ │ │  import logging
│ │ │ │  import operator
│ │ │ │  from datetime import datetime
│ │ │ │  
│ │ │ │  from django.conf import settings
│ │ │ │  from django.db.backends.ddl_references import (
│ │ │ │      Columns,
│ │ │ │ @@ -142,15 +143,15 @@
│ │ │ │          yield from _related_non_m2m_objects(
│ │ │ │              old_rel.remote_field,
│ │ │ │              new_rel.remote_field,
│ │ │ │          )
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BaseDatabaseSchemaEditor: │ │ │ │ """ │ │ │ │ This class and its subclasses are responsible for emitting schema-changing │ │ │ │ statements to the databases - model creation/removal/alteration, field │ │ │ │ renaming, index fiddling, and so on. │ │ │ │ """ │ │ │ │ │ │ │ │ @@ -241,15 +242,15 @@ │ │ │ │ self.execute(sql) │ │ │ │ if self.atomic_migration: │ │ │ │ self.atomic.__exit__(exc_type, exc_value, traceback) │ │ │ │ │ │ │ │ # Core utility functions │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def execute(self, sql, params=()): │ │ │ │ """Execute the given SQL statement, with optional parameters.""" │ │ │ │ # Don't perform the transactional DDL check if SQL is being collected │ │ │ │ # as it's not going to be executed anyway. │ │ │ │ if ( │ │ │ │ not self.collect_sql │ │ │ │ and self.connection.in_atomic_block │ │ │ │ @@ -515,15 +516,15 @@ │ │ │ │ so this is safe). │ │ │ │ """ │ │ │ │ raise NotImplementedError() │ │ │ │ │ │ │ │ # Actions │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def create_model(self, model): │ │ │ │ """ │ │ │ │ Create a table and any accompanying indexes or unique constraints for │ │ │ │ the given `model`. │ │ │ │ """ │ │ │ │ sql, params = self.table_sql(model) │ │ │ │ # Prevent using [] as params, in the case a literal '%' is used in the │ │ │ │ @@ -554,15 +555,15 @@ │ │ │ │ # Make M2M tables │ │ │ │ for field in model._meta.local_many_to_many: │ │ │ │ if field.remote_field.through._meta.auto_created: │ │ │ │ self.create_model(field.remote_field.through)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def delete_model(self, model): │ │ │ │ """Delete a model from the database.""" │ │ │ │ # Handle auto-created intermediary models │ │ │ │ for field in model._meta.local_many_to_many: │ │ │ │ if field.remote_field.through._meta.auto_created: │ │ │ │ self.delete_model(field.remote_field.through) │ │ │ │ │ │ │ │ @@ -578,74 +579,74 @@ │ │ │ │ if isinstance(sql, Statement) and sql.references_table( │ │ │ │ model._meta.db_table │ │ │ │ ): │ │ │ │ self.deferred_sql.remove(sql)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def add_index(self, model, index): │ │ │ │ """Add an index on a model.""" │ │ │ │ if ( │ │ │ │ index.contains_expressions │ │ │ │ and not self.connection.features.supports_expression_indexes │ │ │ │ ): │ │ │ │ return None │ │ │ │ # Index.create_sql returns interpolated SQL which makes params=None a │ │ │ │ # necessity to avoid escaping attempts on execution. │ │ │ │ self.execute(index.create_sql(model, self), params=None)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def remove_index(self, model, index): │ │ │ │ """Remove an index from a model.""" │ │ │ │ if ( │ │ │ │ index.contains_expressions │ │ │ │ and not self.connection.features.supports_expression_indexes │ │ │ │ ): │ │ │ │ return None │ │ │ │ self.execute(index.remove_sql(model, self))
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def rename_index(self, model, old_index, new_index): │ │ │ │ if self.connection.features.can_rename_index: │ │ │ │ self.execute( │ │ │ │ self._rename_index_sql(model, old_index.name, new_index.name), │ │ │ │ params=None, │ │ │ │ ) │ │ │ │ else: │ │ │ │ self.remove_index(model, old_index) │ │ │ │ self.add_index(model, new_index)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def add_constraint(self, model, constraint): │ │ │ │ """Add a constraint to a model.""" │ │ │ │ sql = constraint.create_sql(model, self) │ │ │ │ if sql: │ │ │ │ # Constraint.create_sql returns interpolated SQL which makes │ │ │ │ # params=None a necessity to avoid escaping attempts on execution. │ │ │ │ self.execute(sql, params=None)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def remove_constraint(self, model, constraint): │ │ │ │ """Remove a constraint from a model.""" │ │ │ │ sql = constraint.remove_sql(model, self) │ │ │ │ if sql: │ │ │ │ self.execute(sql)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def alter_unique_together(self, model, old_unique_together, new_unique_together): │ │ │ │ """ │ │ │ │ Deal with a model changing its unique_together. The input │ │ │ │ unique_togethers must be doubly-nested, not the single-nested │ │ │ │ ["foo", "bar"] format. │ │ │ │ """ │ │ │ │ olds = {tuple(fields) for fields in old_unique_together} │ │ │ │ @@ -661,15 +662,15 @@ │ │ │ │ # Created uniques │ │ │ │ for field_names in news.difference(olds): │ │ │ │ fields = [model._meta.get_field(field) for field in field_names] │ │ │ │ self.execute(self._create_unique_sql(model, fields))
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def alter_index_together(self, model, old_index_together, new_index_together): │ │ │ │ """ │ │ │ │ Deal with a model changing its index_together. The input │ │ │ │ index_togethers must be doubly-nested, not the single-nested │ │ │ │ ["foo", "bar"] format. │ │ │ │ """ │ │ │ │ olds = {tuple(fields) for fields in old_index_together} │ │ │ │ @@ -719,15 +720,15 @@ │ │ │ │ model._meta.db_table, │ │ │ │ ", ".join(columns), │ │ │ │ ) │ │ │ │ ) │ │ │ │ self.execute(self._delete_constraint_sql(sql, model, constraint_names[0])) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def alter_db_table(self, model, old_db_table, new_db_table): │ │ │ │ """Rename the table a model points to.""" │ │ │ │ if old_db_table == new_db_table or ( │ │ │ │ self.connection.features.ignores_table_name_case │ │ │ │ and old_db_table.lower() == new_db_table.lower() │ │ │ │ ): │ │ │ │ return │ │ │ │ @@ -741,42 +742,42 @@ │ │ │ │ # Rename all references to the old table name. │ │ │ │ for sql in self.deferred_sql: │ │ │ │ if isinstance(sql, Statement): │ │ │ │ sql.rename_table_references(old_db_table, new_db_table)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def alter_db_table_comment(self, model, old_db_table_comment, new_db_table_comment): │ │ │ │ if self.sql_alter_table_comment and self.connection.features.supports_comments: │ │ │ │ self.execute( │ │ │ │ self.sql_alter_table_comment │ │ │ │ % { │ │ │ │ "table": self.quote_name(model._meta.db_table), │ │ │ │ "comment": self.quote_value(new_db_table_comment or ""), │ │ │ │ } │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def alter_db_tablespace(self, model, old_db_tablespace, new_db_tablespace): │ │ │ │ """Move a model's table between tablespaces.""" │ │ │ │ self.execute( │ │ │ │ self.sql_retablespace_table │ │ │ │ % { │ │ │ │ "table": self.quote_name(model._meta.db_table), │ │ │ │ "old_tablespace": self.quote_name(old_db_tablespace), │ │ │ │ "new_tablespace": self.quote_name(new_db_tablespace), │ │ │ │ } │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def add_field(self, model, field): │ │ │ │ """ │ │ │ │ Create a field on a model. Usually involves adding a column, but may │ │ │ │ involve adding a table instead (for M2M fields). │ │ │ │ """ │ │ │ │ # Special-case implicit M2M tables │ │ │ │ if field.many_to_many and field.remote_field.through._meta.auto_created: │ │ │ │ @@ -857,15 +858,15 @@ │ │ │ │ self.deferred_sql.extend(self._field_indexes_sql(model, field)) │ │ │ │ # Reset connection if required │ │ │ │ if self.connection.features.connection_persists_old_columns: │ │ │ │ self.connection.close()
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def remove_field(self, model, field): │ │ │ │ """ │ │ │ │ Remove a field from a model. Usually involves deleting a column, │ │ │ │ but for M2Ms may involve deleting a table. │ │ │ │ """ │ │ │ │ # Special-case implicit M2M tables │ │ │ │ if field.many_to_many and field.remote_field.through._meta.auto_created: │ │ │ │ @@ -892,15 +893,15 @@ │ │ │ │ if isinstance(sql, Statement) and sql.references_column( │ │ │ │ model._meta.db_table, field.column │ │ │ │ ): │ │ │ │ self.deferred_sql.remove(sql)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def alter_field(self, model, old_field, new_field, strict=False): │ │ │ │ """ │ │ │ │ Allow a field's type, uniqueness, nullability, default, column, │ │ │ │ constraints, etc. to be modified. │ │ │ │ `old_field` is required to compute the necessary changes. │ │ │ │ If `strict` is True, raise errors if the old column does not match │ │ │ │ `old_field` precisely. │ │ │ │ @@ -1960,35 +1961,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..bbaacckkeennddss..bbaassee..sscchheemmaa ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..bbaacckkeennddss..bbaassee..sscchheemmaa ************ │ │ │ │ │ import logging │ │ │ │ │ import operator │ │ │ │ │ from datetime import datetime │ │ │ │ │ │ │ │ │ │ from django.conf import settings │ │ │ │ │ from django.db.backends.ddl_references import ( │ │ │ │ │ Columns, │ │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │ │ yield from _related_non_m2m_objects( │ │ │ │ │ old_rel.remote_field, │ │ │ │ │ new_rel.remote_field, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BaseDatabaseSchemaEditor: │ │ │ │ │ """ │ │ │ │ │ This class and its subclasses are responsible for emitting schema-changing │ │ │ │ │ statements to the databases - model creation/removal/alteration, field │ │ │ │ │ renaming, index fiddling, and so on. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ @@ -183,15 +183,15 @@ │ │ │ │ │ self.execute(sql) │ │ │ │ │ if self.atomic_migration: │ │ │ │ │ self.atomic.__exit__(exc_type, exc_value, traceback) │ │ │ │ │ │ │ │ │ │ # Core utility functions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def execute(self, sql, params=()): │ │ │ │ │ """Execute the given SQL statement, with optional parameters.""" │ │ │ │ │ # Don't perform the transactional DDL check if SQL is being collected │ │ │ │ │ # as it's not going to be executed anyway. │ │ │ │ │ if ( │ │ │ │ │ not self.collect_sql │ │ │ │ │ and self.connection.in_atomic_block │ │ │ │ │ @@ -465,15 +465,15 @@ │ │ │ │ │ so this is safe). │ │ │ │ │ """ │ │ │ │ │ raise NotImplementedError() │ │ │ │ │ │ │ │ │ │ # Actions │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def create_model(self, model): │ │ │ │ │ """ │ │ │ │ │ Create a table and any accompanying indexes or unique constraints for │ │ │ │ │ the given `model`. │ │ │ │ │ """ │ │ │ │ │ sql, params = self.table_sql(model) │ │ │ │ │ # Prevent using [] as params, in the case a literal '%' is used in the │ │ │ │ │ @@ -506,15 +506,15 @@ │ │ │ │ │ for field in model._meta.local_many_to_many: │ │ │ │ │ if field.remote_field.through._meta.auto_created: │ │ │ │ │ self.create_model(field.remote_field.through) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def delete_model(self, model): │ │ │ │ │ """Delete a model from the database.""" │ │ │ │ │ # Handle auto-created intermediary models │ │ │ │ │ for field in model._meta.local_many_to_many: │ │ │ │ │ if field.remote_field.through._meta.auto_created: │ │ │ │ │ self.delete_model(field.remote_field.through) │ │ │ │ │ │ │ │ │ │ @@ -531,79 +531,79 @@ │ │ │ │ │ model._meta.db_table │ │ │ │ │ ): │ │ │ │ │ self.deferred_sql.remove(sql) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def add_index(self, model, index): │ │ │ │ │ """Add an index on a model.""" │ │ │ │ │ if ( │ │ │ │ │ index.contains_expressions │ │ │ │ │ and not self.connection.features.supports_expression_indexes │ │ │ │ │ ): │ │ │ │ │ return None │ │ │ │ │ # Index.create_sql returns interpolated SQL which makes params=None a │ │ │ │ │ # necessity to avoid escaping attempts on execution. │ │ │ │ │ self.execute(index.create_sql(model, self), params=None) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def remove_index(self, model, index): │ │ │ │ │ """Remove an index from a model.""" │ │ │ │ │ if ( │ │ │ │ │ index.contains_expressions │ │ │ │ │ and not self.connection.features.supports_expression_indexes │ │ │ │ │ ): │ │ │ │ │ return None │ │ │ │ │ self.execute(index.remove_sql(model, self)) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def rename_index(self, model, old_index, new_index): │ │ │ │ │ if self.connection.features.can_rename_index: │ │ │ │ │ self.execute( │ │ │ │ │ self._rename_index_sql(model, old_index.name, new_index.name), │ │ │ │ │ params=None, │ │ │ │ │ ) │ │ │ │ │ else: │ │ │ │ │ self.remove_index(model, old_index) │ │ │ │ │ self.add_index(model, new_index) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def add_constraint(self, model, constraint): │ │ │ │ │ """Add a constraint to a model.""" │ │ │ │ │ sql = constraint.create_sql(model, self) │ │ │ │ │ if sql: │ │ │ │ │ # Constraint.create_sql returns interpolated SQL which makes │ │ │ │ │ # params=None a necessity to avoid escaping attempts on execution. │ │ │ │ │ self.execute(sql, params=None) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def remove_constraint(self, model, constraint): │ │ │ │ │ """Remove a constraint from a model.""" │ │ │ │ │ sql = constraint.remove_sql(model, self) │ │ │ │ │ if sql: │ │ │ │ │ self.execute(sql) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def alter_unique_together(self, model, old_unique_together, │ │ │ │ │ new_unique_together): │ │ │ │ │ """ │ │ │ │ │ Deal with a model changing its unique_together. The input │ │ │ │ │ unique_togethers must be doubly-nested, not the single-nested │ │ │ │ │ ["foo", "bar"] format. │ │ │ │ │ """ │ │ │ │ │ @@ -621,15 +621,15 @@ │ │ │ │ │ for field_names in news.difference(olds): │ │ │ │ │ fields = [model._meta.get_field(field) for field in field_names] │ │ │ │ │ self.execute(self._create_unique_sql(model, fields)) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def alter_index_together(self, model, old_index_together, │ │ │ │ │ new_index_together): │ │ │ │ │ """ │ │ │ │ │ Deal with a model changing its index_together. The input │ │ │ │ │ index_togethers must be doubly-nested, not the single-nested │ │ │ │ │ ["foo", "bar"] format. │ │ │ │ │ """ │ │ │ │ │ @@ -686,15 +686,15 @@ │ │ │ │ │ ", ".join(columns), │ │ │ │ │ ) │ │ │ │ │ ) │ │ │ │ │ self.execute(self._delete_constraint_sql(sql, model, constraint_names │ │ │ │ │ [0])) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def alter_db_table(self, model, old_db_table, new_db_table): │ │ │ │ │ """Rename the table a model points to.""" │ │ │ │ │ if old_db_table == new_db_table or ( │ │ │ │ │ self.connection.features.ignores_table_name_case │ │ │ │ │ and old_db_table.lower() == new_db_table.lower() │ │ │ │ │ ): │ │ │ │ │ return │ │ │ │ │ @@ -709,15 +709,15 @@ │ │ │ │ │ for sql in self.deferred_sql: │ │ │ │ │ if isinstance(sql, Statement): │ │ │ │ │ sql.rename_table_references(old_db_table, new_db_table) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def alter_db_table_comment(self, model, old_db_table_comment, │ │ │ │ │ new_db_table_comment): │ │ │ │ │ if self.sql_alter_table_comment and │ │ │ │ │ self.connection.features.supports_comments: │ │ │ │ │ self.execute( │ │ │ │ │ self.sql_alter_table_comment │ │ │ │ │ % { │ │ │ │ │ @@ -725,30 +725,30 @@ │ │ │ │ │ "comment": self.quote_value(new_db_table_comment or ""), │ │ │ │ │ } │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def alter_db_tablespace(self, model, old_db_tablespace, new_db_tablespace): │ │ │ │ │ """Move a model's table between tablespaces.""" │ │ │ │ │ self.execute( │ │ │ │ │ self.sql_retablespace_table │ │ │ │ │ % { │ │ │ │ │ "table": self.quote_name(model._meta.db_table), │ │ │ │ │ "old_tablespace": self.quote_name(old_db_tablespace), │ │ │ │ │ "new_tablespace": self.quote_name(new_db_tablespace), │ │ │ │ │ } │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def add_field(self, model, field): │ │ │ │ │ """ │ │ │ │ │ Create a field on a model. Usually involves adding a column, but may │ │ │ │ │ involve adding a table instead (for M2M fields). │ │ │ │ │ """ │ │ │ │ │ # Special-case implicit M2M tables │ │ │ │ │ if field.many_to_many and │ │ │ │ │ @@ -833,15 +833,15 @@ │ │ │ │ │ # Reset connection if required │ │ │ │ │ if self.connection.features.connection_persists_old_columns: │ │ │ │ │ self.connection.close() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def remove_field(self, model, field): │ │ │ │ │ """ │ │ │ │ │ Remove a field from a model. Usually involves deleting a column, │ │ │ │ │ but for M2Ms may involve deleting a table. │ │ │ │ │ """ │ │ │ │ │ # Special-case implicit M2M tables │ │ │ │ │ if field.many_to_many and │ │ │ │ │ @@ -871,15 +871,15 @@ │ │ │ │ │ model._meta.db_table, field.column │ │ │ │ │ ): │ │ │ │ │ self.deferred_sql.remove(sql) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def alter_field(self, model, old_field, new_field, strict=False): │ │ │ │ │ """ │ │ │ │ │ Allow a field's type, uniqueness, nullability, default, column, │ │ │ │ │ constraints, etc. to be modified. │ │ │ │ │ `old_field` is required to compute the necessary changes. │ │ │ │ │ If `strict` is True, raise errors if the old column does not match │ │ │ │ │ `old_field` precisely. │ │ │ │ │ @@ -1981,12 +1981,12 @@ │ │ │ │ │ def remove_procedure(self, procedure_name, param_types=()): │ │ │ │ │ sql = self.sql_delete_procedure % { │ │ │ │ │ "procedure": self.quote_name(procedure_name), │ │ │ │ │ "param_types": ",".join(param_types), │ │ │ │ │ } │ │ │ │ │ self.execute(sql) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/fields.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.migrations.operations.fields — Django 4.2.13 documentation │ │ │ │ + django.db.migrations.operations.fields — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.migrations.operations.fields

│ │ │ │ +  

Codice sorgente per django.db.migrations.operations.fields

│ │ │ │  from django.db.migrations.utils import field_references
│ │ │ │  from django.db.models import NOT_PROVIDED
│ │ │ │  from django.utils.functional import cached_property
│ │ │ │  
│ │ │ │  from .base import Operation
│ │ │ │  
│ │ │ │  
│ │ │ │ @@ -142,15 +143,15 @@
│ │ │ │      def reduce(self, operation, app_label):
│ │ │ │          return super().reduce(operation, app_label) or not operation.references_field(
│ │ │ │              self.model_name, self.name, app_label
│ │ │ │          )
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AddField(FieldOperation): │ │ │ │ """Add a field to a model.""" │ │ │ │ │ │ │ │ def __init__(self, model_name, name, field, preserve_default=True): │ │ │ │ self.preserve_default = preserve_default │ │ │ │ super().__init__(model_name, name, field) │ │ │ │ │ │ │ │ @@ -224,15 +225,15 @@ │ │ │ │ ), │ │ │ │ ] │ │ │ │ return super().reduce(operation, app_label)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RemoveField(FieldOperation): │ │ │ │ """Remove a field from a model.""" │ │ │ │ │ │ │ │ def deconstruct(self): │ │ │ │ kwargs = { │ │ │ │ "model_name": self.model_name, │ │ │ │ "name": self.name, │ │ │ │ @@ -271,15 +272,15 @@ │ │ │ │ ): │ │ │ │ return [operation] │ │ │ │ return super().reduce(operation, app_label)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AlterField(FieldOperation): │ │ │ │ """ │ │ │ │ Alter a field's database column (e.g. null, max_length) to the provided │ │ │ │ new field. │ │ │ │ """ │ │ │ │ │ │ │ │ def __init__(self, model_name, name, field, preserve_default=True): │ │ │ │ @@ -346,15 +347,15 @@ │ │ │ │ ), │ │ │ │ ] │ │ │ │ return super().reduce(operation, app_label)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RenameField(FieldOperation): │ │ │ │ """Rename a field on the model. Might affect db_column too.""" │ │ │ │ │ │ │ │ def __init__(self, model_name, old_name, new_name): │ │ │ │ self.old_name = old_name │ │ │ │ self.new_name = new_name │ │ │ │ super().__init__(model_name, old_name) │ │ │ │ @@ -448,35 +449,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmiiggrraattiioonnss..ooppeerraattiioonnss..ffiieellddss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmiiggrraattiioonnss..ooppeerraattiioonnss..ffiieellddss ************ │ │ │ │ │ from django.db.migrations.utils import field_references │ │ │ │ │ from django.db.models import NOT_PROVIDED │ │ │ │ │ from django.utils.functional import cached_property │ │ │ │ │ │ │ │ │ │ from .base import Operation │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │ │ return super().reduce(operation, app_label) or not │ │ │ │ │ operation.references_field( │ │ │ │ │ self.model_name, self.name, app_label │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AddField(FieldOperation): │ │ │ │ │ """Add a field to a model.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, model_name, name, field, preserve_default=True): │ │ │ │ │ self.preserve_default = preserve_default │ │ │ │ │ super().__init__(model_name, name, field) │ │ │ │ │ │ │ │ │ │ @@ -161,15 +161,15 @@ │ │ │ │ │ ] │ │ │ │ │ return super().reduce(operation, app_label) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RemoveField(FieldOperation): │ │ │ │ │ """Remove a field from a model.""" │ │ │ │ │ │ │ │ │ │ def deconstruct(self): │ │ │ │ │ kwargs = { │ │ │ │ │ "model_name": self.model_name, │ │ │ │ │ "name": self.name, │ │ │ │ │ @@ -213,15 +213,15 @@ │ │ │ │ │ return [operation] │ │ │ │ │ return super().reduce(operation, app_label) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AlterField(FieldOperation): │ │ │ │ │ """ │ │ │ │ │ Alter a field's database column (e.g. null, max_length) to the provided │ │ │ │ │ new field. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ def __init__(self, model_name, name, field, preserve_default=True): │ │ │ │ │ @@ -291,15 +291,15 @@ │ │ │ │ │ ] │ │ │ │ │ return super().reduce(operation, app_label) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RenameField(FieldOperation): │ │ │ │ │ """Rename a field on the model. Might affect db_column too.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, model_name, old_name, new_name): │ │ │ │ │ self.old_name = old_name │ │ │ │ │ self.new_name = new_name │ │ │ │ │ super().__init__(model_name, old_name) │ │ │ │ │ @@ -387,12 +387,12 @@ │ │ │ │ │ ( │ │ │ │ │ operation.references_field(self.model_name, self.old_name, │ │ │ │ │ app_label) │ │ │ │ │ or operation.references_field(self.model_name, self.new_name, │ │ │ │ │ app_label) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/models.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.migrations.operations.models — Django 4.2.13 documentation │ │ │ │ + django.db.migrations.operations.models — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.migrations.operations.models

│ │ │ │ +  

Codice sorgente per django.db.migrations.operations.models

│ │ │ │  from django.db import models
│ │ │ │  from django.db.migrations.operations.base import Operation
│ │ │ │  from django.db.migrations.state import ModelState
│ │ │ │  from django.db.migrations.utils import field_references, resolve_relation
│ │ │ │  from django.db.models.options import normalize_together
│ │ │ │  from django.utils.functional import cached_property
│ │ │ │  
│ │ │ │ @@ -108,15 +109,15 @@
│ │ │ │          )
│ │ │ │  
│ │ │ │      def can_reduce_through(self, operation, app_label):
│ │ │ │          return not operation.references_model(self.name, app_label)
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class CreateModel(ModelOperation): │ │ │ │ """Create a model's table.""" │ │ │ │ │ │ │ │ serialization_expand_args = ["fields", "options", "managers"] │ │ │ │ │ │ │ │ def __init__(self, name, fields, options=None, bases=None, managers=None): │ │ │ │ self.fields = fields │ │ │ │ @@ -444,15 +445,15 @@ │ │ │ │ ), │ │ │ │ ] │ │ │ │ return super().reduce(operation, app_label)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class DeleteModel(ModelOperation): │ │ │ │ """Drop a model's table.""" │ │ │ │ │ │ │ │ def deconstruct(self): │ │ │ │ kwargs = { │ │ │ │ "name": self.name, │ │ │ │ } │ │ │ │ @@ -482,15 +483,15 @@ │ │ │ │ @property │ │ │ │ def migration_name_fragment(self): │ │ │ │ return "delete_%s" % self.name_lower
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RenameModel(ModelOperation): │ │ │ │ """Rename a model.""" │ │ │ │ │ │ │ │ def __init__(self, old_name, new_name): │ │ │ │ self.old_name = old_name │ │ │ │ self.new_name = new_name │ │ │ │ super().__init__(old_name) │ │ │ │ @@ -614,15 +615,15 @@ │ │ │ │ and self.name_lower == operation.name_lower │ │ │ │ ): │ │ │ │ return [operation] │ │ │ │ return super().reduce(operation, app_label) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AlterModelTable(ModelOptionOperation): │ │ │ │ """Rename a model's table.""" │ │ │ │ │ │ │ │ def __init__(self, name, table): │ │ │ │ self.table = table │ │ │ │ super().__init__(name) │ │ │ │ │ │ │ │ @@ -668,15 +669,15 @@ │ │ │ │ @property │ │ │ │ def migration_name_fragment(self): │ │ │ │ return "alter_%s_table" % self.name_lower
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AlterModelTableComment(ModelOptionOperation): │ │ │ │ def __init__(self, name, table_comment): │ │ │ │ self.table_comment = table_comment │ │ │ │ super().__init__(name) │ │ │ │ │ │ │ │ def deconstruct(self): │ │ │ │ kwargs = { │ │ │ │ @@ -774,45 +775,45 @@ │ │ │ │ return super().can_reduce_through(operation, app_label) or ( │ │ │ │ isinstance(operation, AlterTogetherOptionOperation) │ │ │ │ and type(operation) is not type(self) │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AlterUniqueTogether(AlterTogetherOptionOperation): │ │ │ │ """ │ │ │ │ Change the value of unique_together to the target one. │ │ │ │ Input value of unique_together must be a set of tuples. │ │ │ │ """ │ │ │ │ │ │ │ │ option_name = "unique_together" │ │ │ │ │ │ │ │ def __init__(self, name, unique_together): │ │ │ │ super().__init__(name, unique_together)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AlterIndexTogether(AlterTogetherOptionOperation): │ │ │ │ """ │ │ │ │ Change the value of index_together to the target one. │ │ │ │ Input value of index_together must be a set of tuples. │ │ │ │ """ │ │ │ │ │ │ │ │ option_name = "index_together" │ │ │ │ │ │ │ │ def __init__(self, name, index_together): │ │ │ │ super().__init__(name, index_together)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AlterOrderWithRespectTo(ModelOptionOperation): │ │ │ │ """Represent a change with the order_with_respect_to option.""" │ │ │ │ │ │ │ │ option_name = "order_with_respect_to" │ │ │ │ │ │ │ │ def __init__(self, name, order_with_respect_to): │ │ │ │ self.order_with_respect_to = order_with_respect_to │ │ │ │ @@ -875,15 +876,15 @@ │ │ │ │ @property │ │ │ │ def migration_name_fragment(self): │ │ │ │ return "alter_%s_order_with_respect_to" % self.name_lower
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AlterModelOptions(ModelOptionOperation): │ │ │ │ """ │ │ │ │ Set new model options that don't directly affect the database schema │ │ │ │ (like verbose_name, permissions, ordering). Python code in migrations │ │ │ │ may still need them. │ │ │ │ """ │ │ │ │ │ │ │ │ @@ -933,15 +934,15 @@ │ │ │ │ @property │ │ │ │ def migration_name_fragment(self): │ │ │ │ return "alter_%s_options" % self.name_lower
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AlterModelManagers(ModelOptionOperation): │ │ │ │ """Alter the model's managers.""" │ │ │ │ │ │ │ │ serialization_expand_args = ["managers"] │ │ │ │ │ │ │ │ def __init__(self, name, managers): │ │ │ │ self.managers = managers │ │ │ │ @@ -973,15 +974,15 @@ │ │ │ │ │ │ │ │ @cached_property │ │ │ │ def model_name_lower(self): │ │ │ │ return self.model_name.lower() │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AddIndex(IndexOperation): │ │ │ │ """Add an index on a model.""" │ │ │ │ │ │ │ │ def __init__(self, model_name, index): │ │ │ │ self.model_name = model_name │ │ │ │ if not index.name: │ │ │ │ raise ValueError( │ │ │ │ @@ -1030,15 +1031,15 @@ │ │ │ │ @property │ │ │ │ def migration_name_fragment(self): │ │ │ │ return "%s_%s" % (self.model_name_lower, self.index.name.lower())
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RemoveIndex(IndexOperation): │ │ │ │ """Remove an index from a model.""" │ │ │ │ │ │ │ │ def __init__(self, model_name, name): │ │ │ │ self.model_name = model_name │ │ │ │ self.name = name │ │ │ │ │ │ │ │ @@ -1076,15 +1077,15 @@ │ │ │ │ @property │ │ │ │ def migration_name_fragment(self): │ │ │ │ return "remove_%s_%s" % (self.model_name_lower, self.name.lower())
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RenameIndex(IndexOperation): │ │ │ │ """Rename an index.""" │ │ │ │ │ │ │ │ def __init__(self, model_name, new_name, old_name=None, old_fields=None): │ │ │ │ if not old_name and not old_fields: │ │ │ │ raise ValueError( │ │ │ │ "RenameIndex requires one of old_name and old_fields arguments to be " │ │ │ │ @@ -1228,15 +1229,15 @@ │ │ │ │ ) │ │ │ │ ] │ │ │ │ return super().reduce(operation, app_label)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class AddConstraint(IndexOperation): │ │ │ │ option_name = "constraints" │ │ │ │ │ │ │ │ def __init__(self, model_name, constraint): │ │ │ │ self.model_name = model_name │ │ │ │ self.constraint = constraint │ │ │ │ │ │ │ │ @@ -1272,15 +1273,15 @@ │ │ │ │ @property │ │ │ │ def migration_name_fragment(self): │ │ │ │ return "%s_%s" % (self.model_name_lower, self.constraint.name.lower())
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RemoveConstraint(IndexOperation): │ │ │ │ option_name = "constraints" │ │ │ │ │ │ │ │ def __init__(self, model_name, name): │ │ │ │ self.model_name = model_name │ │ │ │ self.name = name │ │ │ │ │ │ │ │ @@ -1326,35 +1327,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmiiggrraattiioonnss..ooppeerraattiioonnss..mmooddeellss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmiiggrraattiioonnss..ooppeerraattiioonnss..mmooddeellss ************ │ │ │ │ │ from django.db import models │ │ │ │ │ from django.db.migrations.operations.base import Operation │ │ │ │ │ from django.db.migrations.state import ModelState │ │ │ │ │ from django.db.migrations.utils import field_references, resolve_relation │ │ │ │ │ from django.db.models.options import normalize_together │ │ │ │ │ from django.utils.functional import cached_property │ │ │ │ │ │ │ │ │ │ @@ -41,15 +41,15 @@ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ def can_reduce_through(self, operation, app_label): │ │ │ │ │ return not operation.references_model(self.name, app_label) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class CreateModel(ModelOperation): │ │ │ │ │ """Create a model's table.""" │ │ │ │ │ │ │ │ │ │ serialization_expand_args = ["fields", "options", "managers"] │ │ │ │ │ │ │ │ │ │ def __init__(self, name, fields, options=None, bases=None, managers=None): │ │ │ │ │ self.fields = fields │ │ │ │ │ @@ -386,15 +386,15 @@ │ │ │ │ │ ] │ │ │ │ │ return super().reduce(operation, app_label) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class DeleteModel(ModelOperation): │ │ │ │ │ """Drop a model's table.""" │ │ │ │ │ │ │ │ │ │ def deconstruct(self): │ │ │ │ │ kwargs = { │ │ │ │ │ "name": self.name, │ │ │ │ │ } │ │ │ │ │ @@ -427,15 +427,15 @@ │ │ │ │ │ def migration_name_fragment(self): │ │ │ │ │ return "delete_%s" % self.name_lower │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RenameModel(ModelOperation): │ │ │ │ │ """Rename a model.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, old_name, new_name): │ │ │ │ │ self.old_name = old_name │ │ │ │ │ self.new_name = new_name │ │ │ │ │ super().__init__(old_name) │ │ │ │ │ @@ -565,15 +565,15 @@ │ │ │ │ │ and self.name_lower == operation.name_lower │ │ │ │ │ ): │ │ │ │ │ return [operation] │ │ │ │ │ return super().reduce(operation, app_label) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AlterModelTable(ModelOptionOperation): │ │ │ │ │ """Rename a model's table.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, name, table): │ │ │ │ │ self.table = table │ │ │ │ │ super().__init__(name) │ │ │ │ │ │ │ │ │ │ @@ -625,15 +625,15 @@ │ │ │ │ │ def migration_name_fragment(self): │ │ │ │ │ return "alter_%s_table" % self.name_lower │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AlterModelTableComment(ModelOptionOperation): │ │ │ │ │ def __init__(self, name, table_comment): │ │ │ │ │ self.table_comment = table_comment │ │ │ │ │ super().__init__(name) │ │ │ │ │ │ │ │ │ │ def deconstruct(self): │ │ │ │ │ kwargs = { │ │ │ │ │ @@ -740,15 +740,15 @@ │ │ │ │ │ return super().can_reduce_through(operation, app_label) or ( │ │ │ │ │ isinstance(operation, AlterTogetherOptionOperation) │ │ │ │ │ and type(operation) is not type(self) │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AlterUniqueTogether(AlterTogetherOptionOperation): │ │ │ │ │ """ │ │ │ │ │ Change the value of unique_together to the target one. │ │ │ │ │ Input value of unique_together must be a set of tuples. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ option_name = "unique_together" │ │ │ │ │ @@ -756,15 +756,15 @@ │ │ │ │ │ def __init__(self, name, unique_together): │ │ │ │ │ super().__init__(name, unique_together) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AlterIndexTogether(AlterTogetherOptionOperation): │ │ │ │ │ """ │ │ │ │ │ Change the value of index_together to the target one. │ │ │ │ │ Input value of index_together must be a set of tuples. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ option_name = "index_together" │ │ │ │ │ @@ -772,15 +772,15 @@ │ │ │ │ │ def __init__(self, name, index_together): │ │ │ │ │ super().__init__(name, index_together) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AlterOrderWithRespectTo(ModelOptionOperation): │ │ │ │ │ """Represent a change with the order_with_respect_to option.""" │ │ │ │ │ │ │ │ │ │ option_name = "order_with_respect_to" │ │ │ │ │ │ │ │ │ │ def __init__(self, name, order_with_respect_to): │ │ │ │ │ self.order_with_respect_to = order_with_respect_to │ │ │ │ │ @@ -847,15 +847,15 @@ │ │ │ │ │ def migration_name_fragment(self): │ │ │ │ │ return "alter_%s_order_with_respect_to" % self.name_lower │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AlterModelOptions(ModelOptionOperation): │ │ │ │ │ """ │ │ │ │ │ Set new model options that don't directly affect the database schema │ │ │ │ │ (like verbose_name, permissions, ordering). Python code in migrations │ │ │ │ │ may still need them. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ @@ -908,15 +908,15 @@ │ │ │ │ │ def migration_name_fragment(self): │ │ │ │ │ return "alter_%s_options" % self.name_lower │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AlterModelManagers(ModelOptionOperation): │ │ │ │ │ """Alter the model's managers.""" │ │ │ │ │ │ │ │ │ │ serialization_expand_args = ["managers"] │ │ │ │ │ │ │ │ │ │ def __init__(self, name, managers): │ │ │ │ │ self.managers = managers │ │ │ │ │ @@ -951,15 +951,15 @@ │ │ │ │ │ │ │ │ │ │ @cached_property │ │ │ │ │ def model_name_lower(self): │ │ │ │ │ return self.model_name.lower() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AddIndex(IndexOperation): │ │ │ │ │ """Add an index on a model.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, model_name, index): │ │ │ │ │ self.model_name = model_name │ │ │ │ │ if not index.name: │ │ │ │ │ raise ValueError( │ │ │ │ │ @@ -1012,15 +1012,15 @@ │ │ │ │ │ def migration_name_fragment(self): │ │ │ │ │ return "%s_%s" % (self.model_name_lower, self.index.name.lower()) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RemoveIndex(IndexOperation): │ │ │ │ │ """Remove an index from a model.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, model_name, name): │ │ │ │ │ self.model_name = model_name │ │ │ │ │ self.name = name │ │ │ │ │ │ │ │ │ │ @@ -1062,15 +1062,15 @@ │ │ │ │ │ def migration_name_fragment(self): │ │ │ │ │ return "remove_%s_%s" % (self.model_name_lower, self.name.lower()) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RenameIndex(IndexOperation): │ │ │ │ │ """Rename an index.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, model_name, new_name, old_name=None, old_fields=None): │ │ │ │ │ if not old_name and not old_fields: │ │ │ │ │ raise ValueError( │ │ │ │ │ "RenameIndex requires one of old_name and old_fields arguments │ │ │ │ │ @@ -1222,15 +1222,15 @@ │ │ │ │ │ ] │ │ │ │ │ return super().reduce(operation, app_label) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class AddConstraint(IndexOperation): │ │ │ │ │ option_name = "constraints" │ │ │ │ │ │ │ │ │ │ def __init__(self, model_name, constraint): │ │ │ │ │ self.model_name = model_name │ │ │ │ │ self.constraint = constraint │ │ │ │ │ │ │ │ │ │ @@ -1269,15 +1269,15 @@ │ │ │ │ │ def migration_name_fragment(self): │ │ │ │ │ return "%s_%s" % (self.model_name_lower, self.constraint.name.lower()) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RemoveConstraint(IndexOperation): │ │ │ │ │ option_name = "constraints" │ │ │ │ │ │ │ │ │ │ def __init__(self, model_name, name): │ │ │ │ │ self.model_name = model_name │ │ │ │ │ self.name = name │ │ │ │ │ │ │ │ │ │ @@ -1315,12 +1315,12 @@ │ │ │ │ │ return "Remove constraint %s from model %s" % (self.name, │ │ │ │ │ self.model_name) │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ def migration_name_fragment(self): │ │ │ │ │ return "remove_%s_%s" % (self.model_name_lower, self.name.lower()) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/migrations/operations/special.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.migrations.operations.special — Django 4.2.13 documentation │ │ │ │ + django.db.migrations.operations.special — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.migrations.operations.special

│ │ │ │ +  

Codice sorgente per django.db.migrations.operations.special

│ │ │ │  from django.db import router
│ │ │ │  
│ │ │ │  from .base import Operation
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ 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, or have operations │ │ │ │ that affect the state or not the database, or so on. │ │ │ │ """ │ │ │ │ @@ -133,15 +134,15 @@ │ │ │ │ │ │ │ │ def describe(self): │ │ │ │ return "Custom state/database change combination"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RunSQL(Operation): │ │ │ │ """ │ │ │ │ Run some raw SQL. A reverse SQL statement may be provided. │ │ │ │ │ │ │ │ Also accept a list of operations that represent the state change effected │ │ │ │ by this SQL change, in case it's custom column/table creation/deletion. │ │ │ │ """ │ │ │ │ @@ -209,15 +210,15 @@ │ │ │ │ statements = schema_editor.connection.ops.prepare_sql_script(sqls) │ │ │ │ for statement in statements: │ │ │ │ schema_editor.execute(statement, params=None)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class RunPython(Operation): │ │ │ │ """ │ │ │ │ Run Python code in a context suitable for doing versioned ORM operations. │ │ │ │ """ │ │ │ │ │ │ │ │ reduces_to_sql = False │ │ │ │ │ │ │ │ @@ -281,15 +282,15 @@ │ │ │ │ ): │ │ │ │ self.reverse_code(from_state.apps, schema_editor) │ │ │ │ │ │ │ │ def describe(self): │ │ │ │ return "Raw Python operation" │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @staticmethod │ │ │ │ def noop(apps, schema_editor): │ │ │ │ return None
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -299,35 +300,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,18 +1,18 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmiiggrraattiioonnss..ooppeerraattiioonnss..ssppeecciiaall ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmiiggrraattiioonnss..ooppeerraattiioonnss..ssppeecciiaall ************ │ │ │ │ │ from django.db import router │ │ │ │ │ │ │ │ │ │ from .base import Operation │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ 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, or have operations │ │ │ │ │ that affect the state or not the database, or so on. │ │ │ │ │ """ │ │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │ │ def describe(self): │ │ │ │ │ return "Custom state/database change combination" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RunSQL(Operation): │ │ │ │ │ """ │ │ │ │ │ Run some raw SQL. A reverse SQL statement may be provided. │ │ │ │ │ │ │ │ │ │ Also accept a list of operations that represent the state change effected │ │ │ │ │ by this SQL change, in case it's custom column/table creation/deletion. │ │ │ │ │ """ │ │ │ │ │ @@ -150,15 +150,15 @@ │ │ │ │ │ for statement in statements: │ │ │ │ │ schema_editor.execute(statement, params=None) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RunPython(Operation): │ │ │ │ │ """ │ │ │ │ │ Run Python code in a context suitable for doing versioned ORM operations. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ reduces_to_sql = False │ │ │ │ │ │ │ │ │ │ @@ -228,18 +228,18 @@ │ │ │ │ │ ): │ │ │ │ │ self.reverse_code(from_state.apps, schema_editor) │ │ │ │ │ │ │ │ │ │ def describe(self): │ │ │ │ │ return "Raw Python operation" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @staticmethod │ │ │ │ │ def noop(apps, schema_editor): │ │ │ │ │ return None │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/models/aggregates.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.models.aggregates — Django 4.2.13 documentation │ │ │ │ + django.db.models.aggregates — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.models.aggregates

│ │ │ │ +  

Codice sorgente per django.db.models.aggregates

│ │ │ │  """
│ │ │ │  Classes to represent the definitions of aggregate functions.
│ │ │ │  """
│ │ │ │  from django.core.exceptions import FieldError, FullResultSet
│ │ │ │  from django.db.models.expressions import Case, Func, Star, Value, When
│ │ │ │  from django.db.models.fields import IntegerField
│ │ │ │  from django.db.models.functions.comparison import Coalesce
│ │ │ │ @@ -92,15 +93,15 @@
│ │ │ │      "StdDev",
│ │ │ │      "Sum",
│ │ │ │      "Variance",
│ │ │ │  ]
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Aggregate(Func): │ │ │ │ template = "%(function)s(%(distinct)s%(expressions)s)" │ │ │ │ contains_aggregate = True │ │ │ │ name = None │ │ │ │ filter_template = "%s FILTER (WHERE %%(filter)s)" │ │ │ │ window_compatible = True │ │ │ │ allow_distinct = False │ │ │ │ @@ -224,24 +225,24 @@ │ │ │ │ if self.filter: │ │ │ │ options["filter"] = self.filter │ │ │ │ return options
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Avg(FixDurationInputMixin, NumericOutputFieldMixin, Aggregate): │ │ │ │ function = "AVG" │ │ │ │ name = "Avg" │ │ │ │ allow_distinct = True
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Count(Aggregate): │ │ │ │ function = "COUNT" │ │ │ │ name = "Count" │ │ │ │ output_field = IntegerField() │ │ │ │ allow_distinct = True │ │ │ │ empty_result_set_value = 0 │ │ │ │ │ │ │ │ @@ -251,54 +252,54 @@ │ │ │ │ if isinstance(expression, Star) and filter is not None: │ │ │ │ raise ValueError("Star cannot be used with filter. Please specify a field.") │ │ │ │ super().__init__(expression, filter=filter, **extra)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Max(Aggregate): │ │ │ │ function = "MAX" │ │ │ │ name = "Max"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Min(Aggregate): │ │ │ │ function = "MIN" │ │ │ │ name = "Min"
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class StdDev(NumericOutputFieldMixin, Aggregate): │ │ │ │ name = "StdDev" │ │ │ │ │ │ │ │ def __init__(self, expression, sample=False, **extra): │ │ │ │ self.function = "STDDEV_SAMP" if sample else "STDDEV_POP" │ │ │ │ super().__init__(expression, **extra) │ │ │ │ │ │ │ │ def _get_repr_options(self): │ │ │ │ return {**super()._get_repr_options(), "sample": self.function == "STDDEV_SAMP"}
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Sum(FixDurationInputMixin, Aggregate): │ │ │ │ function = "SUM" │ │ │ │ name = "Sum" │ │ │ │ allow_distinct = True
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Variance(NumericOutputFieldMixin, Aggregate): │ │ │ │ name = "Variance" │ │ │ │ │ │ │ │ def __init__(self, expression, sample=False, **extra): │ │ │ │ self.function = "VAR_SAMP" if sample else "VAR_POP" │ │ │ │ super().__init__(expression, **extra) │ │ │ │ │ │ │ │ @@ -313,35 +314,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmooddeellss..aaggggrreeggaatteess ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmooddeellss..aaggggrreeggaatteess ************ │ │ │ │ │ """ │ │ │ │ │ Classes to represent the definitions of aggregate functions. │ │ │ │ │ """ │ │ │ │ │ from django.core.exceptions import FieldError, FullResultSet │ │ │ │ │ from django.db.models.expressions import Case, Func, Star, Value, When │ │ │ │ │ from django.db.models.fields import IntegerField │ │ │ │ │ from django.db.models.functions.comparison import Coalesce │ │ │ │ │ @@ -23,15 +23,15 @@ │ │ │ │ │ "StdDev", │ │ │ │ │ "Sum", │ │ │ │ │ "Variance", │ │ │ │ │ ] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Aggregate(Func): │ │ │ │ │ template = "%(function)s(%(distinct)s%(expressions)s)" │ │ │ │ │ contains_aggregate = True │ │ │ │ │ name = None │ │ │ │ │ filter_template = "%s FILTER (WHERE %%(filter)s)" │ │ │ │ │ window_compatible = True │ │ │ │ │ allow_distinct = False │ │ │ │ │ @@ -164,25 +164,25 @@ │ │ │ │ │ options["filter"] = self.filter │ │ │ │ │ return options │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Avg(FixDurationInputMixin, NumericOutputFieldMixin, Aggregate): │ │ │ │ │ function = "AVG" │ │ │ │ │ name = "Avg" │ │ │ │ │ allow_distinct = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Count(Aggregate): │ │ │ │ │ function = "COUNT" │ │ │ │ │ name = "Count" │ │ │ │ │ output_field = IntegerField() │ │ │ │ │ allow_distinct = True │ │ │ │ │ empty_result_set_value = 0 │ │ │ │ │ │ │ │ │ │ @@ -194,33 +194,33 @@ │ │ │ │ │ field.") │ │ │ │ │ super().__init__(expression, filter=filter, **extra) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Max(Aggregate): │ │ │ │ │ function = "MAX" │ │ │ │ │ name = "Max" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Min(Aggregate): │ │ │ │ │ function = "MIN" │ │ │ │ │ name = "Min" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class StdDev(NumericOutputFieldMixin, Aggregate): │ │ │ │ │ name = "StdDev" │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, sample=False, **extra): │ │ │ │ │ self.function = "STDDEV_SAMP" if sample else "STDDEV_POP" │ │ │ │ │ super().__init__(expression, **extra) │ │ │ │ │ │ │ │ │ │ @@ -228,34 +228,34 @@ │ │ │ │ │ return {**super()._get_repr_options(), "sample": self.function == │ │ │ │ │ "STDDEV_SAMP"} │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Sum(FixDurationInputMixin, Aggregate): │ │ │ │ │ function = "SUM" │ │ │ │ │ name = "Sum" │ │ │ │ │ allow_distinct = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Variance(NumericOutputFieldMixin, Aggregate): │ │ │ │ │ name = "Variance" │ │ │ │ │ │ │ │ │ │ def __init__(self, expression, sample=False, **extra): │ │ │ │ │ self.function = "VAR_SAMP" if sample else "VAR_POP" │ │ │ │ │ super().__init__(expression, **extra) │ │ │ │ │ │ │ │ │ │ def _get_repr_options(self): │ │ │ │ │ return {**super()._get_repr_options(), "sample": self.function == │ │ │ │ │ "VAR_SAMP"} │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/models/base.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.models.base — Django 4.2.13 documentation │ │ │ │ + django.db.models.base — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.models.base

│ │ │ │ +  

Codice sorgente per django.db.models.base

│ │ │ │  import copy
│ │ │ │  import inspect
│ │ │ │  import warnings
│ │ │ │  from functools import partialmethod
│ │ │ │  from itertools import chain
│ │ │ │  
│ │ │ │  from asgiref.sync import sync_to_async
│ │ │ │ @@ -526,15 +527,15 @@
│ │ │ │      # explicit (non-auto) PKs. This impacts validation only; it has no effect
│ │ │ │      # on the actual save.
│ │ │ │      adding = True
│ │ │ │      fields_cache = ModelStateFieldsCacheDescriptor()
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class Model(AltersData, metaclass=ModelBase): │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ # Alias some things as locals to avoid repeat global lookups │ │ │ │ cls = self.__class__ │ │ │ │ opts = self._meta │ │ │ │ _setattr = setattr │ │ │ │ _DEFERRED = DEFERRED │ │ │ │ @@ -643,15 +644,15 @@ │ │ │ │ f"{cls.__name__}() got unexpected keyword arguments: " │ │ │ │ f"{unexpected_names}" │ │ │ │ ) │ │ │ │ super().__init__() │ │ │ │ post_init.send(sender=cls, instance=self) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ @classmethod │ │ │ │ def from_db(cls, db, field_names, values): │ │ │ │ if len(values) != len(cls._meta.concrete_fields): │ │ │ │ values_iter = iter(values) │ │ │ │ values = [ │ │ │ │ next(values_iter) if f.attname in field_names else DEFERRED │ │ │ │ for f in cls._meta.concrete_fields │ │ │ │ @@ -662,34 +663,34 @@ │ │ │ │ return new
│ │ │ │ │ │ │ │ │ │ │ │ def __repr__(self): │ │ │ │ return "<%s: %s>" % (self.__class__.__name__, self) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def __str__(self): │ │ │ │ return "%s object (%s)" % (self.__class__.__name__, self.pk)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def __eq__(self, other): │ │ │ │ if not isinstance(other, Model): │ │ │ │ return NotImplemented │ │ │ │ if self._meta.concrete_model != other._meta.concrete_model: │ │ │ │ return False │ │ │ │ my_pk = self.pk │ │ │ │ if my_pk is None: │ │ │ │ return self is other │ │ │ │ return my_pk == other.pk
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def __hash__(self): │ │ │ │ if self.pk is None: │ │ │ │ raise TypeError("Model instances without primary key value are unhashable") │ │ │ │ return hash(self.pk)
│ │ │ │ │ │ │ │ │ │ │ │ def __reduce__(self): │ │ │ │ @@ -746,28 +747,28 @@ │ │ │ │ if parent_link and parent_link != self._meta.pk: │ │ │ │ setattr(self, parent_link.target_field.attname, value) │ │ │ │ return setattr(self, self._meta.pk.attname, value) │ │ │ │ │ │ │ │ pk = property(_get_pk_val, _set_pk_val) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def get_deferred_fields(self): │ │ │ │ """ │ │ │ │ Return a set containing names of deferred fields for this instance. │ │ │ │ """ │ │ │ │ return { │ │ │ │ f.attname │ │ │ │ for f in self._meta.concrete_fields │ │ │ │ if f.attname not in self.__dict__ │ │ │ │ }
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def refresh_from_db(self, using=None, fields=None): │ │ │ │ """ │ │ │ │ Reload field values from the database. │ │ │ │ │ │ │ │ By default, the reloading happens from the database this instance was │ │ │ │ loaded from, or by the read router if this instance wasn't loaded from │ │ │ │ any database. The using parameter will override the default. │ │ │ │ @@ -834,15 +835,15 @@ │ │ │ │ if field.is_relation and field.is_cached(self): │ │ │ │ field.delete_cached_value(self) │ │ │ │ │ │ │ │ self._state.db = db_instance._state.db
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ async def arefresh_from_db(self, using=None, fields=None): │ │ │ │ return await sync_to_async(self.refresh_from_db)(using=using, fields=fields)
│ │ │ │ │ │ │ │ │ │ │ │ def serializable_value(self, field_name): │ │ │ │ """ │ │ │ │ Return the value of the field name for this instance. If the field is │ │ │ │ @@ -857,15 +858,15 @@ │ │ │ │ try: │ │ │ │ field = self._meta.get_field(field_name) │ │ │ │ except FieldDoesNotExist: │ │ │ │ return getattr(self, field_name) │ │ │ │ return getattr(self, field.attname) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def save( │ │ │ │ self, force_insert=False, force_update=False, using=None, update_fields=None │ │ │ │ ): │ │ │ │ """ │ │ │ │ Save the current instance. Override this in a subclass if you want to │ │ │ │ control the saving process. │ │ │ │ │ │ │ │ @@ -916,15 +917,15 @@ │ │ │ │ update_fields=update_fields, │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ save.alters_data = True │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ async def asave( │ │ │ │ self, force_insert=False, force_update=False, using=None, update_fields=None │ │ │ │ ): │ │ │ │ return await sync_to_async(self.save)( │ │ │ │ force_insert=force_insert, │ │ │ │ force_update=force_update, │ │ │ │ using=using, │ │ │ │ @@ -1219,15 +1220,15 @@ │ │ │ │ if obj and obj.pk is None: │ │ │ │ raise ValueError( │ │ │ │ f"{operation_name}() prohibited to prevent data loss due to " │ │ │ │ f"unsaved related object '{field.name}'." │ │ │ │ ) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def delete(self, using=None, keep_parents=False): │ │ │ │ if self.pk is None: │ │ │ │ raise ValueError( │ │ │ │ "%s object can't be deleted because its %s attribute is set " │ │ │ │ "to None." % (self._meta.object_name, self._meta.pk.attname) │ │ │ │ ) │ │ │ │ using = using or router.db_for_write(self.__class__, instance=self) │ │ │ │ @@ -1235,15 +1236,15 @@ │ │ │ │ collector.collect([self], keep_parents=keep_parents) │ │ │ │ return collector.delete()
│ │ │ │ │ │ │ │ │ │ │ │ delete.alters_data = True │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ async def adelete(self, using=None, keep_parents=False): │ │ │ │ return await sync_to_async(self.delete)( │ │ │ │ using=using, │ │ │ │ keep_parents=keep_parents, │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ @@ -1315,27 +1316,27 @@ │ │ │ │ if self.pk is None: │ │ │ │ raise ValueError( │ │ │ │ "Unsaved model instance %r cannot be used in an ORM query." % self │ │ │ │ ) │ │ │ │ return getattr(self, field.remote_field.get_related_field().attname) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def clean(self): │ │ │ │ """ │ │ │ │ Hook for doing any extra model-wide validation after clean() has been │ │ │ │ called on every field by self.clean_fields. Any ValidationError raised │ │ │ │ by this method will not be associated with a particular field; it will │ │ │ │ have a special-case association with the field defined by NON_FIELD_ERRORS. │ │ │ │ """ │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate_unique(self, exclude=None): │ │ │ │ """ │ │ │ │ Check unique constraints on the model and raise ValidationError if any │ │ │ │ failed. │ │ │ │ """ │ │ │ │ unique_checks, date_checks = self._get_unique_checks(exclude=exclude) │ │ │ │ │ │ │ │ @@ -1545,15 +1546,15 @@ │ │ │ │ constraints = [(self.__class__, self._meta.constraints)] │ │ │ │ for parent_class in self._meta.get_parent_list(): │ │ │ │ if parent_class._meta.constraints: │ │ │ │ constraints.append((parent_class, parent_class._meta.constraints)) │ │ │ │ return constraints │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate_constraints(self, exclude=None): │ │ │ │ constraints = self.get_constraints() │ │ │ │ using = router.db_for_write(self.__class__, instance=self) │ │ │ │ │ │ │ │ errors = {} │ │ │ │ for model_class, model_constraints in constraints: │ │ │ │ for constraint in model_constraints: │ │ │ │ @@ -1568,15 +1569,15 @@ │ │ │ │ else: │ │ │ │ errors = e.update_error_dict(errors) │ │ │ │ if errors: │ │ │ │ raise ValidationError(errors)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def full_clean(self, exclude=None, validate_unique=True, validate_constraints=True): │ │ │ │ """ │ │ │ │ Call clean_fields(), clean(), validate_unique(), and │ │ │ │ validate_constraints() on the model. Raise a ValidationError for any │ │ │ │ errors that occur. │ │ │ │ """ │ │ │ │ errors = {} │ │ │ │ @@ -1618,15 +1619,15 @@ │ │ │ │ errors = e.update_error_dict(errors) │ │ │ │ │ │ │ │ if errors: │ │ │ │ raise ValidationError(errors)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def clean_fields(self, exclude=None): │ │ │ │ """ │ │ │ │ Clean all fields and raise a ValidationError containing a dict │ │ │ │ of all validation errors if any occur. │ │ │ │ """ │ │ │ │ if exclude is None: │ │ │ │ exclude = set() │ │ │ │ @@ -2661,35 +2662,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmooddeellss..bbaassee ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmooddeellss..bbaassee ************ │ │ │ │ │ import copy │ │ │ │ │ import inspect │ │ │ │ │ import warnings │ │ │ │ │ from functools import partialmethod │ │ │ │ │ from itertools import chain │ │ │ │ │ │ │ │ │ │ from asgiref.sync import sync_to_async │ │ │ │ │ @@ -467,15 +467,15 @@ │ │ │ │ │ # explicit (non-auto) PKs. This impacts validation only; it has no effect │ │ │ │ │ # on the actual save. │ │ │ │ │ adding = True │ │ │ │ │ fields_cache = ModelStateFieldsCacheDescriptor() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Model(AltersData, metaclass=ModelBase): │ │ │ │ │ def __init__(self, *args, **kwargs): │ │ │ │ │ # Alias some things as locals to avoid repeat global lookups │ │ │ │ │ cls = self.__class__ │ │ │ │ │ opts = self._meta │ │ │ │ │ _setattr = setattr │ │ │ │ │ _DEFERRED = DEFERRED │ │ │ │ │ @@ -588,15 +588,15 @@ │ │ │ │ │ f"{cls.__name__}() got unexpected keyword arguments: " │ │ │ │ │ f"{unexpected_names}" │ │ │ │ │ ) │ │ │ │ │ super().__init__() │ │ │ │ │ post_init.send(sender=cls, instance=self) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @classmethod │ │ │ │ │ def from_db(cls, db, field_names, values): │ │ │ │ │ if len(values) != len(cls._meta.concrete_fields): │ │ │ │ │ values_iter = iter(values) │ │ │ │ │ values = [ │ │ │ │ │ next(values_iter) if f.attname in field_names else DEFERRED │ │ │ │ │ for f in cls._meta.concrete_fields │ │ │ │ │ @@ -608,36 +608,36 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def __repr__(self): │ │ │ │ │ return "<%s: %s>" % (self.__class__.__name__, self) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def __str__(self): │ │ │ │ │ return "%s object (%s)" % (self.__class__.__name__, self.pk) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def __eq__(self, other): │ │ │ │ │ if not isinstance(other, Model): │ │ │ │ │ return NotImplemented │ │ │ │ │ if self._meta.concrete_model != other._meta.concrete_model: │ │ │ │ │ return False │ │ │ │ │ my_pk = self.pk │ │ │ │ │ if my_pk is None: │ │ │ │ │ return self is other │ │ │ │ │ return my_pk == other.pk │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def __hash__(self): │ │ │ │ │ if self.pk is None: │ │ │ │ │ raise TypeError("Model instances without primary key value are │ │ │ │ │ unhashable") │ │ │ │ │ return hash(self.pk) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -696,29 +696,29 @@ │ │ │ │ │ if parent_link and parent_link != self._meta.pk: │ │ │ │ │ setattr(self, parent_link.target_field.attname, value) │ │ │ │ │ return setattr(self, self._meta.pk.attname, value) │ │ │ │ │ │ │ │ │ │ pk = property(_get_pk_val, _set_pk_val) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def get_deferred_fields(self): │ │ │ │ │ """ │ │ │ │ │ Return a set containing names of deferred fields for this instance. │ │ │ │ │ """ │ │ │ │ │ return { │ │ │ │ │ f.attname │ │ │ │ │ for f in self._meta.concrete_fields │ │ │ │ │ if f.attname not in self.__dict__ │ │ │ │ │ } │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def refresh_from_db(self, using=None, fields=None): │ │ │ │ │ """ │ │ │ │ │ Reload field values from the database. │ │ │ │ │ │ │ │ │ │ By default, the reloading happens from the database this instance was │ │ │ │ │ loaded from, or by the read router if this instance wasn't loaded from │ │ │ │ │ any database. The using parameter will override the default. │ │ │ │ │ @@ -787,15 +787,15 @@ │ │ │ │ │ field.delete_cached_value(self) │ │ │ │ │ │ │ │ │ │ self._state.db = db_instance._state.db │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ async def arefresh_from_db(self, using=None, fields=None): │ │ │ │ │ return await sync_to_async(self.refresh_from_db)(using=using, │ │ │ │ │ fields=fields) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def serializable_value(self, field_name): │ │ │ │ │ @@ -812,15 +812,15 @@ │ │ │ │ │ try: │ │ │ │ │ field = self._meta.get_field(field_name) │ │ │ │ │ except FieldDoesNotExist: │ │ │ │ │ return getattr(self, field_name) │ │ │ │ │ return getattr(self, field.attname) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def save( │ │ │ │ │ self, force_insert=False, force_update=False, using=None, │ │ │ │ │ update_fields=None │ │ │ │ │ ): │ │ │ │ │ """ │ │ │ │ │ Save the current instance. Override this in a subclass if you want to │ │ │ │ │ control the saving process. │ │ │ │ │ @@ -874,15 +874,15 @@ │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ save.alters_data = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ async def asave( │ │ │ │ │ self, force_insert=False, force_update=False, using=None, │ │ │ │ │ update_fields=None │ │ │ │ │ ): │ │ │ │ │ return await sync_to_async(self.save)( │ │ │ │ │ force_insert=force_insert, │ │ │ │ │ force_update=force_update, │ │ │ │ │ @@ -1191,15 +1191,15 @@ │ │ │ │ │ raise ValueError( │ │ │ │ │ f"{operation_name}() prohibited to prevent data loss │ │ │ │ │ due to " │ │ │ │ │ f"unsaved related object '{field.name}'." │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def delete(self, using=None, keep_parents=False): │ │ │ │ │ if self.pk is None: │ │ │ │ │ raise ValueError( │ │ │ │ │ "%s object can't be deleted because its %s attribute is set " │ │ │ │ │ "to None." % (self._meta.object_name, self._meta.pk.attname) │ │ │ │ │ ) │ │ │ │ │ using = using or router.db_for_write(self.__class__, instance=self) │ │ │ │ │ @@ -1208,15 +1208,15 @@ │ │ │ │ │ return collector.delete() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ delete.alters_data = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ async def adelete(self, using=None, keep_parents=False): │ │ │ │ │ return await sync_to_async(self.delete)( │ │ │ │ │ using=using, │ │ │ │ │ keep_parents=keep_parents, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1294,29 +1294,29 @@ │ │ │ │ │ raise ValueError( │ │ │ │ │ "Unsaved model instance %r cannot be used in an ORM query." % │ │ │ │ │ self │ │ │ │ │ ) │ │ │ │ │ return getattr(self, field.remote_field.get_related_field().attname) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def clean(self): │ │ │ │ │ """ │ │ │ │ │ Hook for doing any extra model-wide validation after clean() has been │ │ │ │ │ called on every field by self.clean_fields. Any ValidationError raised │ │ │ │ │ by this method will not be associated with a particular field; it will │ │ │ │ │ have a special-case association with the field defined by │ │ │ │ │ NON_FIELD_ERRORS. │ │ │ │ │ """ │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate_unique(self, exclude=None): │ │ │ │ │ """ │ │ │ │ │ Check unique constraints on the model and raise ValidationError if any │ │ │ │ │ failed. │ │ │ │ │ """ │ │ │ │ │ unique_checks, date_checks = self._get_unique_checks(exclude=exclude) │ │ │ │ │ │ │ │ │ │ @@ -1536,15 +1536,15 @@ │ │ │ │ │ for parent_class in self._meta.get_parent_list(): │ │ │ │ │ if parent_class._meta.constraints: │ │ │ │ │ constraints.append((parent_class, │ │ │ │ │ parent_class._meta.constraints)) │ │ │ │ │ return constraints │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate_constraints(self, exclude=None): │ │ │ │ │ constraints = self.get_constraints() │ │ │ │ │ using = router.db_for_write(self.__class__, instance=self) │ │ │ │ │ │ │ │ │ │ errors = {} │ │ │ │ │ for model_class, model_constraints in constraints: │ │ │ │ │ for constraint in model_constraints: │ │ │ │ │ @@ -1561,15 +1561,15 @@ │ │ │ │ │ errors = e.update_error_dict(errors) │ │ │ │ │ if errors: │ │ │ │ │ raise ValidationError(errors) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def full_clean(self, exclude=None, validate_unique=True, │ │ │ │ │ validate_constraints=True): │ │ │ │ │ """ │ │ │ │ │ Call clean_fields(), clean(), validate_unique(), and │ │ │ │ │ validate_constraints() on the model. Raise a ValidationError for any │ │ │ │ │ errors that occur. │ │ │ │ │ """ │ │ │ │ │ @@ -1613,15 +1613,15 @@ │ │ │ │ │ │ │ │ │ │ if errors: │ │ │ │ │ raise ValidationError(errors) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def clean_fields(self, exclude=None): │ │ │ │ │ """ │ │ │ │ │ Clean all fields and raise a ValidationError containing a dict │ │ │ │ │ of all validation errors if any occur. │ │ │ │ │ """ │ │ │ │ │ if exclude is None: │ │ │ │ │ exclude = set() │ │ │ │ │ @@ -2685,12 +2685,12 @@ │ │ │ │ │ else: │ │ │ │ │ # Backwards compat - the model was cached directly in earlier versions. │ │ │ │ │ model = model_id │ │ │ │ │ return model.__new__(model) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ model_unpickle.__safe_for_unpickle__ = True │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/models/constraints.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.models.constraints — Django 4.2.13 documentation │ │ │ │ + django.db.models.constraints — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.models.constraints

│ │ │ │ +  

Codice sorgente per django.db.models.constraints

│ │ │ │  from enum import Enum
│ │ │ │  
│ │ │ │  from django.core.exceptions import FieldError, ValidationError
│ │ │ │  from django.db import connections
│ │ │ │  from django.db.models.expressions import Exists, ExpressionList, F, OrderBy
│ │ │ │  from django.db.models.indexes import IndexExpression
│ │ │ │  from django.db.models.lookups import Exact
│ │ │ │ @@ -83,15 +84,15 @@
│ │ │ │  from django.db.utils import DEFAULT_DB_ALIAS
│ │ │ │  from django.utils.translation import gettext_lazy as _
│ │ │ │  
│ │ │ │  __all__ = ["BaseConstraint", "CheckConstraint", "Deferrable", "UniqueConstraint"]
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class BaseConstraint: │ │ │ │ default_violation_error_message = _("Constraint “%(name)s” is violated.") │ │ │ │ violation_error_message = None │ │ │ │ │ │ │ │ def __init__(self, name, violation_error_message=None): │ │ │ │ self.name = name │ │ │ │ if violation_error_message is not None: │ │ │ │ @@ -109,15 +110,15 @@ │ │ │ │ def create_sql(self, model, schema_editor): │ │ │ │ raise NotImplementedError("This method must be implemented by a subclass.") │ │ │ │ │ │ │ │ def remove_sql(self, model, schema_editor): │ │ │ │ raise NotImplementedError("This method must be implemented by a subclass.") │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def validate(self, model, instance, exclude=None, using=DEFAULT_DB_ALIAS): │ │ │ │ raise NotImplementedError("This method must be implemented by a subclass.")
│ │ │ │ │ │ │ │ │ │ │ │ def get_violation_error_message(self): │ │ │ │ return self.violation_error_message % {"name": self.name} │ │ │ │ │ │ │ │ @@ -135,15 +136,15 @@ │ │ │ │ def clone(self): │ │ │ │ _, args, kwargs = self.deconstruct() │ │ │ │ return self.__class__(*args, **kwargs)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class CheckConstraint(BaseConstraint): │ │ │ │ def __init__(self, *, check, name, violation_error_message=None): │ │ │ │ self.check = check │ │ │ │ if not getattr(check, "conditional", False): │ │ │ │ raise TypeError( │ │ │ │ "CheckConstraint.check must be a Q instance or boolean expression." │ │ │ │ ) │ │ │ │ @@ -204,15 +205,15 @@ │ │ │ │ │ │ │ │ # A similar format was proposed for Python 3.10. │ │ │ │ def __repr__(self): │ │ │ │ return f"{self.__class__.__qualname__}.{self._name_}" │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class UniqueConstraint(BaseConstraint): │ │ │ │ def __init__( │ │ │ │ self, │ │ │ │ *expressions, │ │ │ │ fields=(), │ │ │ │ name=None, │ │ │ │ condition=None, │ │ │ │ @@ -462,35 +463,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmooddeellss..ccoonnssttrraaiinnttss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmooddeellss..ccoonnssttrraaiinnttss ************ │ │ │ │ │ from enum import Enum │ │ │ │ │ │ │ │ │ │ from django.core.exceptions import FieldError, ValidationError │ │ │ │ │ from django.db import connections │ │ │ │ │ from django.db.models.expressions import Exists, ExpressionList, F, OrderBy │ │ │ │ │ from django.db.models.indexes import IndexExpression │ │ │ │ │ from django.db.models.lookups import Exact │ │ │ │ │ @@ -15,15 +15,15 @@ │ │ │ │ │ from django.utils.translation import gettext_lazy as _ │ │ │ │ │ │ │ │ │ │ __all__ = ["BaseConstraint", "CheckConstraint", "Deferrable", │ │ │ │ │ "UniqueConstraint"] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class BaseConstraint: │ │ │ │ │ default_violation_error_message = _("Constraint “%(name)s” is violated.") │ │ │ │ │ violation_error_message = None │ │ │ │ │ │ │ │ │ │ def __init__(self, name, violation_error_message=None): │ │ │ │ │ self.name = name │ │ │ │ │ if violation_error_message is not None: │ │ │ │ │ @@ -44,15 +44,15 @@ │ │ │ │ │ subclass.") │ │ │ │ │ │ │ │ │ │ def remove_sql(self, model, schema_editor): │ │ │ │ │ raise NotImplementedError("This method must be implemented by a │ │ │ │ │ subclass.") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def validate(self, model, instance, exclude=None, using=DEFAULT_DB_ALIAS): │ │ │ │ │ raise NotImplementedError("This method must be implemented by a │ │ │ │ │ subclass.") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def get_violation_error_message(self): │ │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │ │ _, args, kwargs = self.deconstruct() │ │ │ │ │ return self.__class__(*args, **kwargs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class CheckConstraint(BaseConstraint): │ │ │ │ │ def __init__(self, *, check, name, violation_error_message=None): │ │ │ │ │ self.check = check │ │ │ │ │ if not getattr(check, "conditional", False): │ │ │ │ │ raise TypeError( │ │ │ │ │ "CheckConstraint.check must be a Q instance or boolean │ │ │ │ │ expression." │ │ │ │ │ @@ -147,15 +147,15 @@ │ │ │ │ │ │ │ │ │ │ # A similar format was proposed for Python 3.10. │ │ │ │ │ def __repr__(self): │ │ │ │ │ return f"{self.__class__.__qualname__}.{self._name_}" │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class UniqueConstraint(BaseConstraint): │ │ │ │ │ def __init__( │ │ │ │ │ self, │ │ │ │ │ *expressions, │ │ │ │ │ fields=(), │ │ │ │ │ name=None, │ │ │ │ │ condition=None, │ │ │ │ │ @@ -416,12 +416,12 @@ │ │ │ │ │ (self.condition))).check( │ │ │ │ │ against, using=using │ │ │ │ │ ): │ │ │ │ │ raise ValidationError(self.get_violation_error_message()) │ │ │ │ │ except FieldError: │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/models/deletion.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.models.deletion — Django 4.2.13 documentation │ │ │ │ + django.db.models.deletion — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.models.deletion

│ │ │ │ +  

Codice sorgente per django.db.models.deletion

│ │ │ │  from collections import Counter, defaultdict
│ │ │ │  from functools import partial, reduce
│ │ │ │  from itertools import chain
│ │ │ │  from operator import attrgetter, or_
│ │ │ │  
│ │ │ │  from django.db import IntegrityError, connections, models, transaction
│ │ │ │  from django.db.models import query_utils, signals, sql
│ │ │ │ @@ -89,30 +90,30 @@
│ │ │ │  class RestrictedError(IntegrityError):
│ │ │ │      def __init__(self, msg, restricted_objects):
│ │ │ │          self.restricted_objects = restricted_objects
│ │ │ │          super().__init__(msg, restricted_objects)
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def CASCADE(collector, field, sub_objs, using): │ │ │ │ collector.collect( │ │ │ │ sub_objs, │ │ │ │ source=field.remote_field.model, │ │ │ │ source_attr=field.name, │ │ │ │ nullable=field.null, │ │ │ │ fail_on_restricted=False, │ │ │ │ ) │ │ │ │ if field.null and not connections[using].features.can_defer_constraint_checks: │ │ │ │ collector.add_field_update(field, None, sub_objs)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def PROTECT(collector, field, sub_objs, using): │ │ │ │ raise ProtectedError( │ │ │ │ "Cannot delete some instances of model '%s' because they are " │ │ │ │ "referenced through a protected foreign key: '%s.%s'" │ │ │ │ % ( │ │ │ │ field.remote_field.model.__name__, │ │ │ │ sub_objs[0].__class__.__name__, │ │ │ │ @@ -120,23 +121,23 @@ │ │ │ │ ), │ │ │ │ sub_objs, │ │ │ │ )
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def RESTRICT(collector, field, sub_objs, using): │ │ │ │ collector.add_restricted_objects(field, sub_objs) │ │ │ │ collector.add_dependency(field.remote_field.model, field.model)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def SET(value): │ │ │ │ if callable(value): │ │ │ │ │ │ │ │ def set_on_delete(collector, field, sub_objs, using): │ │ │ │ collector.add_field_update(field, value(), sub_objs) │ │ │ │ │ │ │ │ else: │ │ │ │ @@ -147,35 +148,35 @@ │ │ │ │ set_on_delete.deconstruct = lambda: ("django.db.models.SET", (value,), {}) │ │ │ │ set_on_delete.lazy_sub_objs = True │ │ │ │ return set_on_delete
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def SET_NULL(collector, field, sub_objs, using): │ │ │ │ collector.add_field_update(field, None, sub_objs)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ SET_NULL.lazy_sub_objs = True │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def SET_DEFAULT(collector, field, sub_objs, using): │ │ │ │ collector.add_field_update(field, field.get_default(), sub_objs)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ SET_DEFAULT.lazy_sub_objs = True │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def DO_NOTHING(collector, field, sub_objs, using): │ │ │ │ pass
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def get_candidate_relations_to_delete(opts): │ │ │ │ # The candidate relations are the ones that come from N-1 and 1-1 relations. │ │ │ │ @@ -622,35 +623,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmooddeellss..ddeelleettiioonn ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmooddeellss..ddeelleettiioonn ************ │ │ │ │ │ from collections import Counter, defaultdict │ │ │ │ │ from functools import partial, reduce │ │ │ │ │ from itertools import chain │ │ │ │ │ from operator import attrgetter, or_ │ │ │ │ │ │ │ │ │ │ from django.db import IntegrityError, connections, models, transaction │ │ │ │ │ from django.db.models import query_utils, signals, sql │ │ │ │ │ @@ -20,15 +20,15 @@ │ │ │ │ │ class RestrictedError(IntegrityError): │ │ │ │ │ def __init__(self, msg, restricted_objects): │ │ │ │ │ self.restricted_objects = restricted_objects │ │ │ │ │ super().__init__(msg, restricted_objects) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def CASCADE(collector, field, sub_objs, using): │ │ │ │ │ collector.collect( │ │ │ │ │ sub_objs, │ │ │ │ │ source=field.remote_field.model, │ │ │ │ │ source_attr=field.name, │ │ │ │ │ nullable=field.null, │ │ │ │ │ fail_on_restricted=False, │ │ │ │ │ @@ -37,15 +37,15 @@ │ │ │ │ │ [using].features.can_defer_constraint_checks: │ │ │ │ │ collector.add_field_update(field, None, sub_objs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def PROTECT(collector, field, sub_objs, using): │ │ │ │ │ raise ProtectedError( │ │ │ │ │ "Cannot delete some instances of model '%s' because they are " │ │ │ │ │ "referenced through a protected foreign key: '%s.%s'" │ │ │ │ │ % ( │ │ │ │ │ field.remote_field.model.__name__, │ │ │ │ │ sub_objs[0].__class__.__name__, │ │ │ │ │ @@ -54,24 +54,24 @@ │ │ │ │ │ sub_objs, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def RESTRICT(collector, field, sub_objs, using): │ │ │ │ │ collector.add_restricted_objects(field, sub_objs) │ │ │ │ │ collector.add_dependency(field.remote_field.model, field.model) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def SET(value): │ │ │ │ │ if callable(value): │ │ │ │ │ │ │ │ │ │ def set_on_delete(collector, field, sub_objs, using): │ │ │ │ │ collector.add_field_update(field, value(), sub_objs) │ │ │ │ │ │ │ │ │ │ else: │ │ │ │ │ @@ -83,37 +83,37 @@ │ │ │ │ │ set_on_delete.lazy_sub_objs = True │ │ │ │ │ return set_on_delete │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def SET_NULL(collector, field, sub_objs, using): │ │ │ │ │ collector.add_field_update(field, None, sub_objs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ SET_NULL.lazy_sub_objs = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def SET_DEFAULT(collector, field, sub_objs, using): │ │ │ │ │ collector.add_field_update(field, field.get_default(), sub_objs) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ SET_DEFAULT.lazy_sub_objs = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def DO_NOTHING(collector, field, sub_objs, using): │ │ │ │ │ pass │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ def get_candidate_relations_to_delete(opts): │ │ │ │ │ @@ -562,12 +562,12 @@ │ │ │ │ │ origin=self.origin, │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ for model, instances in self.data.items(): │ │ │ │ │ for instance in instances: │ │ │ │ │ setattr(instance, model._meta.pk.attname, None) │ │ │ │ │ return sum(deleted_counter.values()), dict(deleted_counter) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/models/expressions.html │ │ │ │ @@ -1,17862 +1,17873 @@ │ │ │ │ 00000000: 3c21 444f 4354 5950 4520 6874 6d6c 3e0a . │ │ │ │ -00000010: 0a3c 6874 6d6c 206c 616e 673d 2265 6e22 .. . │ │ │ │ 00000050: 3c6d 6574 6120 6368 6172 7365 743d 2275 . . django.db.model │ │ │ │ 000000d0: 732e 6578 7072 6573 7369 6f6e 7320 2623 s.expressions &# │ │ │ │ 000000e0: 3832 3132 3b20 446a 616e 676f 2034 2e32 8212; Django 4.2 │ │ │ │ -000000f0: 2e31 3320 646f 6375 6d65 6e74 6174 696f .13 documentatio │ │ │ │ -00000100: 6e3c 2f74 6974 6c65 3e0a 2020 2020 3c6c n. . < │ │ │ │ -00000170: 6c69 6e6b 2072 656c 3d22 7374 796c 6573 link rel="styles │ │ │ │ -00000180: 6865 6574 2220 7479 7065 3d22 7465 7874 heet" type="text │ │ │ │ -00000190: 2f63 7373 2220 6872 6566 3d22 2e2e 2f2e /css" href="../. │ │ │ │ -000001a0: 2e2f 2e2e 2f2e 2e2f 5f73 7461 7469 632f ./../../_static/ │ │ │ │ -000001b0: 6465 6661 756c 742e 6373 733f 763d 6266 default.css?v=bf │ │ │ │ -000001c0: 3464 3734 6166 2220 2f3e 0a20 2020 203c 4d74af" />. < │ │ │ │ -000001d0: 7363 7269 7074 2073 7263 3d22 2e2e 2f2e script src="../. │ │ │ │ -000001e0: 2e2f 2e2e 2f2e 2e2f 5f73 7461 7469 632f ./../../_static/ │ │ │ │ -000001f0: 646f 6375 6d65 6e74 6174 696f 6e5f 6f70 documentation_op │ │ │ │ -00000200: 7469 6f6e 732e 6a73 3f76 3d39 3466 6332 tions.js?v=94fc2 │ │ │ │ -00000210: 6166 6122 3e3c 2f73 6372 6970 743e 0a20 afa">. │ │ │ │ -00000220: 2020 203c 7363 7269 7074 2073 7263 3d22 . │ │ │ │ -00000880: 0a0a 2020 3c2f 6865 6164 3e3c 626f 6479 .. ..
. │ │ │ │ -000008b0: 3c64 6976 2069 643d 2263 7573 746f 6d2d
.
.

Django 4.2.13 │ │ │ │ -00000920: 646f 6375 6d65 6e74 6174 696f 6e3c 2f61 documentation

. . Ho │ │ │ │ -00000990: 6d65 3c2f 613e 2020 7c0a 2020 2020 2020 me |. │ │ │ │ -000009a0: 2020 3c61 2074 6974 6c65 3d22 5461 626c │ │ │ │ -000009e0: 5461 626c 6520 6f66 2063 6f6e 7465 6e74 Table of content │ │ │ │ -000009f0: 733c 2f61 3e20 207c 0a20 2020 2020 2020 s |. │ │ │ │ -00000a00: 203c 6120 7469 746c 653d 2247 6c6f 6261 Index< │ │ │ │ -00000a40: 2f61 3e20 207c 0a20 2020 2020 2020 203c /a> |. < │ │ │ │ -00000a50: 6120 7469 746c 653d 224d 6f64 756c 6520 a title="Module │ │ │ │ -00000a60: 696e 6465 7822 2068 7265 663d 222e 2e2f index" href="../ │ │ │ │ -00000a70: 2e2e 2f2e 2e2f 2e2e 2f70 792d 6d6f 6469 ../../../py-modi │ │ │ │ -00000a80: 6e64 6578 2e68 746d 6c22 3e4d 6f64 756c ndex.html">Modul │ │ │ │ -00000a90: 6573 3c2f 613e 0a20 2020 2020 203c 2f64 es. .
. │ │ │ │ -00000ac0: 3c61 2068 7265 663d 222e 2e2f 2e2e 2f2e │ │ │ │ -00000b00: 7570 3c2f 613e 3c2f 6469 763e 0a20 2020 up
. │ │ │ │ -00000b10: 203c 2f64 6976 3e0a 0a20 2020 203c 6469
.. . │ │ │ │ -00000b30: 203c 6469 7620 6964 3d22 7975 692d 6d61
. │ │ │ │ -00000b60: 0a20 2020 2020 2020 2020 203c 6469 7620 .
. │ │ │ │ -00000bb0: 2020 2020 2020 0a20 203c 6831 3e53 6f75 .

Sou │ │ │ │ -00000bc0: 7263 6520 636f 6465 2066 6f72 2064 6a61 rce code for dja │ │ │ │ -00000bd0: 6e67 6f2e 6462 2e6d 6f64 656c 732e 6578 ngo.db.models.ex │ │ │ │ -00000be0: 7072 6573 7369 6f6e 733c 2f68 313e 3c64 pressions

.import<
│ │ │ │ -00000c30: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> copy.import datetime.import functools.import inspect.import warnings.from
│ │ │ │ -00000d70: 203c 7370 616e 2063 6c61 7373 3d22 6e6e   collections import defaultdict<
│ │ │ │ -00000dd0: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.from decimal import Decimal.from <
│ │ │ │ -00000e70: 7370 616e 2063 6c61 7373 3d22 6e6e 223e  span class="nn">
│ │ │ │ -00000e80: 7575 6964 3c2f 7370 616e 3e20 3c73 7061  uuid imp
│ │ │ │ -00000ea0: 6f72 743c 2f73 7061 6e3e 203c 7370 616e  ort UUID<
│ │ │ │ -00000ec0: 2f73 7061 6e3e 0a0a 3c73 7061 6e20 636c  /span>..from django.cor
│ │ │ │ -00000f00: 652e 6578 6365 7074 696f 6e73 3c2f 7370  e.exceptions import EmptyResultSe
│ │ │ │ -00000f50: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c  t,
│ │ │ │ -00000f70: 203c 7370 616e 2063 6c61 7373 3d22 6e22   FieldError, FullR
│ │ │ │ -00000fc0: 6573 756c 7453 6574 3c2f 7370 616e 3e0a  esultSet.
│ │ │ │ -00000fd0: 3c73 7061 6e20 636c 6173 733d 226b 6e22  from dj
│ │ │ │ -00001000: 616e 676f 2e64 623c 2f73 7061 6e3e 203c  ango.db <
│ │ │ │ -00001010: 7370 616e 2063 6c61 7373 3d22 6b6e 223e  span class="kn">
│ │ │ │ -00001020: 696d 706f 7274 3c2f 7370 616e 3e20 3c73  import Da
│ │ │ │ -00001040: 7461 6261 7365 4572 726f 723c 2f73 7061  tabaseError, NotSu
│ │ │ │ -00001080: 7070 6f72 7465 6445 7272 6f72 3c2f 7370  pportedError, conn
│ │ │ │ -000010c0: 6563 7469 6f6e 3c2f 7370 616e 3e0a 3c73  ection.f
│ │ │ │ -000010e0: 726f 6d3c 2f73 7061 6e3e 203c 7370 616e  rom djan
│ │ │ │ -00001100: 676f 2e64 622e 6d6f 6465 6c73 3c2f 7370  go.db.models import fields
│ │ │ │ -00001150: 0a3c 7370 616e 2063 6c61 7373 3d22 6b6e  .from d
│ │ │ │ -00001180: 6a61 6e67 6f2e 6462 2e6d 6f64 656c 732e  jango.db.models.
│ │ │ │ -00001190: 636f 6e73 7461 6e74 733c 2f73 7061 6e3e  constants
│ │ │ │ -000011a0: 203c 7370 616e 2063 6c61 7373 3d22 6b6e   import 
│ │ │ │ -000011c0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -000011d0: 4c4f 4f4b 5550 5f53 4550 3c2f 7370 616e  LOOKUP_SEP.from <
│ │ │ │ -00001200: 7370 616e 2063 6c61 7373 3d22 6e6e 223e  span class="nn">
│ │ │ │ -00001210: 646a 616e 676f 2e64 622e 6d6f 6465 6c73  django.db.models
│ │ │ │ -00001220: 2e71 7565 7279 5f75 7469 6c73 3c2f 7370  .query_utils import Q.fro
│ │ │ │ -00001280: 6d3c 2f73 7061 6e3e 203c 7370 616e 2063  m django
│ │ │ │ -000012a0: 2e75 7469 6c73 2e64 6563 6f6e 7374 7275  .utils.deconstru
│ │ │ │ -000012b0: 6374 3c2f 7370 616e 3e20 3c73 7061 6e20  ct impor
│ │ │ │ -000012d0: 743c 2f73 7061 6e3e 203c 7370 616e 2063  t deconst
│ │ │ │ -000012f0: 7275 6374 6962 6c65 3c2f 7370 616e 3e0a  ructible.
│ │ │ │ -00001300: 3c73 7061 6e20 636c 6173 733d 226b 6e22  from dj
│ │ │ │ -00001330: 616e 676f 2e75 7469 6c73 2e64 6570 7265  ango.utils.depre
│ │ │ │ -00001340: 6361 7469 6f6e 3c2f 7370 616e 3e20 3c73  cation i
│ │ │ │ -00001360: 6d70 6f72 743c 2f73 7061 6e3e 203c 7370  mport Rem
│ │ │ │ -00001380: 6f76 6564 496e 446a 616e 676f 3530 5761  ovedInDjango50Wa
│ │ │ │ -00001390: 726e 696e 673c 2f73 7061 6e3e 0a3c 7370  rning.fr
│ │ │ │ -000013b0: 6f6d 3c2f 7370 616e 3e20 3c73 7061 6e20  om djang
│ │ │ │ -000013d0: 6f2e 7574 696c 732e 6675 6e63 7469 6f6e  o.utils.function
│ │ │ │ -000013e0: 616c 3c2f 7370 616e 3e20 3c73 7061 6e20  al impor
│ │ │ │ -00001400: 743c 2f73 7061 6e3e 203c 7370 616e 2063  t cached_
│ │ │ │ -00001420: 7072 6f70 6572 7479 3c2f 7370 616e 3e0a  property.
│ │ │ │ -00001430: 3c73 7061 6e20 636c 6173 733d 226b 6e22  from dj
│ │ │ │ -00001460: 616e 676f 2e75 7469 6c73 2e68 6173 6861  ango.utils.hasha
│ │ │ │ -00001470: 626c 653c 2f73 7061 6e3e 203c 7370 616e  ble impo
│ │ │ │ -00001490: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20  rt make_h
│ │ │ │ -000014b0: 6173 6861 626c 653c 2f73 7061 6e3e 0a0a  ashable..
│ │ │ │ -000014c0: 0a3c 7370 616e 2063 6c61 7373 3d22 6b22  .class S
│ │ │ │ -000014f0: 514c 6974 654e 756d 6572 6963 4d69 7869  QLiteNumericMixi
│ │ │ │ -00001500: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  n:
│ │ │ │ -00001520: 0a3c 7370 616e 2063 6c61 7373 3d22 7722  .    &qu
│ │ │ │ -00001550: 6f74 3b26 7175 6f74 3b26 7175 6f74 3b3c  ot;""<
│ │ │ │ -00001560: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.    Some
│ │ │ │ -00001580: 2065 7870 7265 7373 696f 6e73 2077 6974   expressions wit
│ │ │ │ -00001590: 6820 6f75 7470 7574 5f66 6965 6c64 3d44  h output_field=D
│ │ │ │ -000015a0: 6563 696d 616c 4669 656c 6428 2920 6d75  ecimalField() mu
│ │ │ │ -000015b0: 7374 2062 6520 6361 7374 2074 6f3c 2f73  st be cast to.    numeri
│ │ │ │ -000015e0: 6320 746f 2062 6520 7072 6f70 6572 6c79  c to be properly
│ │ │ │ -000015f0: 2066 696c 7465 7265 642e 3c2f 7370 616e   filtered..    "&qu
│ │ │ │ -00001620: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e  ot;"
│ │ │ │ -00001630: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    def
│ │ │ │ -00001650: 203c 7370 616e 2063 6c61 7373 3d22 6e66   as_sqlite(self<
│ │ │ │ -000016a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -000016c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63  span class="n">c
│ │ │ │ -000016d0: 6f6d 7069 6c65 723c 2f73 7061 6e3e 3c73  ompiler,<
│ │ │ │ -000016f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> connectio
│ │ │ │ -00001710: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  n,
│ │ │ │ -00001730: 203c 7370 616e 2063 6c61 7373 3d22 6f22   **extra_
│ │ │ │ -00001760: 636f 6e74 6578 743c 2f73 7061 6e3e 3c73  context):
│ │ │ │ -00001780: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00001790: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -000017a0: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20  sql, params
│ │ │ │ -000017e0: 203c 7370 616e 2063 6c61 7373 3d22 6f22   = self<
│ │ │ │ -00001810: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>.as
│ │ │ │ -00001840: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e  _sql(compiler, conne
│ │ │ │ -000018b0: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061  ction, **ex
│ │ │ │ -00001900: 7472 615f 636f 6e74 6578 743c 2f73 7061  tra_context).     
│ │ │ │ -00001930: 2020 203c 7370 616e 2063 6c61 7373 3d22     try:.          
│ │ │ │ -00001970: 2020 3c73 7061 6e20 636c 6173 733d 226b    if sel
│ │ │ │ -000019a0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ -000019c0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -000019d0: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370  output_field.get_i
│ │ │ │ -00001a10: 6e74 6572 6e61 6c5f 7479 7065 3c2f 7370  nternal_type() ==<
│ │ │ │ -00001a50: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> "De
│ │ │ │ -00001a70: 6369 6d61 6c46 6965 6c64 2671 756f 743b  cimalField"
│ │ │ │ -00001a80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  :.
│ │ │ │ -00001aa0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ -00001ab0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00001ac0: 7371 6c3c 2f73 7061 6e3e 203c 7370 616e  sql = "CAST(
│ │ │ │ -00001b00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  %s AS NUMERIC)&q
│ │ │ │ -00001b40: 756f 743b 3c2f 7370 616e 3e20 3c73 7061  uot; % sql.
│ │ │ │ -00001b80: 2020 2020 2020 2020 3c73 7061 6e20 636c          except FieldError
│ │ │ │ -00001bc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  :.
│ │ │ │ -00001be0: 2020 2020 2020 2020 2020 2020 3c73 7061              pass
│ │ │ │ -00001c00: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00001c10: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -00001c20: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return sq
│ │ │ │ -00001c40: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c  l,
│ │ │ │ -00001c60: 203c 7370 616e 2063 6c61 7373 3d22 6e22   params..
│ │ │ │ -00001c80: 0a3c 7370 616e 2063 6c61 7373 3d22 6b22  .class C
│ │ │ │ -00001cb0: 6f6d 6269 6e61 626c 653c 2f73 7061 6e3e  ombinable
│ │ │ │ -00001cc0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00001cd0: 3a3c 2f73 7061 6e3e 0a3c 7370 616e 2063  :.    ""
│ │ │ │ -00001d10: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 0a3c  ;".<
│ │ │ │ -00001d20: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ -00001d30: 2020 2020 5072 6f76 6964 6520 7468 6520      Provide the 
│ │ │ │ -00001d40: 6162 696c 6974 7920 746f 2063 6f6d 6269  ability to combi
│ │ │ │ -00001d50: 6e65 206f 6e65 206f 7220 7477 6f20 6f62  ne one or two ob
│ │ │ │ -00001d60: 6a65 6374 7320 7769 7468 3c2f 7370 616e  jects with.    some conn
│ │ │ │ -00001d90: 6563 746f 722e 2046 6f72 2065 7861 6d70  ector. For examp
│ │ │ │ -00001da0: 6c65 2046 2826 2333 393b 666f 6f26 2333  le F('foo
│ │ │ │ -00001db0: 393b 2920 2b20 4628 2623 3339 3b62 6172  9;) + F('bar
│ │ │ │ -00001dc0: 2623 3339 3b29 2e3c 2f73 7061 6e3e 0a3c  ')..<
│ │ │ │ -00001dd0: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ -00001de0: 2020 2020 2671 756f 743b 2671 756f 743b      ""
│ │ │ │ -00001df0: 2671 756f 743b 3c2f 7370 616e 3e0a 0a20  ".. 
│ │ │ │ -00001e00: 2020 203c 7370 616e 2063 6c61 7373 3d22     # Arithmetic
│ │ │ │ -00001e20: 2063 6f6e 6e65 6374 6f72 733c 2f73 7061   connectors.    ADD = &quo
│ │ │ │ -00001e80: 743b 2b26 7175 6f74 3b3c 2f73 7061 6e3e  t;+"
│ │ │ │ -00001e90: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    SUB 
│ │ │ │ -00001eb0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ -00001ec0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063  = "
│ │ │ │ -00001ee0: 2d26 7175 6f74 3b3c 2f73 7061 6e3e 0a20  -". 
│ │ │ │ -00001ef0: 2020 203c 7370 616e 2063 6c61 7373 3d22     MUL =<
│ │ │ │ -00001f20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> "*&
│ │ │ │ -00001f40: 7175 6f74 3b3c 2f73 7061 6e3e 0a20 2020  quot;.   
│ │ │ │ -00001f50: 203c 7370 616e 2063 6c61 7373 3d22 6e22   DIV = "/&qu
│ │ │ │ -00001fa0: 6f74 3b3c 2f73 7061 6e3e 0a20 2020 203c  ot;.    <
│ │ │ │ -00001fb0: 7370 616e 2063 6c61 7373 3d22 6e22 3e50  span class="n">P
│ │ │ │ -00001fc0: 4f57 3c2f 7370 616e 3e20 3c73 7061 6e20  OW = "^"
│ │ │ │ -00002000: 3b3c 2f73 7061 6e3e 0a20 2020 203c 7370  ;.    # 
│ │ │ │ -00002020: 5468 6520 666f 6c6c 6f77 696e 6720 6973  The following is
│ │ │ │ -00002030: 2061 2071 756f 7465 6420 2520 6f70 6572   a quoted % oper
│ │ │ │ -00002040: 6174 6f72 202d 2069 7420 6973 2071 756f  ator - it is quo
│ │ │ │ -00002050: 7465 6420 6265 6361 7573 6520 6974 2063  ted because it c
│ │ │ │ -00002060: 616e 2062 653c 2f73 7061 6e3e 0a20 2020  an be.   
│ │ │ │ -00002070: 203c 7370 616e 2063 6c61 7373 3d22 6331   # used in stri
│ │ │ │ -00002090: 6e67 7320 7468 6174 2061 6c73 6f20 6861  ngs that also ha
│ │ │ │ -000020a0: 7665 2070 6172 616d 6574 6572 2073 7562  ve parameter sub
│ │ │ │ -000020b0: 7374 6974 7574 696f 6e2e 3c2f 7370 616e  stitution..    MOD
│ │ │ │ -000020e0: 203c 7370 616e 2063 6c61 7373 3d22 6f22   = "
│ │ │ │ -00002110: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c  ;%%"
│ │ │ │ -00002150: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    # Bitwise
│ │ │ │ -00002170: 206f 7065 7261 746f 7273 202d 206e 6f74   operators - not
│ │ │ │ -00002180: 6520 7468 6174 2074 6865 7365 2061 7265  e that these are
│ │ │ │ -00002190: 2067 656e 6572 6174 6564 2062 7920 2e62   generated by .b
│ │ │ │ -000021a0: 6974 616e 6428 293c 2f73 7061 6e3e 0a20  itand(). 
│ │ │ │ -000021b0: 2020 203c 7370 616e 2063 6c61 7373 3d22     # and .bitor
│ │ │ │ -000021d0: 2829 2c20 7468 6520 2623 3339 3b26 616d  (), the '&am
│ │ │ │ -000021e0: 703b 2623 3339 3b20 616e 6420 2623 3339  p;' and '
│ │ │ │ -000021f0: 3b7c 2623 3339 3b20 6172 6520 7265 7365  ;|' are rese
│ │ │ │ -00002200: 7276 6564 2066 6f72 2062 6f6f 6c65 616e  rved for boolean
│ │ │ │ -00002210: 206f 7065 7261 746f 723c 2f73 7061 6e3e   operator
│ │ │ │ -00002220: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    # usage..    BITAND
│ │ │ │ -00002260: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   =
│ │ │ │ -00002280: 203c 7370 616e 2063 6c61 7373 3d22 7332   "&&qu
│ │ │ │ -000022a0: 6f74 3b3c 2f73 7061 6e3e 0a20 2020 203c  ot;.    <
│ │ │ │ -000022b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e42  span class="n">B
│ │ │ │ -000022c0: 4954 4f52 3c2f 7370 616e 3e20 3c73 7061  ITOR = "|&qu
│ │ │ │ -00002300: 6f74 3b3c 2f73 7061 6e3e 0a20 2020 203c  ot;.    <
│ │ │ │ -00002310: 7370 616e 2063 6c61 7373 3d22 6e22 3e42  span class="n">B
│ │ │ │ -00002320: 4954 4c45 4654 5348 4946 543c 2f73 7061  ITLEFTSHIFT = &qu
│ │ │ │ -00002360: 6f74 3b26 6c74 3b26 6c74 3b26 7175 6f74  ot;<<"
│ │ │ │ -00002370: 3b3c 2f73 7061 6e3e 0a20 2020 203c 7370  ;.    BIT
│ │ │ │ -00002390: 5249 4748 5453 4849 4654 3c2f 7370 616e  RIGHTSHIFT = &quo
│ │ │ │ -000023d0: 743b 2667 743b 2667 743b 2671 756f 743b  t;>>"
│ │ │ │ -000023e0: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061  .    BITX
│ │ │ │ -00002400: 4f52 3c2f 7370 616e 3e20 3c73 7061 6e20  OR = "#"
│ │ │ │ -00002440: 3b3c 2f73 7061 6e3e 0a0a 2020 2020 3c73  ;..    de
│ │ │ │ -00002460: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f _combi
│ │ │ │ -00002480: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063  ne(self, other, conne
│ │ │ │ -00002520: 6374 6f72 3c2f 7370 616e 3e3c 7370 616e  ctor, reversed):.  
│ │ │ │ -00002580: 2020 2020 2020 3c73 7061 6e20 636c 6173        if 
│ │ │ │ -000025a0: 3c73 7061 6e20 636c 6173 733d 226f 7722  not has
│ │ │ │ -000025d0: 6174 7472 3c2f 7370 616e 3e3c 7370 616e  attr(other<
│ │ │ │ -00002610: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ -00002620: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   "r
│ │ │ │ -00002640: 6573 6f6c 7665 5f65 7870 7265 7373 696f  esolve_expressio
│ │ │ │ -00002650: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 3c73  n"):
│ │ │ │ -00002670: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00002680: 2020 2020 3c73 7061 6e20 636c 6173 733d      # everythin
│ │ │ │ -000026a0: 6720 6d75 7374 2062 6520 7265 736f 6c76  g must be resolv
│ │ │ │ -000026b0: 6162 6c65 2074 6f20 616e 2065 7870 7265  able to an expre
│ │ │ │ -000026c0: 7373 696f 6e3c 2f73 7061 6e3e 0a20 2020  ssion.   
│ │ │ │ -000026d0: 2020 2020 2020 2020 203c 7370 616e 2063           other = <
│ │ │ │ -00002710: 7370 616e 2063 6c61 7373 3d22 6e22 3e56  span class="n">V
│ │ │ │ -00002720: 616c 7565 3c2f 7370 616e 3e3c 7370 616e  alue(other<
│ │ │ │ -00002760: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -00002770: 3c2f 7370 616e 3e0a 0a20 2020 2020 2020  ..       
│ │ │ │ -00002780: 203c 7370 616e 2063 6c61 7373 3d22 6b22   if reve
│ │ │ │ -000027b0: 7273 6564 3c2f 7370 616e 3e3c 7370 616e  rsed:.            
│ │ │ │ -000027e0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -000027f0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return Co
│ │ │ │ -00002810: 6d62 696e 6564 4578 7072 6573 7369 6f6e  mbinedExpression
│ │ │ │ -00002820: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -00002840: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f  span class="n">o
│ │ │ │ -00002850: 7468 6572 3c2f 7370 616e 3e3c 7370 616e  ther, connector, se
│ │ │ │ -000028c0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf).        return
│ │ │ │ -00002900: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   Combined
│ │ │ │ -00002920: 4578 7072 6573 7369 6f6e 3c2f 7370 616e  Expression(self, co
│ │ │ │ -00002990: 6e6e 6563 746f 723c 2f73 7061 6e3e 3c73  nnector,<
│ │ │ │ -000029b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> other)..   
│ │ │ │ -000029f0: 203c 7370 616e 2063 6c61 7373 3d22 6331   #############<
│ │ │ │ -00002a10: 2f73 7061 6e3e 0a20 2020 203c 7370 616e  /span>.    # OP
│ │ │ │ -00002a30: 4552 4154 4f52 5320 233c 2f73 7061 6e3e  ERATORS #
│ │ │ │ -00002a40: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    ##########
│ │ │ │ -00002a60: 2323 233c 2f73 7061 6e3e 0a0a 2020 2020  ###..    
│ │ │ │ -00002a70: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -00002a80: 6465 663c 2f73 7061 6e3e 203c 7370 616e  def __ne
│ │ │ │ -00002aa0: 675f 5f3c 2f73 7061 6e3e 3c73 7061 6e20  g__(self):
│ │ │ │ -00002af0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00002b00: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -00002b10: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return s
│ │ │ │ -00002b30: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf._combine(-1, self<
│ │ │ │ -00002bf0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ -00002c00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  MUL, False
│ │ │ │ -00002c50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ).
│ │ │ │ -00002c70: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ -00002c90: 3c73 7061 6e20 636c 6173 733d 2266 6d22  __add__<
│ │ │ │ -00002cb0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ -00002cc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self, othe
│ │ │ │ -00002d10: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r):.        return
│ │ │ │ -00002d50: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   self._com
│ │ │ │ -00002da0: 6269 6e65 3c2f 7370 616e 3e3c 7370 616e  bine(other<
│ │ │ │ -00002de0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ -00002df0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   self.ADD<
│ │ │ │ -00002e40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -00002e60: 7370 616e 2063 6c61 7373 3d22 6b63 223e  span class="kc">
│ │ │ │ -00002e70: 4661 6c73 653c 2f73 7061 6e3e 3c73 7061  False)..    def __sub__(sel
│ │ │ │ -00002f00: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f,
│ │ │ │ -00002f20: 203c 7370 616e 2063 6c61 7373 3d22 6e22   other):<
│ │ │ │ -00002f50: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ -00002f60: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ -00002f70: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn se
│ │ │ │ -00002f90: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf._combine
│ │ │ │ -00002fd0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00002fe0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (other, se
│ │ │ │ -00003030: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.SUB, False)..    <
│ │ │ │ -000030c0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64  span class="k">d
│ │ │ │ -000030d0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20  ef __mul
│ │ │ │ -000030f0: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063  __(self, other):.    
│ │ │ │ -00003180: 2020 2020 3c73 7061 6e20 636c 6173 733d      return self.<
│ │ │ │ -000031d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>_combine(oth
│ │ │ │ -00003220: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er, self.<
│ │ │ │ -00003270: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>MUL
│ │ │ │ -00003290: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -000032a0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , False<
│ │ │ │ -000032c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>)..
│ │ │ │ -000032e0: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ -00003300: 7370 616e 2063 6c61 7373 3d22 666d 223e  span class="fm">
│ │ │ │ -00003310: 5f5f 7472 7565 6469 765f 5f3c 2f73 7061  __truediv__(self<
│ │ │ │ -00003350: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -00003370: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f  span class="n">o
│ │ │ │ -00003380: 7468 6572 3c2f 7370 616e 3e3c 7370 616e  ther):.        ret
│ │ │ │ -000033c0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e  urn self
│ │ │ │ -000033e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  .<
│ │ │ │ -00003400: 7370 616e 2063 6c61 7373 3d22 6e22 3e5f  span class="n">_
│ │ │ │ -00003410: 636f 6d62 696e 653c 2f73 7061 6e3e 3c73  combine(<
│ │ │ │ -00003430: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>other, self
│ │ │ │ -00003480: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  .<
│ │ │ │ -000034a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e44  span class="n">D
│ │ │ │ -000034b0: 4956 3c2f 7370 616e 3e3c 7370 616e 2063  IV, False<
│ │ │ │ -000034f0: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -00003500: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ -00003520: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   __mod__
│ │ │ │ -00003540: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -00003560: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -00003570: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self, other
│ │ │ │ -000035b0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -000035c0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ -000035d0: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ -000035f0: 3c73 7061 6e20 636c 6173 733d 2262 7022  self._combine(other
│ │ │ │ -00003670: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ -00003690: 3c73 7061 6e20 636c 6173 733d 2262 7022  self.MOD,<
│ │ │ │ -000036f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> False)..  
│ │ │ │ -00003730: 2020 3c73 7061 6e20 636c 6173 733d 226b    def __
│ │ │ │ -00003760: 706f 775f 5f3c 2f73 7061 6e3e 3c73 7061  pow__(self
│ │ │ │ -000037a0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -000037b0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , other):. 
│ │ │ │ -000037f0: 2020 2020 2020 203c 7370 616e 2063 6c61         return self._combin
│ │ │ │ -00003860: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e(
│ │ │ │ -00003880: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00003890: 6f74 6865 723c 2f73 7061 6e3e 3c73 7061  other, self.POW, Fal
│ │ │ │ -00003930: 7365 3c2f 7370 616e 3e3c 7370 616e 2063  se)..    def __and__(self, ot
│ │ │ │ -000039f0: 6865 723c 2f73 7061 6e3e 3c73 7061 6e20  her):.        if getattr(se
│ │ │ │ -00003a80: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf, "conditi
│ │ │ │ -00003ac0: 6f6e 616c 2671 756f 743b 3c2f 7370 616e  onal", False
│ │ │ │ -00003b00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ) 
│ │ │ │ -00003b20: 3c73 7061 6e20 636c 6173 733d 226f 7722  and get
│ │ │ │ -00003b50: 6174 7472 3c2f 7370 616e 3e3c 7370 616e  attr(other<
│ │ │ │ -00003b90: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ -00003ba0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   "c
│ │ │ │ -00003bc0: 6f6e 6469 7469 6f6e 616c 2671 756f 743b  onditional"
│ │ │ │ -00003bd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ -00003bf0: 3c73 7061 6e20 636c 6173 733d 226b 6322  False):<
│ │ │ │ -00003c20: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ -00003c30: 2020 203c 7370 616e 2063 6c61 7373 3d22     return
│ │ │ │ -00003c50: 203c 7370 616e 2063 6c61 7373 3d22 6e22   Q(self) & Q(other<
│ │ │ │ -00003d20: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -00003d30: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00003d40: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -00003d50: 7261 6973 653c 2f73 7061 6e3e 203c 7370  raise No
│ │ │ │ -00003d70: 7449 6d70 6c65 6d65 6e74 6564 4572 726f  tImplementedErro
│ │ │ │ -00003d80: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r(
│ │ │ │ -00003da0: 0a20 2020 2020 2020 2020 2020 203c 7370  .            &q
│ │ │ │ -00003dc0: 756f 743b 5573 6520 2e62 6974 616e 6428  uot;Use .bitand(
│ │ │ │ -00003dd0: 292c 202e 6269 746f 7228 292c 2061 6e64  ), .bitor(), and
│ │ │ │ -00003de0: 202e 6269 7478 6f72 2829 2066 6f72 2062   .bitxor() for b
│ │ │ │ -00003df0: 6974 7769 7365 206c 6f67 6963 616c 206f  itwise logical o
│ │ │ │ -00003e00: 7065 7261 7469 6f6e 732e 2671 756f 743b  perations."
│ │ │ │ -00003e10: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00003e20: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00003e30: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73  )..    de
│ │ │ │ -00003e50: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f bitand
│ │ │ │ -00003e70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -00003e90: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -00003ea0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self, other
│ │ │ │ -00003ee0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00003ef0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ -00003f00: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ -00003f20: 3c73 7061 6e20 636c 6173 733d 2262 7022  self._combine(other
│ │ │ │ -00003fa0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ -00003fc0: 3c73 7061 6e20 636c 6173 733d 2262 7022  self.BITAND, False
│ │ │ │ -00004040: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ).
│ │ │ │ -00004060: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ -00004080: 3c73 7061 6e20 636c 6173 733d 226e 6622  bitleftshift(sel
│ │ │ │ -000040d0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f,
│ │ │ │ -000040f0: 203c 7370 616e 2063 6c61 7373 3d22 6e22   other):<
│ │ │ │ -00004120: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ -00004130: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ -00004140: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn se
│ │ │ │ -00004160: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf._combine
│ │ │ │ -000041a0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -000041b0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (other, se
│ │ │ │ -00004200: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.BITLEFTSHIFT, Fa
│ │ │ │ -00004270: 6c73 653c 2f73 7061 6e3e 3c73 7061 6e20  lse)..    def bitrightshif
│ │ │ │ -000042d0: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c  t(
│ │ │ │ -000042f0: 3c73 7061 6e20 636c 6173 733d 2262 7022  self, other):.     
│ │ │ │ -00004360: 2020 203c 7370 616e 2063 6c61 7373 3d22     return
│ │ │ │ -00004380: 203c 7370 616e 2063 6c61 7373 3d22 6270   self._combine(othe
│ │ │ │ -00004400: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r,
│ │ │ │ -00004420: 203c 7370 616e 2063 6c61 7373 3d22 6270   self.BITRIGHTSHI
│ │ │ │ -00004470: 4654 3c2f 7370 616e 3e3c 7370 616e 2063  FT, False<
│ │ │ │ -000044b0: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -000044c0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ -000044e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   __xor__
│ │ │ │ -00004500: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -00004520: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -00004530: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self, other
│ │ │ │ -00004570: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00004580: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ -00004590: 2020 3c73 7061 6e20 636c 6173 733d 226b    if get
│ │ │ │ -000045c0: 6174 7472 3c2f 7370 616e 3e3c 7370 616e  attr(self<
│ │ │ │ -00004600: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ -00004610: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   "c
│ │ │ │ -00004630: 6f6e 6469 7469 6f6e 616c 2671 756f 743b  onditional"
│ │ │ │ -00004640: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ -00004660: 3c73 7061 6e20 636c 6173 733d 226b 6322  False) and getattr(other, &
│ │ │ │ -00004730: 7175 6f74 3b63 6f6e 6469 7469 6f6e 616c  quot;conditional
│ │ │ │ -00004740: 2671 756f 743b 3c2f 7370 616e 3e3c 7370  ", False):.   
│ │ │ │ -000047a0: 2020 2020 2020 2020 203c 7370 616e 2063           return<
│ │ │ │ -000047c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> Q<
│ │ │ │ -000047e0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ -000047f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self) ^ Q(other).      
│ │ │ │ -000048b0: 2020 3c73 7061 6e20 636c 6173 733d 226b    raise <
│ │ │ │ -000048d0: 7370 616e 2063 6c61 7373 3d22 6e65 223e  span class="ne">
│ │ │ │ -000048e0: 4e6f 7449 6d70 6c65 6d65 6e74 6564 4572  NotImplementedEr
│ │ │ │ -000048f0: 726f 723c 2f73 7061 6e3e 3c73 7061 6e20  ror(.            <
│ │ │ │ -00004920: 7370 616e 2063 6c61 7373 3d22 7332 223e  span class="s2">
│ │ │ │ -00004930: 2671 756f 743b 5573 6520 2e62 6974 616e  "Use .bitan
│ │ │ │ -00004940: 6428 292c 202e 6269 746f 7228 292c 2061  d(), .bitor(), a
│ │ │ │ -00004950: 6e64 202e 6269 7478 6f72 2829 2066 6f72  nd .bitxor() for
│ │ │ │ -00004960: 2062 6974 7769 7365 206c 6f67 6963 616c   bitwise logical
│ │ │ │ -00004970: 206f 7065 7261 7469 6f6e 732e 2671 756f   operations.&quo
│ │ │ │ -00004980: 743b 3c2f 7370 616e 3e0a 2020 2020 2020  t;.      
│ │ │ │ -00004990: 2020 3c73 7061 6e20 636c 6173 733d 2270    )..    
│ │ │ │ -000049b0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -000049c0: 6465 663c 2f73 7061 6e3e 203c 7370 616e  def bitx
│ │ │ │ -000049e0: 6f72 3c2f 7370 616e 3e3c 7370 616e 2063  or(self, other):.    
│ │ │ │ -00004a70: 2020 2020 3c73 7061 6e20 636c 6173 733d      return self.<
│ │ │ │ -00004ac0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>_combine(oth
│ │ │ │ -00004b10: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er, self.<
│ │ │ │ -00004b60: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>BITXOR, Fal
│ │ │ │ -00004bb0: 7365 3c2f 7370 616e 3e3c 7370 616e 2063  se)..    def __or__
│ │ │ │ +000000f0: 2e31 3320 646f 6375 6d65 6e74 617a 696f  .13 documentazio
│ │ │ │ +00000100: 6e65 3c2f 7469 746c 653e 0a20 2020 203c  ne.    <
│ │ │ │ +00000110: 6c69 6e6b 2072 656c 3d22 7374 796c 6573  link rel="styles
│ │ │ │ +00000120: 6865 6574 2220 7479 7065 3d22 7465 7874  heet" type="text
│ │ │ │ +00000130: 2f63 7373 2220 6872 6566 3d22 2e2e 2f2e  /css" href="../.
│ │ │ │ +00000140: 2e2f 2e2e 2f2e 2e2f 5f73 7461 7469 632f  ./../../_static/
│ │ │ │ +00000150: 7079 676d 656e 7473 2e63 7373 3f76 3d64  pygments.css?v=d
│ │ │ │ +00000160: 3130 3539 3761 3422 202f 3e0a 2020 2020  10597a4" />.    
│ │ │ │ +00000170: 3c6c 696e 6b20 7265 6c3d 2273 7479 6c65  .    
│ │ │ │ +000001d0: 3c73 6372 6970 7420 7372 633d 222e 2e2f  .
│ │ │ │ +00000220: 2020 2020 3c73 6372 6970 7420 7372 633d      
│ │ │ │ +00000300: 0a20 2020 203c 6c69 6e6b 2072 656c 3d22  .    .    
.
│ │ │ │ +00000920: 0a20 2020 203c 6469 7620 6964 3d22 6864 . .. │ │ │ │ +00000b70: 3c64 6976 2069 643d 2262 6422 3e0a 2020
. │ │ │ │ +00000b80: 2020 2020 3c64 6976 2069 643d 2279 7569
. │ │ │ │ +00000ba0: 3c64 6976 2063 6c61 7373 3d22 7975 692d
. . │ │ │ │ +00000c00: 2020 2020 2020 2020 200a 2020 3c68 313e .

│ │ │ │ +00000c10: 436f 6469 6365 2073 6f72 6765 6e74 6520 Codice sorgente │ │ │ │ +00000c20: 7065 7220 646a 616e 676f 2e64 622e 6d6f per django.db.mo │ │ │ │ +00000c30: 6465 6c73 2e65 7870 7265 7373 696f 6e73 dels.expressions │ │ │ │ +00000c40: 3c2f 6831 3e3c 6469 7620 636c 6173 733d

.<
│ │ │ │ +00000c70: 7370 616e 2063 6c61 7373 3d22 6b6e 223e  span class="kn">
│ │ │ │ +00000c80: 696d 706f 7274 3c2f 7370 616e 3e20 3c73  import c
│ │ │ │ +00000ca0: 6f70 793c 2f73 7061 6e3e 0a3c 7370 616e  opy.impo
│ │ │ │ +00000cc0: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20  rt datet
│ │ │ │ +00000ce0: 696d 653c 2f73 7061 6e3e 0a3c 7370 616e  ime.impo
│ │ │ │ +00000d00: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20  rt funct
│ │ │ │ +00000d20: 6f6f 6c73 3c2f 7370 616e 3e0a 3c73 7061  ools.imp
│ │ │ │ +00000d40: 6f72 743c 2f73 7061 6e3e 203c 7370 616e  ort insp
│ │ │ │ +00000d60: 6563 743c 2f73 7061 6e3e 0a3c 7370 616e  ect.impo
│ │ │ │ +00000d80: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20  rt warni
│ │ │ │ +00000da0: 6e67 733c 2f73 7061 6e3e 0a3c 7370 616e  ngs.from
│ │ │ │ +00000dc0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   collect
│ │ │ │ +00000de0: 696f 6e73 3c2f 7370 616e 3e20 3c73 7061  ions imp
│ │ │ │ +00000e00: 6f72 743c 2f73 7061 6e3e 203c 7370 616e  ort defau
│ │ │ │ +00000e20: 6c74 6469 6374 3c2f 7370 616e 3e0a 3c73  ltdict.f
│ │ │ │ +00000e40: 726f 6d3c 2f73 7061 6e3e 203c 7370 616e  rom deci
│ │ │ │ +00000e60: 6d61 6c3c 2f73 7061 6e3e 203c 7370 616e  mal impo
│ │ │ │ +00000e80: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20  rt Decima
│ │ │ │ +00000ea0: 6c3c 2f73 7061 6e3e 0a3c 7370 616e 2063  l.from uuid import UUID..<
│ │ │ │ +00000f20: 7370 616e 2063 6c61 7373 3d22 6b6e 223e  span class="kn">
│ │ │ │ +00000f30: 6672 6f6d 3c2f 7370 616e 3e20 3c73 7061  from dja
│ │ │ │ +00000f50: 6e67 6f2e 636f 7265 2e65 7863 6570 7469  ngo.core.excepti
│ │ │ │ +00000f60: 6f6e 733c 2f73 7061 6e3e 203c 7370 616e  ons impo
│ │ │ │ +00000f80: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20  rt EmptyR
│ │ │ │ +00000fa0: 6573 756c 7453 6574 3c2f 7370 616e 3e3c  esultSet<
│ │ │ │ +00000fb0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00000fc0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   FieldErr
│ │ │ │ +00000fe0: 6f72 3c2f 7370 616e 3e3c 7370 616e 2063  or, FullResultSet<
│ │ │ │ +00001020: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.from django.db import DatabaseErr
│ │ │ │ +000010a0: 6f72 3c2f 7370 616e 3e3c 7370 616e 2063  or, NotSupportedEr
│ │ │ │ +000010e0: 726f 723c 2f73 7061 6e3e 3c73 7061 6e20  ror, connection.from django.db.mod
│ │ │ │ +00001160: 656c 733c 2f73 7061 6e3e 203c 7370 616e  els impo
│ │ │ │ +00001180: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20  rt fields
│ │ │ │ +000011a0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .from django.db.
│ │ │ │ +000011e0: 6d6f 6465 6c73 2e63 6f6e 7374 616e 7473  models.constants
│ │ │ │ +000011f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   import<
│ │ │ │ +00001210: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> LOOKUP_SE
│ │ │ │ +00001230: 503c 2f73 7061 6e3e 0a3c 7370 616e 2063  P.from django.db
│ │ │ │ +00001270: 2e6d 6f64 656c 732e 7175 6572 795f 7574  .models.query_ut
│ │ │ │ +00001280: 696c 733c 2f73 7061 6e3e 203c 7370 616e  ils impo
│ │ │ │ +000012a0: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20  rt Q.from 
│ │ │ │ +000012e0: 3c73 7061 6e20 636c 6173 733d 226e 6e22  django.utils.de
│ │ │ │ +00001300: 636f 6e73 7472 7563 743c 2f73 7061 6e3e  construct
│ │ │ │ +00001310: 203c 7370 616e 2063 6c61 7373 3d22 6b6e   import 
│ │ │ │ +00001330: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00001340: 6465 636f 6e73 7472 7563 7469 626c 653c  deconstructible<
│ │ │ │ +00001350: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.from django.util
│ │ │ │ +00001390: 732e 6465 7072 6563 6174 696f 6e3c 2f73  s.deprecation import RemovedInDja
│ │ │ │ +000013e0: 6e67 6f35 3057 6172 6e69 6e67 3c2f 7370  ngo50Warning.from
│ │ │ │ +00001410: 203c 7370 616e 2063 6c61 7373 3d22 6e6e   django.utils.f
│ │ │ │ +00001430: 756e 6374 696f 6e61 6c3c 2f73 7061 6e3e  unctional
│ │ │ │ +00001440: 203c 7370 616e 2063 6c61 7373 3d22 6b6e   import 
│ │ │ │ +00001460: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00001470: 6361 6368 6564 5f70 726f 7065 7274 793c  cached_property<
│ │ │ │ +00001480: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.from django.util
│ │ │ │ +000014c0: 732e 6861 7368 6162 6c65 3c2f 7370 616e  s.hashable import
│ │ │ │ +000014f0: 203c 7370 616e 2063 6c61 7373 3d22 6e22   make_hashable...class SQLiteNume
│ │ │ │ +00001550: 7269 634d 6978 696e 3c2f 7370 616e 3e3c  ricMixin<
│ │ │ │ +00001560: 7370 616e 2063 6c61 7373 3d22 7022 3e3a  span class="p">:
│ │ │ │ +00001570: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .    ""
│ │ │ │ +000015b0: 2671 756f 743b 3c2f 7370 616e 3e0a 3c73  ". 
│ │ │ │ +000015d0: 2020 2053 6f6d 6520 6578 7072 6573 7369     Some expressi
│ │ │ │ +000015e0: 6f6e 7320 7769 7468 206f 7574 7075 745f  ons with output_
│ │ │ │ +000015f0: 6669 656c 643d 4465 6369 6d61 6c46 6965  field=DecimalFie
│ │ │ │ +00001600: 6c64 2829 206d 7573 7420 6265 2063 6173  ld() must be cas
│ │ │ │ +00001610: 7420 746f 3c2f 7370 616e 3e0a 3c73 7061  t to.   
│ │ │ │ +00001630: 206e 756d 6572 6963 2074 6f20 6265 2070   numeric to be p
│ │ │ │ +00001640: 726f 7065 726c 7920 6669 6c74 6572 6564  roperly filtered
│ │ │ │ +00001650: 2e3c 2f73 7061 6e3e 0a3c 7370 616e 2063  ..    &q
│ │ │ │ +00001670: 756f 743b 2671 756f 743b 2671 756f 743b  uot;""
│ │ │ │ +00001680: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ +000016a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   as_sqli
│ │ │ │ +000016c0: 7465 3c2f 7370 616e 3e3c 7370 616e 2063  te(self, compiler, co
│ │ │ │ +00001760: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c  nnection<
│ │ │ │ +00001770: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00001780: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   **extra_context):. 
│ │ │ │ +000017e0: 2020 2020 2020 203c 7370 616e 2063 6c61         sql, params
│ │ │ │ +00001830: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   =
│ │ │ │ +00001850: 203c 7370 616e 2063 6c61 7373 3d22 6270   self.as_sql(compil
│ │ │ │ +000018d0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er, connection, **extra_conte
│ │ │ │ +00001960: 7874 3c2f 7370 616e 3e3c 7370 616e 2063  xt).        try:.   
│ │ │ │ +000019c0: 2020 2020 2020 2020 203c 7370 616e 2063           if self<
│ │ │ │ +00001a00: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ +00001a10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  output_fi
│ │ │ │ +00001a30: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20  eld.get_internal_t
│ │ │ │ +00001a70: 7970 653c 2f73 7061 6e3e 3c73 7061 6e20  ype() == &
│ │ │ │ +00001ac0: 7175 6f74 3b44 6563 696d 616c 4669 656c  quot;DecimalFiel
│ │ │ │ +00001ad0: 6426 7175 6f74 3b3c 2f73 7061 6e3e 3c73  d":<
│ │ │ │ +00001af0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ +00001b00: 2020 2020 2020 203c 7370 616e 2063 6c61         sql = &quo
│ │ │ │ +00001b50: 743b 4341 5354 283c 2f73 7061 6e3e 3c73  t;CAST(%
│ │ │ │ +00001b70: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s AS NUM
│ │ │ │ +00001b90: 4552 4943 2926 7175 6f74 3b3c 2f73 7061  ERIC)" % sql<
│ │ │ │ +00001bd0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ +00001be0: 7370 616e 2063 6c61 7373 3d22 6b22 3e65  span class="k">e
│ │ │ │ +00001bf0: 7863 6570 743c 2f73 7061 6e3e 203c 7370  xcept Fie
│ │ │ │ +00001c10: 6c64 4572 726f 723c 2f73 7061 6e3e 3c73  ldError:<
│ │ │ │ +00001c30: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ +00001c40: 2020 203c 7370 616e 2063 6c61 7373 3d22     pass. 
│ │ │ │ +00001c60: 2020 2020 2020 203c 7370 616e 2063 6c61         return sql<
│ │ │ │ +00001ca0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00001cb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   params...class Combinable
│ │ │ │ +00001d10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  :.
│ │ │ │ +00001d30: 3c73 7061 6e20 636c 6173 733d 2277 223e  
│ │ │ │ +00001d40: 2020 2020 3c2f 7370 616e 3e3c 7370 616e      &quo
│ │ │ │ +00001d60: 743b 2671 756f 743b 2671 756f 743b 3c2f  t;"".    Provi
│ │ │ │ +00001d90: 6465 2074 6865 2061 6269 6c69 7479 2074  de the ability t
│ │ │ │ +00001da0: 6f20 636f 6d62 696e 6520 6f6e 6520 6f72  o combine one or
│ │ │ │ +00001db0: 2074 776f 206f 626a 6563 7473 2077 6974   two objects wit
│ │ │ │ +00001dc0: 683c 2f73 7061 6e3e 0a3c 7370 616e 2063  h.    so
│ │ │ │ +00001de0: 6d65 2063 6f6e 6e65 6374 6f72 2e20 466f  me connector. Fo
│ │ │ │ +00001df0: 7220 6578 616d 706c 6520 4628 2623 3339  r example F('
│ │ │ │ +00001e00: 3b66 6f6f 2623 3339 3b29 202b 2046 2826  ;foo') + F(&
│ │ │ │ +00001e10: 2333 393b 6261 7226 2333 393b 292e 3c2f  #39;bar')..    "
│ │ │ │ +00001e40: 3b26 7175 6f74 3b26 7175 6f74 3b3c 2f73  ;""..    # Ari
│ │ │ │ +00001e70: 7468 6d65 7469 6320 636f 6e6e 6563 746f  thmetic connecto
│ │ │ │ +00001e80: 7273 3c2f 7370 616e 3e0a 2020 2020 3c73  rs.    AD
│ │ │ │ +00001ea0: 443c 2f73 7061 6e3e 203c 7370 616e 2063  D = "+"
│ │ │ │ +00001ee0: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061  .    SUB<
│ │ │ │ +00001f00: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> = 
│ │ │ │ +00001f20: 3c73 7061 6e20 636c 6173 733d 2273 3222  "-".    MUL = &
│ │ │ │ +00001f90: 7175 6f74 3b2a 2671 756f 743b 3c2f 7370  quot;*".    DIV = &qu
│ │ │ │ +00001ff0: 6f74 3b2f 2671 756f 743b 3c2f 7370 616e  ot;/".    POW
│ │ │ │ +00002020: 203c 7370 616e 2063 6c61 7373 3d22 6f22   = "
│ │ │ │ +00002050: 3b5e 2671 756f 743b 3c2f 7370 616e 3e0a  ;^".
│ │ │ │ +00002060: 2020 2020 3c73 7061 6e20 636c 6173 733d      # The follo
│ │ │ │ +00002080: 7769 6e67 2069 7320 6120 7175 6f74 6564  wing is a quoted
│ │ │ │ +00002090: 2025 206f 7065 7261 746f 7220 2d20 6974   % operator - it
│ │ │ │ +000020a0: 2069 7320 7175 6f74 6564 2062 6563 6175   is quoted becau
│ │ │ │ +000020b0: 7365 2069 7420 6361 6e20 6265 3c2f 7370  se it can be.    # used 
│ │ │ │ +000020e0: 696e 2073 7472 696e 6773 2074 6861 7420  in strings that 
│ │ │ │ +000020f0: 616c 736f 2068 6176 6520 7061 7261 6d65  also have parame
│ │ │ │ +00002100: 7465 7220 7375 6273 7469 7475 7469 6f6e  ter substitution
│ │ │ │ +00002110: 2e3c 2f73 7061 6e3e 0a20 2020 203c 7370  ..    MOD
│ │ │ │ +00002130: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   =
│ │ │ │ +00002150: 203c 7370 616e 2063 6c61 7373 3d22 7332   "<
│ │ │ │ +00002170: 7370 616e 2063 6c61 7373 3d22 7369 223e  span class="si">
│ │ │ │ +00002180: 2525 3c2f 7370 616e 3e3c 7370 616e 2063  %%"
│ │ │ │ +000021a0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    # 
│ │ │ │ +000021c0: 4269 7477 6973 6520 6f70 6572 6174 6f72  Bitwise operator
│ │ │ │ +000021d0: 7320 2d20 6e6f 7465 2074 6861 7420 7468  s - note that th
│ │ │ │ +000021e0: 6573 6520 6172 6520 6765 6e65 7261 7465  ese are generate
│ │ │ │ +000021f0: 6420 6279 202e 6269 7461 6e64 2829 3c2f  d by .bitand().    # and
│ │ │ │ +00002220: 202e 6269 746f 7228 292c 2074 6865 2026   .bitor(), the &
│ │ │ │ +00002230: 2333 393b 2661 6d70 3b26 2333 393b 2061  #39;&' a
│ │ │ │ +00002240: 6e64 2026 2333 393b 7c26 2333 393b 2061  nd '|' a
│ │ │ │ +00002250: 7265 2072 6573 6572 7665 6420 666f 7220  re reserved for 
│ │ │ │ +00002260: 626f 6f6c 6561 6e20 6f70 6572 6174 6f72  boolean operator
│ │ │ │ +00002270: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061  .    # u
│ │ │ │ +00002290: 7361 6765 2e3c 2f73 7061 6e3e 0a20 2020  sage..   
│ │ │ │ +000022a0: 203c 7370 616e 2063 6c61 7373 3d22 6e22   BITAND <
│ │ │ │ +000022c0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d  span class="o">=
│ │ │ │ +000022d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   "&
│ │ │ │ +000022f0: 616d 703b 2671 756f 743b 3c2f 7370 616e  amp;".    BITOR = &qu
│ │ │ │ +00002350: 6f74 3b7c 2671 756f 743b 3c2f 7370 616e  ot;|".    BITLEFTSHI
│ │ │ │ +00002380: 4654 3c2f 7370 616e 3e20 3c73 7061 6e20  FT = "<&l
│ │ │ │ +000023c0: 743b 2671 756f 743b 3c2f 7370 616e 3e0a  t;".
│ │ │ │ +000023d0: 2020 2020 3c73 7061 6e20 636c 6173 733d      BITRIGHTSHIF
│ │ │ │ +000023f0: 543c 2f73 7061 6e3e 203c 7370 616e 2063  T = ">>
│ │ │ │ +00002430: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 0a20  ;". 
│ │ │ │ +00002440: 2020 203c 7370 616e 2063 6c61 7373 3d22     BITXOR
│ │ │ │ +00002460: 203c 7370 616e 2063 6c61 7373 3d22 6f22   = "
│ │ │ │ +00002490: 3b23 2671 756f 743b 3c2f 7370 616e 3e0a  ;#".
│ │ │ │ +000024a0: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ +000024c0: 3c73 7061 6e20 636c 6173 733d 226e 6622  _combine
│ │ │ │ +000024e0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +000024f0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self, oth
│ │ │ │ +00002540: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er, connector, reve
│ │ │ │ +000025b0: 7273 6564 3c2f 7370 616e 3e3c 7370 616e  rsed):.        if<
│ │ │ │ +000025f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> not hasattr(other<
│ │ │ │ +00002660: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ +00002680: 7370 616e 2063 6c61 7373 3d22 7332 223e  span class="s2">
│ │ │ │ +00002690: 2671 756f 743b 7265 736f 6c76 655f 6578  "resolve_ex
│ │ │ │ +000026a0: 7072 6573 7369 6f6e 2671 756f 743b 3c2f  pression"):. 
│ │ │ │ +000026d0: 2020 2020 2020 2020 2020 203c 7370 616e             # ev
│ │ │ │ +000026f0: 6572 7974 6869 6e67 206d 7573 7420 6265  erything must be
│ │ │ │ +00002700: 2072 6573 6f6c 7661 626c 6520 746f 2061   resolvable to a
│ │ │ │ +00002710: 6e20 6578 7072 6573 7369 6f6e 3c2f 7370  n expression.            
│ │ │ │ +00002730: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00002740: 6f74 6865 723c 2f73 7061 6e3e 203c 7370  other = Value(other<
│ │ │ │ +000027b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>)..
│ │ │ │ +000027d0: 2020 2020 2020 2020 3c73 7061 6e20 636c          if reversed:.     
│ │ │ │ +00002830: 2020 2020 2020 203c 7370 616e 2063 6c61         return CombinedExp
│ │ │ │ +00002870: 7265 7373 696f 6e3c 2f73 7061 6e3e 3c73  ression(<
│ │ │ │ +00002890: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>other, conne
│ │ │ │ +000028e0: 6374 6f72 3c2f 7370 616e 3e3c 7370 616e  ctor, self
│ │ │ │ +00002920: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00002930: 293c 2f73 7061 6e3e 0a20 2020 2020 2020  ).       
│ │ │ │ +00002940: 203c 7370 616e 2063 6c61 7373 3d22 6b22   return <
│ │ │ │ +00002960: 7370 616e 2063 6c61 7373 3d22 6e22 3e43  span class="n">C
│ │ │ │ +00002970: 6f6d 6269 6e65 6445 7870 7265 7373 696f  ombinedExpressio
│ │ │ │ +00002980: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  n(
│ │ │ │ +000029a0: 3c73 7061 6e20 636c 6173 733d 2262 7022  self, connector, ot
│ │ │ │ +00002a20: 6865 723c 2f73 7061 6e3e 3c73 7061 6e20  her)..    #######
│ │ │ │ +00002a60: 2323 2323 2323 3c2f 7370 616e 3e0a 2020  ######.  
│ │ │ │ +00002a70: 2020 3c73 7061 6e20 636c 6173 733d 2263    # OPERATORS #
│ │ │ │ +00002a90: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061  .    ###
│ │ │ │ +00002ab0: 2323 2323 2323 2323 2323 3c2f 7370 616e  ##########..    def __neg__(self):. 
│ │ │ │ +00002b50: 2020 2020 2020 203c 7370 616e 2063 6c61         return self._combin
│ │ │ │ +00002bc0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e(
│ │ │ │ +00002be0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +00002bf0: 2d3c 2f73 7061 6e3e 3c73 7061 6e20 636c  -1, self<
│ │ │ │ +00002c40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>.MU
│ │ │ │ +00002c70: 4c3c 2f73 7061 6e3e 3c73 7061 6e20 636c  L,
│ │ │ │ +00002c90: 203c 7370 616e 2063 6c61 7373 3d22 6b63   False)<
│ │ │ │ +00002cc0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061  /span>..    def<
│ │ │ │ +00002ce0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> __add__<
│ │ │ │ +00002d00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(s
│ │ │ │ +00002d30: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf, other<
│ │ │ │ +00002d70: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ +00002d80: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ +00002d90: 203c 7370 616e 2063 6c61 7373 3d22 6b22   return <
│ │ │ │ +00002db0: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +00002dc0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self._combine(other<
│ │ │ │ +00002e30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ +00002e50: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +00002e60: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self.ADD, False)..   
│ │ │ │ +00002ef0: 203c 7370 616e 2063 6c61 7373 3d22 6b22   def __s
│ │ │ │ +00002f20: 7562 5f5f 3c2f 7370 616e 3e3c 7370 616e  ub__(self<
│ │ │ │ +00002f60: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00002f70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   other):.  
│ │ │ │ +00002fb0: 2020 2020 2020 3c73 7061 6e20 636c 6173        return self
│ │ │ │ +00002ff0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +00003000: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  ._combine
│ │ │ │ +00003020: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +00003040: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f  span class="n">o
│ │ │ │ +00003050: 7468 6572 3c2f 7370 616e 3e3c 7370 616e  ther, self
│ │ │ │ +00003090: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +000030a0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .SUB, Fals
│ │ │ │ +000030f0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e)
│ │ │ │ +00003110: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    def
│ │ │ │ +00003130: 203c 7370 616e 2063 6c61 7373 3d22 666d   __mul__
│ │ │ │ +00003150: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00003160: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self, oth
│ │ │ │ +000031b0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er):.        retur
│ │ │ │ +000031f0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n self._co
│ │ │ │ +00003240: 6d62 696e 653c 2f73 7061 6e3e 3c73 7061  mbine(other
│ │ │ │ +00003280: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00003290: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , self.MUL
│ │ │ │ +000032e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ +00003300: 3c73 7061 6e20 636c 6173 733d 226b 6322  False)..    def __truediv
│ │ │ │ +00003370: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063  __(self, other):.    
│ │ │ │ +00003400: 2020 2020 3c73 7061 6e20 636c 6173 733d      return self.<
│ │ │ │ +00003450: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>_combine(oth
│ │ │ │ +000034a0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er, self.<
│ │ │ │ +000034f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>DIV
│ │ │ │ +00003510: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00003520: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , False<
│ │ │ │ +00003540: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>)..
│ │ │ │ +00003560: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ +00003580: 7370 616e 2063 6c61 7373 3d22 666d 223e  span class="fm">
│ │ │ │ +00003590: 5f5f 6d6f 645f 5f3c 2f73 7061 6e3e 3c73  __mod__(<
│ │ │ │ +000035b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self, other
│ │ │ │ +00003600: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ +00003620: 0a20 2020 2020 2020 203c 7370 616e 2063  .        return<
│ │ │ │ +00003640: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self._comb
│ │ │ │ +00003690: 696e 653c 2f73 7061 6e3e 3c73 7061 6e20  ine(other,<
│ │ │ │ +000036e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self.MOD, F
│ │ │ │ +00003760: 616c 7365 3c2f 7370 616e 3e3c 7370 616e  alse)..    def __pow__(self
│ │ │ │ +000037f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ +00003810: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00003820: 6f74 6865 723c 2f73 7061 6e3e 3c73 7061  other):.        re
│ │ │ │ +00003860: 7475 726e 3c2f 7370 616e 3e20 3c73 7061  turn sel
│ │ │ │ +00003880: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ +000038a0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +000038b0: 5f63 6f6d 6269 6e65 3c2f 7370 616e 3e3c  _combine<
│ │ │ │ +000038c0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +000038d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  other, sel
│ │ │ │ +00003920: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ +00003940: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00003950: 504f 573c 2f73 7061 6e3e 3c73 7061 6e20  POW, False
│ │ │ │ +00003990: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +000039a0: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73  )..    de
│ │ │ │ +000039c0: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f __and_
│ │ │ │ +000039e0: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c  _(
│ │ │ │ +00003a00: 3c73 7061 6e20 636c 6173 733d 2262 7022  self, other):.     
│ │ │ │ +00003a70: 2020 203c 7370 616e 2063 6c61 7373 3d22     if ge
│ │ │ │ +00003aa0: 7461 7474 723c 2f73 7061 6e3e 3c73 7061  tattr(self
│ │ │ │ +00003ae0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00003af0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , "
│ │ │ │ +00003b10: 636f 6e64 6974 696f 6e61 6c26 7175 6f74  conditional"
│ │ │ │ +00003b20: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c  ;,
│ │ │ │ +00003b40: 203c 7370 616e 2063 6c61 7373 3d22 6b63   False)<
│ │ │ │ +00003b70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> and getattr(other<
│ │ │ │ +00003be0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ +00003c00: 7370 616e 2063 6c61 7373 3d22 7332 223e  span class="s2">
│ │ │ │ +00003c10: 2671 756f 743b 636f 6e64 6974 696f 6e61  "conditiona
│ │ │ │ +00003c20: 6c26 7175 6f74 3b3c 2f73 7061 6e3e 3c73  l",<
│ │ │ │ +00003c40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> False):.  
│ │ │ │ +00003c80: 2020 2020 2020 2020 2020 3c73 7061 6e20            return
│ │ │ │ +00003ca0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   Q
│ │ │ │ +00003cc0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00003cd0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self) &am
│ │ │ │ +00003d20: 703b 3c2f 7370 616e 3e20 3c73 7061 6e20  p; Q(other<
│ │ │ │ +00003d70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>). 
│ │ │ │ +00003d90: 2020 2020 2020 203c 7370 616e 2063 6c61         raise NotImplemen
│ │ │ │ +00003dd0: 7465 6445 7272 6f72 3c2f 7370 616e 3e3c  tedError<
│ │ │ │ +00003de0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +00003df0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +00003e00: 2020 2020 3c73 7061 6e20 636c 6173 733d      "Use .
│ │ │ │ +00003e20: 6269 7461 6e64 2829 2c20 2e62 6974 6f72  bitand(), .bitor
│ │ │ │ +00003e30: 2829 2c20 616e 6420 2e62 6974 786f 7228  (), and .bitxor(
│ │ │ │ +00003e40: 2920 666f 7220 6269 7477 6973 6520 6c6f  ) for bitwise lo
│ │ │ │ +00003e50: 6769 6361 6c20 6f70 6572 6174 696f 6e73  gical operations
│ │ │ │ +00003e60: 2e26 7175 6f74 3b3c 2f73 7061 6e3e 0a20  .". 
│ │ │ │ +00003e70: 2020 2020 2020 203c 7370 616e 2063 6c61         ).
│ │ │ │ +00003e90: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ +00003eb0: 3c73 7061 6e20 636c 6173 733d 226e 6622  bitand(<
│ │ │ │ +00003ee0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self, other
│ │ │ │ +00003f30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ +00003f50: 0a20 2020 2020 2020 203c 7370 616e 2063  .        return<
│ │ │ │ +00003f70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self._comb
│ │ │ │ +00003fc0: 696e 653c 2f73 7061 6e3e 3c73 7061 6e20  ine(other,<
│ │ │ │ +00004010: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self.BITAN
│ │ │ │ +00004060: 443c 2f73 7061 6e3e 3c73 7061 6e20 636c  D,
│ │ │ │ +00004080: 203c 7370 616e 2063 6c61 7373 3d22 6b63   False)<
│ │ │ │ +000040b0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061  /span>..    def<
│ │ │ │ +000040d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> bitlefts
│ │ │ │ +000040f0: 6869 6674 3c2f 7370 616e 3e3c 7370 616e  hift(self<
│ │ │ │ +00004130: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00004140: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   other):.  
│ │ │ │ +00004180: 2020 2020 2020 3c73 7061 6e20 636c 6173        return self
│ │ │ │ +000041c0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +000041d0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  ._combine
│ │ │ │ +000041f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +00004210: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f  span class="n">o
│ │ │ │ +00004220: 7468 6572 3c2f 7370 616e 3e3c 7370 616e  ther, self
│ │ │ │ +00004260: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +00004270: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .BITLEFTS
│ │ │ │ +00004290: 4849 4654 3c2f 7370 616e 3e3c 7370 616e  HIFT, False)..    <
│ │ │ │ +000042f0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64  span class="k">d
│ │ │ │ +00004300: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20  ef bitri
│ │ │ │ +00004320: 6768 7473 6869 6674 3c2f 7370 616e 3e3c  ghtshift<
│ │ │ │ +00004330: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +00004340: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self, othe
│ │ │ │ +00004390: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r):.        return
│ │ │ │ +000043d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   self._com
│ │ │ │ +00004420: 6269 6e65 3c2f 7370 616e 3e3c 7370 616e  bine(other<
│ │ │ │ +00004460: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00004470: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   self.BITR
│ │ │ │ +000044c0: 4947 4854 5348 4946 543c 2f73 7061 6e3e  IGHTSHIFT
│ │ │ │ +000044d0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +000044e0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , False<
│ │ │ │ +00004500: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>)..
│ │ │ │ +00004520: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ +00004540: 7370 616e 2063 6c61 7373 3d22 666d 223e  span class="fm">
│ │ │ │ +00004550: 5f5f 786f 725f 5f3c 2f73 7061 6e3e 3c73  __xor__(<
│ │ │ │ +00004570: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self, other
│ │ │ │ +000045c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ +000045e0: 0a20 2020 2020 2020 203c 7370 616e 2063  .        if getattr(self<
│ │ │ │ +00004650: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ +00004670: 7370 616e 2063 6c61 7373 3d22 7332 223e  span class="s2">
│ │ │ │ +00004680: 2671 756f 743b 636f 6e64 6974 696f 6e61  "conditiona
│ │ │ │ +00004690: 6c26 7175 6f74 3b3c 2f73 7061 6e3e 3c73  l",<
│ │ │ │ +000046b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> False) an
│ │ │ │ +00004700: 643c 2f73 7061 6e3e 203c 7370 616e 2063  d getatt
│ │ │ │ +00004720: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r(
│ │ │ │ +00004740: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00004750: 6f74 6865 723c 2f73 7061 6e3e 3c73 7061  other, "cond
│ │ │ │ +00004790: 6974 696f 6e61 6c26 7175 6f74 3b3c 2f73  itional", Fa
│ │ │ │ +000047d0: 6c73 653c 2f73 7061 6e3e 3c73 7061 6e20  lse):.            
│ │ │ │ +00004800: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +00004810: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return Q<
│ │ │ │ +00004830: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(s
│ │ │ │ +00004860: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf) ^ Q(othe
│ │ │ │ +000048e0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r)
│ │ │ │ +00004900: 0a20 2020 2020 2020 203c 7370 616e 2063  .        raise NotImplem
│ │ │ │ +00004940: 656e 7465 6445 7272 6f72 3c2f 7370 616e  entedError(.      
│ │ │ │ +00004970: 2020 2020 2020 3c73 7061 6e20 636c 6173        "Use
│ │ │ │ +00004990: 202e 6269 7461 6e64 2829 2c20 2e62 6974   .bitand(), .bit
│ │ │ │ +000049a0: 6f72 2829 2c20 616e 6420 2e62 6974 786f  or(), and .bitxo
│ │ │ │ +000049b0: 7228 2920 666f 7220 6269 7477 6973 6520  r() for bitwise 
│ │ │ │ +000049c0: 6c6f 6769 6361 6c20 6f70 6572 6174 696f  logical operatio
│ │ │ │ +000049d0: 6e73 2e26 7175 6f74 3b3c 2f73 7061 6e3e  ns."
│ │ │ │ +000049e0: 0a20 2020 2020 2020 203c 7370 616e 2063  .        )..    def bitxor
│ │ │ │ +00004a40: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00004a50: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self, oth
│ │ │ │ +00004aa0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er):.        retur
│ │ │ │ +00004ae0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n self._co
│ │ │ │ +00004b30: 6d62 696e 653c 2f73 7061 6e3e 3c73 7061  mbine(other
│ │ │ │ +00004b70: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00004b80: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , self.BIT
│ │ │ │ +00004bd0: 584f 523c 2f73 7061 6e3e 3c73 7061 6e20  XOR, False
│ │ │ │  00004c10: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00004c20: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self, oth
│ │ │ │ -00004c70: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er):.        if getattr(sel
│ │ │ │ -00004d00: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f,
│ │ │ │ -00004d20: 203c 7370 616e 2063 6c61 7373 3d22 7332   "conditio
│ │ │ │ -00004d40: 6e61 6c26 7175 6f74 3b3c 2f73 7061 6e3e  nal"
│ │ │ │ -00004d50: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00004d60: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , False<
│ │ │ │ -00004d80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>) <
│ │ │ │ -00004da0: 7370 616e 2063 6c61 7373 3d22 6f77 223e  span class="ow">
│ │ │ │ -00004db0: 616e 643c 2f73 7061 6e3e 203c 7370 616e  and geta
│ │ │ │ -00004dd0: 7474 723c 2f73 7061 6e3e 3c73 7061 6e20  ttr(other,<
│ │ │ │ -00004e20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> "co
│ │ │ │ -00004e40: 6e64 6974 696f 6e61 6c26 7175 6f74 3b3c  nditional"<
│ │ │ │ -00004e50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -00004e70: 7370 616e 2063 6c61 7373 3d22 6b63 223e  span class="kc">
│ │ │ │ -00004e80: 4661 6c73 653c 2f73 7061 6e3e 3c73 7061  False):.          
│ │ │ │ -00004eb0: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ -00004ed0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00004ee0: 513c 2f73 7061 6e3e 3c73 7061 6e20 636c  Q(
│ │ │ │ -00004f00: 3c73 7061 6e20 636c 6173 733d 2262 7022  self) | Q<
│ │ │ │ -00004f60: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(ot
│ │ │ │ -00004f90: 6865 723c 2f73 7061 6e3e 3c73 7061 6e20  her).        raise
│ │ │ │ -00004fd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   NotImpl
│ │ │ │ -00004ff0: 656d 656e 7465 6445 7272 6f72 3c2f 7370  ementedError(.    
│ │ │ │ -00005020: 2020 2020 2020 2020 3c73 7061 6e20 636c          "U
│ │ │ │ -00005040: 7365 202e 6269 7461 6e64 2829 2c20 2e62  se .bitand(), .b
│ │ │ │ -00005050: 6974 6f72 2829 2c20 616e 6420 2e62 6974  itor(), and .bit
│ │ │ │ -00005060: 786f 7228 2920 666f 7220 6269 7477 6973  xor() for bitwis
│ │ │ │ -00005070: 6520 6c6f 6769 6361 6c20 6f70 6572 6174  e logical operat
│ │ │ │ -00005080: 696f 6e73 2e26 7175 6f74 3b3c 2f73 7061  ions.".        )..    def bitor(self, ot
│ │ │ │ -00005150: 6865 723c 2f73 7061 6e3e 3c73 7061 6e20  her):.        retu
│ │ │ │ -00005190: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20  rn self<
│ │ │ │ -000051b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>._c
│ │ │ │ -000051e0: 6f6d 6269 6e65 3c2f 7370 616e 3e3c 7370  ombine(other, self<
│ │ │ │ -00005250: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>.BI
│ │ │ │ -00005280: 544f 523c 2f73 7061 6e3e 3c73 7061 6e20  TOR, False
│ │ │ │ -000052c0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -000052d0: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73  )..    de
│ │ │ │ -000052f0: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f __radd
│ │ │ │ -00005310: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063  __(self, other):.    
│ │ │ │ -000053a0: 2020 2020 3c73 7061 6e20 636c 6173 733d      return self.<
│ │ │ │ -000053f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>_combine(oth
│ │ │ │ -00005440: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er, self.<
│ │ │ │ -00005490: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>ADD
│ │ │ │ -000054b0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -000054c0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , True).. 
│ │ │ │ -00005500: 2020 203c 7370 616e 2063 6c61 7373 3d22     def _
│ │ │ │ -00005530: 5f72 7375 625f 5f3c 2f73 7061 6e3e 3c73  _rsub__(<
│ │ │ │ -00005550: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self, other
│ │ │ │ -000055a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ -000055c0: 0a20 2020 2020 2020 203c 7370 616e 2063  .        return<
│ │ │ │ -000055e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self._comb
│ │ │ │ -00005630: 696e 653c 2f73 7061 6e3e 3c73 7061 6e20  ine(other,<
│ │ │ │ -00005680: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self.SUB, T
│ │ │ │ -00005700: 7275 653c 2f73 7061 6e3e 3c73 7061 6e20  rue)..    def __rmul__(self
│ │ │ │ -00005790: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ -000057b0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -000057c0: 6f74 6865 723c 2f73 7061 6e3e 3c73 7061  other):.        re
│ │ │ │ -00005800: 7475 726e 3c2f 7370 616e 3e20 3c73 7061  turn sel
│ │ │ │ -00005820: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ -00005840: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00005850: 5f63 6f6d 6269 6e65 3c2f 7370 616e 3e3c  _combine<
│ │ │ │ -00005860: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ -00005870: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  other, sel
│ │ │ │ -000058c0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ -000058e0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -000058f0: 4d55 4c3c 2f73 7061 6e3e 3c73 7061 6e20  MUL, True<
│ │ │ │ -00005930: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -00005940: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ -00005960: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   __rtrue
│ │ │ │ -00005980: 6469 765f 5f3c 2f73 7061 6e3e 3c73 7061  div__(self
│ │ │ │ -000059c0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -000059d0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , other):. 
│ │ │ │ -00005a10: 2020 2020 2020 203c 7370 616e 2063 6c61         return self._combin
│ │ │ │ -00005a80: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e(
│ │ │ │ -00005aa0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00005ab0: 6f74 6865 723c 2f73 7061 6e3e 3c73 7061  other, self.DIV, Tru
│ │ │ │ -00005b50: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e)
│ │ │ │ -00005b70: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    def
│ │ │ │ -00005b90: 203c 7370 616e 2063 6c61 7373 3d22 666d   __rmod__(self, ot
│ │ │ │ -00005c10: 6865 723c 2f73 7061 6e3e 3c73 7061 6e20  her):.        retu
│ │ │ │ -00005c50: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20  rn self<
│ │ │ │ -00005c70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>._c
│ │ │ │ -00005ca0: 6f6d 6269 6e65 3c2f 7370 616e 3e3c 7370  ombine(other, self<
│ │ │ │ -00005d10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>.MO
│ │ │ │ -00005d40: 443c 2f73 7061 6e3e 3c73 7061 6e20 636c  D,
│ │ │ │ -00005d60: 203c 7370 616e 2063 6c61 7373 3d22 6b63   True)..    def __rpow__<
│ │ │ │ -00005dd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(s
│ │ │ │ -00005e00: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf, other<
│ │ │ │ -00005e40: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -00005e50: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ -00005e60: 203c 7370 616e 2063 6c61 7373 3d22 6b22   return <
│ │ │ │ -00005e80: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -00005e90: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self._combine(other<
│ │ │ │ -00005f00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -00005f20: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -00005f30: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self.POW, True)..    
│ │ │ │ -00005fc0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -00005fd0: 6465 663c 2f73 7061 6e3e 203c 7370 616e  def __ra
│ │ │ │ -00005ff0: 6e64 5f5f 3c2f 7370 616e 3e3c 7370 616e  nd__(self<
│ │ │ │ -00006030: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ -00006040: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   other):.  
│ │ │ │ -00006080: 2020 2020 2020 3c73 7061 6e20 636c 6173        raise NotImplement
│ │ │ │ -000060c0: 6564 4572 726f 723c 2f73 7061 6e3e 3c73  edError(<
│ │ │ │ -000060e0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ -000060f0: 2020 203c 7370 616e 2063 6c61 7373 3d22     "Use .b
│ │ │ │ -00006110: 6974 616e 6428 292c 202e 6269 746f 7228  itand(), .bitor(
│ │ │ │ -00006120: 292c 2061 6e64 202e 6269 7478 6f72 2829  ), and .bitxor()
│ │ │ │ -00006130: 2066 6f72 2062 6974 7769 7365 206c 6f67   for bitwise log
│ │ │ │ -00006140: 6963 616c 206f 7065 7261 7469 6f6e 732e  ical operations.
│ │ │ │ -00006150: 2671 756f 743b 3c2f 7370 616e 3e0a 2020  ".  
│ │ │ │ -00006160: 2020 2020 2020 3c73 7061 6e20 636c 6173        )..
│ │ │ │ -00006180: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ -000061a0: 7370 616e 2063 6c61 7373 3d22 666d 223e  span class="fm">
│ │ │ │ -000061b0: 5f5f 726f 725f 5f3c 2f73 7061 6e3e 3c73  __ror__(<
│ │ │ │ -000061d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self, other
│ │ │ │ -00006220: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ -00006240: 0a20 2020 2020 2020 203c 7370 616e 2063  .        raise NotImplem
│ │ │ │ -00006280: 656e 7465 6445 7272 6f72 3c2f 7370 616e  entedError(.      
│ │ │ │ -000062b0: 2020 2020 2020 3c73 7061 6e20 636c 6173        "Use
│ │ │ │ -000062d0: 202e 6269 7461 6e64 2829 2c20 2e62 6974   .bitand(), .bit
│ │ │ │ -000062e0: 6f72 2829 2c20 616e 6420 2e62 6974 786f  or(), and .bitxo
│ │ │ │ -000062f0: 7228 2920 666f 7220 6269 7477 6973 6520  r() for bitwise 
│ │ │ │ -00006300: 6c6f 6769 6361 6c20 6f70 6572 6174 696f  logical operatio
│ │ │ │ -00006310: 6e73 2e26 7175 6f74 3b3c 2f73 7061 6e3e  ns."
│ │ │ │ -00006320: 0a20 2020 2020 2020 203c 7370 616e 2063  .        )..    def __rxor__(self<
│ │ │ │ -000063b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -000063d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f  span class="n">o
│ │ │ │ -000063e0: 7468 6572 3c2f 7370 616e 3e3c 7370 616e  ther):.        rai
│ │ │ │ -00006420: 7365 3c2f 7370 616e 3e20 3c73 7061 6e20  se NotIm
│ │ │ │ -00006440: 706c 656d 656e 7465 6445 7272 6f72 3c2f  plementedError(.  
│ │ │ │ -00006470: 2020 2020 2020 2020 2020 3c73 7061 6e20            "
│ │ │ │ -00006490: 3b55 7365 202e 6269 7461 6e64 2829 2c20  ;Use .bitand(), 
│ │ │ │ -000064a0: 2e62 6974 6f72 2829 2c20 616e 6420 2e62  .bitor(), and .b
│ │ │ │ -000064b0: 6974 786f 7228 2920 666f 7220 6269 7477  itxor() for bitw
│ │ │ │ -000064c0: 6973 6520 6c6f 6769 6361 6c20 6f70 6572  ise logical oper
│ │ │ │ -000064d0: 6174 696f 6e73 2e26 7175 6f74 3b3c 2f73  ations.".        )..    def __invert_
│ │ │ │ -00006540: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c  _(
│ │ │ │ -00006560: 3c73 7061 6e20 636c 6173 733d 2262 7022  self):.        re
│ │ │ │ -000065b0: 7475 726e 3c2f 7370 616e 3e20 3c73 7061  turn Nega
│ │ │ │ -000065d0: 7465 6445 7870 7265 7373 696f 6e3c 2f73  tedExpression(sel
│ │ │ │ -00006610: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f)
│ │ │ │ -00006630: 0a0a 0a3c 7370 616e 2063 6c61 7373 3d22  ...class 
│ │ │ │ -00006650: 3c73 7061 6e20 636c 6173 733d 226e 6322  BaseExpression<
│ │ │ │ -00006670: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>:.<
│ │ │ │ -00006690: 7370 616e 2063 6c61 7373 3d22 7722 3e20  span class="w"> 
│ │ │ │ -000066a0: 2020 203c 2f73 7061 6e3e 3c73 7061 6e20     "
│ │ │ │ -000066c0: 3b26 7175 6f74 3b26 7175 6f74 3b42 6173  ;""Bas
│ │ │ │ -000066d0: 6520 636c 6173 7320 666f 7220 616c 6c20  e class for all 
│ │ │ │ -000066e0: 7175 6572 7920 6578 7072 6573 7369 6f6e  query expression
│ │ │ │ -000066f0: 732e 2671 756f 743b 2671 756f 743b 2671  s.""&q
│ │ │ │ -00006700: 756f 743b 3c2f 7370 616e 3e0a 0a20 2020  uot;..   
│ │ │ │ -00006710: 203c 7370 616e 2063 6c61 7373 3d22 6e22   empty_result_se
│ │ │ │ -00006730: 745f 7661 6c75 653c 2f73 7061 6e3e 203c  t_value <
│ │ │ │ -00006740: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d  span class="o">=
│ │ │ │ -00006750: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   NotImpl
│ │ │ │ -00006770: 656d 656e 7465 643c 2f73 7061 6e3e 0a20  emented. 
│ │ │ │ -00006780: 2020 203c 7370 616e 2063 6c61 7373 3d22     # aggregate 
│ │ │ │ -000067a0: 7370 6563 6966 6963 2066 6965 6c64 733c  specific fields<
│ │ │ │ -000067b0: 2f73 7061 6e3e 0a20 2020 203c 7370 616e  /span>.    is_su
│ │ │ │ -000067d0: 6d6d 6172 793c 2f73 7061 6e3e 203c 7370  mmary = False.    _output_
│ │ │ │ -00006830: 6669 656c 645f 7265 736f 6c76 6564 5f74  field_resolved_t
│ │ │ │ -00006840: 6f5f 6e6f 6e65 3c2f 7370 616e 3e20 3c73  o_none =<
│ │ │ │ -00006860: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> False.    # Can 
│ │ │ │ -000068a0: 7468 6520 6578 7072 6573 7369 6f6e 2062  the expression b
│ │ │ │ -000068b0: 6520 7573 6564 2069 6e20 6120 5748 4552  e used in a WHER
│ │ │ │ -000068c0: 4520 636c 6175 7365 3f3c 2f73 7061 6e3e  E clause?
│ │ │ │ -000068d0: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    filterable<
│ │ │ │ -000068f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> = 
│ │ │ │ -00006910: 3c73 7061 6e20 636c 6173 733d 226b 6322  True.   
│ │ │ │ -00006930: 203c 7370 616e 2063 6c61 7373 3d22 6331   # Can the expr
│ │ │ │ -00006950: 6573 7369 6f6e 2063 616e 2062 6520 7573  ession can be us
│ │ │ │ -00006960: 6564 2061 7320 6120 736f 7572 6365 2065  ed as a source e
│ │ │ │ -00006970: 7870 7265 7373 696f 6e20 696e 2057 696e  xpression in Win
│ │ │ │ -00006980: 646f 773f 3c2f 7370 616e 3e0a 2020 2020  dow?.    
│ │ │ │ -00006990: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -000069a0: 7769 6e64 6f77 5f63 6f6d 7061 7469 626c  window_compatibl
│ │ │ │ -000069b0: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e = False.
│ │ │ │ -000069f0: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ -00006a10: 3c73 7061 6e20 636c 6173 733d 2266 6d22  __init__
│ │ │ │ -00006a30: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00006a40: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self, out
│ │ │ │ -00006a90: 7075 745f 6669 656c 643c 2f73 7061 6e3e  put_field
│ │ │ │ -00006aa0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ -00006ab0: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c  =None):.  
│ │ │ │ -00006af0: 2020 2020 2020 3c73 7061 6e20 636c 6173        if 
│ │ │ │ -00006b10: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00006b20: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370  output_field is <
│ │ │ │ -00006b50: 7370 616e 2063 6c61 7373 3d22 6f77 223e  span class="ow">
│ │ │ │ -00006b60: 6e6f 743c 2f73 7061 6e3e 203c 7370 616e  not None
│ │ │ │ -00006b80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  :.
│ │ │ │ -00006ba0: 2020 2020 2020 2020 2020 2020 3c73 7061              sel
│ │ │ │ -00006bc0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ -00006be0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00006bf0: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370  output_field = out
│ │ │ │ -00006c30: 7075 745f 6669 656c 643c 2f73 7061 6e3e  put_field
│ │ │ │ -00006c40: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    def
│ │ │ │ -00006c60: 203c 7370 616e 2063 6c61 7373 3d22 6e66   __getstate__(se
│ │ │ │ -00006cb0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf):.        state
│ │ │ │ -00006cf0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   =
│ │ │ │ -00006d10: 203c 7370 616e 2063 6c61 7373 3d22 6270   self.__dict__.cop
│ │ │ │ -00006d90: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c  y().        state<
│ │ │ │ -00006dd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>.po
│ │ │ │ -00006e00: 703c 2f73 7061 6e3e 3c73 7061 6e20 636c  p(
│ │ │ │ -00006e20: 3c73 7061 6e20 636c 6173 733d 2273 3222  "convert_v
│ │ │ │ -00006e40: 616c 7565 2671 756f 743b 3c2f 7370 616e  alue", None<
│ │ │ │ -00006e80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>). 
│ │ │ │ -00006ea0: 2020 2020 2020 203c 7370 616e 2063 6c61         return state..    def get_db_conver
│ │ │ │ -00006f20: 7465 7273 3c2f 7370 616e 3e3c 7370 616e  ters(self<
│ │ │ │ -00006f60: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ -00006f70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   connecti
│ │ │ │ -00006f90: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063  on):.        retur
│ │ │ │ -00006fd0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n (.            []
│ │ │ │ -00007010: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00007020: 2020 2020 3c73 7061 6e20 636c 6173 733d      if s
│ │ │ │ -00007050: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf.convert_value<
│ │ │ │ -00007090: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> is self.<
│ │ │ │ -000070e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>_convert_v
│ │ │ │ -00007100: 616c 7565 5f6e 6f6f 703c 2f73 7061 6e3e  alue_noop
│ │ │ │ -00007110: 0a20 2020 2020 2020 2020 2020 203c 7370  .            els
│ │ │ │ -00007130: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e [self.convert_val
│ │ │ │ -000071a0: 7565 3c2f 7370 616e 3e3c 7370 616e 2063  ue].        ) + sel
│ │ │ │ -00007210: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ -00007230: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00007240: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370  output_field.get_d
│ │ │ │ -00007280: 625f 636f 6e76 6572 7465 7273 3c2f 7370  b_converters(conne
│ │ │ │ -000072c0: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061  ction)..    def get_source
│ │ │ │ -00007320: 5f65 7870 7265 7373 696f 6e73 3c2f 7370  _expressions(self
│ │ │ │ -00007360: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ -00007380: 0a20 2020 2020 2020 203c 7370 616e 2063  .        return<
│ │ │ │ -000073a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> []
│ │ │ │ -000073c0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    def
│ │ │ │ -000073e0: 203c 7370 616e 2063 6c61 7373 3d22 6e66   set_source_exp
│ │ │ │ -00007400: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c  ressions<
│ │ │ │ -00007410: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ -00007420: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self, expr
│ │ │ │ -00007470: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s):.        assert
│ │ │ │ -000074b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   not exprs
│ │ │ │ -000074f0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    def
│ │ │ │ -00007510: 203c 7370 616e 2063 6c61 7373 3d22 6e66   _parse_express
│ │ │ │ -00007530: 696f 6e73 3c2f 7370 616e 3e3c 7370 616e  ions(self<
│ │ │ │ -00007570: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ -00007580: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   *
│ │ │ │ -000075a0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -000075b0: 6578 7072 6573 7369 6f6e 733c 2f73 7061  expressions):.    
│ │ │ │ -000075e0: 2020 2020 3c73 7061 6e20 636c 6173 733d      return [.     
│ │ │ │ -00007620: 2020 2020 2020 203c 7370 616e 2063 6c61         arg.            if
│ │ │ │ -00007660: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   hasattr
│ │ │ │ -00007680: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -000076a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61  span class="n">a
│ │ │ │ -000076b0: 7267 3c2f 7370 616e 3e3c 7370 616e 2063  rg, "resolve
│ │ │ │ -000076f0: 5f65 7870 7265 7373 696f 6e26 7175 6f74  _expression"
│ │ │ │ -00007700: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c  ;)
│ │ │ │ -00007720: 0a20 2020 2020 2020 2020 2020 203c 7370  .            els
│ │ │ │ -00007740: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e (F(arg) if i
│ │ │ │ -000077f0: 7369 6e73 7461 6e63 653c 2f73 7061 6e3e  sinstance
│ │ │ │ -00007800: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00007810: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (arg, str<
│ │ │ │ -00007860: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>) <
│ │ │ │ -00007880: 7370 616e 2063 6c61 7373 3d22 6b22 3e65  span class="k">e
│ │ │ │ -00007890: 6c73 653c 2f73 7061 6e3e 203c 7370 616e  lse Value
│ │ │ │ -000078b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -000078d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61  span class="n">a
│ │ │ │ -000078e0: 7267 3c2f 7370 616e 3e3c 7370 616e 2063  rg)).            <
│ │ │ │ -00007910: 7370 616e 2063 6c61 7373 3d22 6b22 3e66  span class="k">f
│ │ │ │ -00007920: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20  or arg in 
│ │ │ │ -00007960: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00007970: 6578 7072 6573 7369 6f6e 733c 2f73 7061  expressions.        ]..    def as_sql(self<
│ │ │ │ -00007a10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -00007a30: 7370 616e 2063 6c61 7373 3d22 6e22 3e63  span class="n">c
│ │ │ │ -00007a40: 6f6d 7069 6c65 723c 2f73 7061 6e3e 3c73  ompiler,<
│ │ │ │ -00007a60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> connectio
│ │ │ │ -00007a80: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  n):.        ""&q
│ │ │ │ -00007ae0: 756f 743b 3c2f 7370 616e 3e0a 3c73 7061  uot;.   
│ │ │ │ -00007b00: 2020 2020 2052 6573 706f 6e73 6962 6c65       Responsible
│ │ │ │ -00007b10: 2066 6f72 2072 6574 7572 6e69 6e67 2061   for returning a
│ │ │ │ -00007b20: 2028 7371 6c2c 205b 7061 7261 6d73 5d29   (sql, [params])
│ │ │ │ -00007b30: 2074 7570 6c65 2074 6f20 6265 2069 6e63   tuple to be inc
│ │ │ │ -00007b40: 6c75 6465 643c 2f73 7061 6e3e 0a3c 7370  luded.  
│ │ │ │ -00007b60: 2020 2020 2020 696e 2074 6865 2063 7572        in the cur
│ │ │ │ -00007b70: 7265 6e74 2071 7565 7279 2e3c 2f73 7061  rent query...        Dif
│ │ │ │ -00007ba0: 6665 7265 6e74 2062 6163 6b65 6e64 7320  ferent backends 
│ │ │ │ -00007bb0: 6361 6e20 7072 6f76 6964 6520 7468 6569  can provide thei
│ │ │ │ -00007bc0: 7220 6f77 6e20 696d 706c 656d 656e 7461  r own implementa
│ │ │ │ -00007bd0: 7469 6f6e 2c20 6279 3c2f 7370 616e 3e0a  tion, by.
│ │ │ │ -00007be0: 3c73 7061 6e20 636c 6173 733d 2273 6422          providi
│ │ │ │ -00007c00: 6e67 2061 6e20 6061 735f 7b76 656e 646f  ng an `as_{vendo
│ │ │ │ -00007c10: 727d 6020 6d65 7468 6f64 2061 6e64 2070  r}` method and p
│ │ │ │ -00007c20: 6174 6368 696e 6720 7468 6520 4578 7072  atching the Expr
│ │ │ │ -00007c30: 6573 7369 6f6e 3a3c 2f73 7061 6e3e 0a0a  ession:..
│ │ │ │ -00007c40: 3c73 7061 6e20 636c 6173 733d 2273 6422          ```.        def
│ │ │ │ -00007c80: 206f 7665 7272 6964 655f 6173 5f73 716c   override_as_sql
│ │ │ │ -00007c90: 2873 656c 662c 2063 6f6d 7069 6c65 722c  (self, compiler,
│ │ │ │ -00007ca0: 2063 6f6e 6e65 6374 696f 6e29 3a3c 2f73   connection):.          
│ │ │ │ -00007cd0: 2020 2320 6375 7374 6f6d 206c 6f67 6963    # custom logic
│ │ │ │ -00007ce0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .       
│ │ │ │ -00007d00: 2020 2020 2072 6574 7572 6e20 7375 7065       return supe
│ │ │ │ -00007d10: 7228 292e 6173 5f73 716c 2863 6f6d 7069  r().as_sql(compi
│ │ │ │ -00007d20: 6c65 722c 2063 6f6e 6e65 6374 696f 6e29  ler, connection)
│ │ │ │ -00007d30: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .       
│ │ │ │ -00007d50: 2073 6574 6174 7472 2845 7870 7265 7373   setattr(Express
│ │ │ │ -00007d60: 696f 6e2c 2026 2333 393b 6173 5f26 2333  ion, 'as_
│ │ │ │ -00007d70: 393b 202b 2063 6f6e 6e65 6374 696f 6e2e  9; + connection.
│ │ │ │ -00007d80: 7665 6e64 6f72 2c20 6f76 6572 7269 6465  vendor, override
│ │ │ │ -00007d90: 5f61 735f 7371 6c29 3c2f 7370 616e 3e0a  _as_sql).
│ │ │ │ -00007da0: 3c73 7061 6e20 636c 6173 733d 2273 6422          ```..        Ar
│ │ │ │ -00007de0: 6775 6d65 6e74 733a 3c2f 7370 616e 3e0a  guments:.
│ │ │ │ -00007df0: 3c73 7061 6e20 636c 6173 733d 2273 6422           * comp
│ │ │ │ -00007e10: 696c 6572 3a20 7468 6520 7175 6572 7920  iler: the query 
│ │ │ │ -00007e20: 636f 6d70 696c 6572 2072 6573 706f 6e73  compiler respons
│ │ │ │ -00007e30: 6962 6c65 2066 6f72 2067 656e 6572 6174  ible for generat
│ │ │ │ -00007e40: 696e 6720 7468 6520 7175 6572 792e 3c2f  ing the query..         
│ │ │ │ -00007e70: 2020 4d75 7374 2068 6176 6520 6120 636f    Must have a co
│ │ │ │ -00007e80: 6d70 696c 6520 6d65 7468 6f64 2c20 7265  mpile method, re
│ │ │ │ -00007e90: 7475 726e 696e 6720 6120 2873 716c 2c20  turning a (sql, 
│ │ │ │ -00007ea0: 5b70 6172 616d 735d 2920 7475 706c 652e  [params]) tuple.
│ │ │ │ -00007eb0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .       
│ │ │ │ -00007ed0: 2020 2020 4361 6c6c 696e 6720 636f 6d70      Calling comp
│ │ │ │ -00007ee0: 696c 6572 2876 616c 7565 2920 7769 6c6c  iler(value) will
│ │ │ │ -00007ef0: 2072 6574 7572 6e20 6120 7175 6f74 6564   return a quoted
│ │ │ │ -00007f00: 2060 7661 6c75 6560 2e3c 2f73 7061 6e3e   `value`.
│ │ │ │ -00007f10: 0a0a 3c73 7061 6e20 636c 6173 733d 2273  ..         * co
│ │ │ │ -00007f30: 6e6e 6563 7469 6f6e 3a20 7468 6520 6461  nnection: the da
│ │ │ │ -00007f40: 7461 6261 7365 2063 6f6e 6e65 6374 696f  tabase connectio
│ │ │ │ -00007f50: 6e20 7573 6564 2066 6f72 2074 6865 2063  n used for the c
│ │ │ │ -00007f60: 7572 7265 6e74 2071 7565 7279 2e3c 2f73  urrent query...        R
│ │ │ │ -00007f90: 6574 7572 6e3a 2028 7371 6c2c 2070 6172  eturn: (sql, par
│ │ │ │ -00007fa0: 616d 7329 3c2f 7370 616e 3e0a 3c73 7061  ams).   
│ │ │ │ -00007fc0: 2020 2020 2020 2057 6865 7265 2060 7371         Where `sq
│ │ │ │ -00007fd0: 6c60 2069 7320 6120 7374 7269 6e67 2063  l` is a string c
│ │ │ │ -00007fe0: 6f6e 7461 696e 696e 6720 6f72 6465 7265  ontaining ordere
│ │ │ │ -00007ff0: 6420 7371 6c20 7061 7261 6d65 7465 7273  d sql parameters
│ │ │ │ -00008000: 2074 6f20 6265 3c2f 7370 616e 3e0a 3c73   to be. 
│ │ │ │ -00008020: 2020 2020 2020 2020 2072 6570 6c61 6365           replace
│ │ │ │ -00008030: 6420 7769 7468 2074 6865 2065 6c65 6d65  d with the eleme
│ │ │ │ -00008040: 6e74 7320 6f66 2074 6865 206c 6973 7420  nts of the list 
│ │ │ │ -00008050: 6070 6172 616d 7360 2e3c 2f73 7061 6e3e  `params`.
│ │ │ │ -00008060: 0a3c 7370 616e 2063 6c61 7373 3d22 7364  .        "
│ │ │ │ -00008080: 2671 756f 743b 2671 756f 743b 3c2f 7370  "".        rais
│ │ │ │ -000080b0: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e NotImp
│ │ │ │ -000080d0: 6c65 6d65 6e74 6564 4572 726f 723c 2f73  lementedError(&qu
│ │ │ │ -00008110: 6f74 3b53 7562 636c 6173 7365 7320 6d75  ot;Subclasses mu
│ │ │ │ -00008120: 7374 2069 6d70 6c65 6d65 6e74 2061 735f  st implement as_
│ │ │ │ -00008130: 7371 6c28 2926 7175 6f74 3b3c 2f73 7061  sql()")..    
│ │ │ │ -00008160: 3c73 7061 6e20 636c 6173 733d 226e 6422  @cached_propert
│ │ │ │ -00008180: 793c 2f73 7061 6e3e 0a20 2020 203c 7370  y.    def
│ │ │ │ -000081a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   contain
│ │ │ │ -000081c0: 735f 6167 6772 6567 6174 653c 2f73 7061  s_aggregate(self<
│ │ │ │ -00008200: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>):.
│ │ │ │ -00008220: 2020 2020 2020 2020 3c73 7061 6e20 636c          return any(.      
│ │ │ │ -00008280: 2020 2020 2020 3c73 7061 6e20 636c 6173        expr and ex
│ │ │ │ -000082d0: 7072 3c2f 7370 616e 3e3c 7370 616e 2063  pr.contains_aggreg
│ │ │ │ -00008310: 6174 653c 2f73 7061 6e3e 203c 7370 616e  ate for expr in se
│ │ │ │ -00008380: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.get_source_expr
│ │ │ │ -000083c0: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73  essions()
│ │ │ │ -000083e0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -000083f0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00008400: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73  )..    @
│ │ │ │ -00008420: 6361 6368 6564 5f70 726f 7065 7274 793c  cached_property<
│ │ │ │ -00008430: 2f73 7061 6e3e 0a20 2020 203c 7370 616e  /span>.    def contains_
│ │ │ │ -00008470: 6f76 6572 5f63 6c61 7573 653c 2f73 7061  over_clause(self<
│ │ │ │ -000084b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>):.
│ │ │ │ -000084d0: 2020 2020 2020 2020 3c73 7061 6e20 636c          return any(.      
│ │ │ │ -00008530: 2020 2020 2020 3c73 7061 6e20 636c 6173        expr and ex
│ │ │ │ -00008580: 7072 3c2f 7370 616e 3e3c 7370 616e 2063  pr.contains_over_c
│ │ │ │ -000085c0: 6c61 7573 653c 2f73 7061 6e3e 203c 7370  lause for
│ │ │ │ -000085e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   expr in <
│ │ │ │ -00008620: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -00008630: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self.get_source_ex
│ │ │ │ -00008670: 7072 6573 7369 6f6e 733c 2f73 7061 6e3e  pressions
│ │ │ │ -00008680: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00008690: 2829 3c2f 7370 616e 3e0a 2020 2020 2020  ().      
│ │ │ │ -000086a0: 2020 3c73 7061 6e20 636c 6173 733d 2270    )..    
│ │ │ │ -000086c0: 3c73 7061 6e20 636c 6173 733d 226e 6422  @cached_propert
│ │ │ │ -000086e0: 793c 2f73 7061 6e3e 0a20 2020 203c 7370  y.    def
│ │ │ │ -00008700: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   contain
│ │ │ │ -00008720: 735f 636f 6c75 6d6e 5f72 6566 6572 656e  s_column_referen
│ │ │ │ -00008730: 6365 733c 2f73 7061 6e3e 3c73 7061 6e20  ces(self):
│ │ │ │ -00008780: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00008790: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -000087a0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return a
│ │ │ │ -000087c0: 6e79 3c2f 7370 616e 3e3c 7370 616e 2063  ny(.            ex
│ │ │ │ -00008800: 7072 3c2f 7370 616e 3e20 3c73 7061 6e20  pr and expr.contain
│ │ │ │ -00008870: 735f 636f 6c75 6d6e 5f72 6566 6572 656e  s_column_referen
│ │ │ │ -00008880: 6365 733c 2f73 7061 6e3e 0a20 2020 2020  ces.     
│ │ │ │ -00008890: 2020 2020 2020 203c 7370 616e 2063 6c61         for expr i
│ │ │ │ -000088e0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n self.get
│ │ │ │ -00008930: 5f73 6f75 7263 655f 6578 7072 6573 7369  _source_expressi
│ │ │ │ -00008940: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20  ons().        )..    @cach
│ │ │ │ -000089a0: 6564 5f70 726f 7065 7274 793c 2f73 7061  ed_property.    def contains_subq
│ │ │ │ -000089f0: 7565 7279 3c2f 7370 616e 3e3c 7370 616e  uery(self<
│ │ │ │ -00008a30: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -00008a40: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ -00008a50: 203c 7370 616e 2063 6c61 7373 3d22 6b22   return <
│ │ │ │ -00008a70: 7370 616e 2063 6c61 7373 3d22 6e62 223e  span class="nb">
│ │ │ │ -00008a80: 616e 793c 2f73 7061 6e3e 3c73 7061 6e20  any(.            <
│ │ │ │ -00008ab0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65  span class="n">e
│ │ │ │ -00008ac0: 7870 723c 2f73 7061 6e3e 203c 7370 616e  xpr and<
│ │ │ │ -00008ae0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> (<
│ │ │ │ -00008b00: 7370 616e 2063 6c61 7373 3d22 6e62 223e  span class="nb">
│ │ │ │ -00008b10: 6765 7461 7474 723c 2f73 7061 6e3e 3c73  getattr(<
│ │ │ │ -00008b30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>expr, "
│ │ │ │ -00008b80: 3b73 7562 7175 6572 7926 7175 6f74 3b3c  ;subquery"<
│ │ │ │ -00008b90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -00008bb0: 7370 616e 2063 6c61 7373 3d22 6b63 223e  span class="kc">
│ │ │ │ -00008bc0: 4661 6c73 653c 2f73 7061 6e3e 3c73 7061  False) or 
│ │ │ │ -00008c00: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -00008c10: 6578 7072 3c2f 7370 616e 3e3c 7370 616e  expr.contains_subq
│ │ │ │ -00008c50: 7565 7279 3c2f 7370 616e 3e3c 7370 616e  uery).            
│ │ │ │ -00008c80: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -00008c90: 666f 723c 2f73 7061 6e3e 203c 7370 616e  for expr<
│ │ │ │ -00008cb0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> in self.<
│ │ │ │ -00008d00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>get_source
│ │ │ │ -00008d20: 5f65 7870 7265 7373 696f 6e73 3c2f 7370  _expressions().   
│ │ │ │ -00008d50: 2020 2020 203c 7370 616e 2063 6c61 7373       ).. 
│ │ │ │ -00008d70: 2020 203c 7370 616e 2063 6c61 7373 3d22     def r
│ │ │ │ -00008da0: 6573 6f6c 7665 5f65 7870 7265 7373 696f  esolve_expressio
│ │ │ │ -00008db0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  n(
│ │ │ │ -00008dd0: 0a20 2020 2020 2020 203c 7370 616e 2063  .        self, qu
│ │ │ │ -00008e20: 6572 793c 2f73 7061 6e3e 3c73 7061 6e20  ery=None,<
│ │ │ │ -00008e70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> allow_joi
│ │ │ │ -00008e90: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063  ns=True, reuse=None<
│ │ │ │ -00008f30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -00008f50: 7370 616e 2063 6c61 7373 3d22 6e22 3e73  span class="n">s
│ │ │ │ -00008f60: 756d 6d61 7269 7a65 3c2f 7370 616e 3e3c  ummarize<
│ │ │ │ -00008f70: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d  span class="o">=
│ │ │ │ -00008f80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  False, for
│ │ │ │ -00008fd0: 5f73 6176 653c 2f73 7061 6e3e 3c73 7061  _save=False.    ):.
│ │ │ │ -00009030: 3c73 7061 6e20 636c 6173 733d 2277 223e  
│ │ │ │ -00009040: 2020 2020 2020 2020 3c2f 7370 616e 3e3c          <
│ │ │ │ -00009050: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ -00009060: 2671 756f 743b 2671 756f 743b 2671 756f  ""&quo
│ │ │ │ -00009070: 743b 3c2f 7370 616e 3e0a 3c73 7061 6e20  t;.     
│ │ │ │ -00009090: 2020 2050 726f 7669 6465 2074 6865 2063     Provide the c
│ │ │ │ -000090a0: 6861 6e63 6520 746f 2064 6f20 616e 7920  hance to do any 
│ │ │ │ -000090b0: 7072 6570 726f 6365 7373 696e 6720 6f72  preprocessing or
│ │ │ │ -000090c0: 2076 616c 6964 6174 696f 6e20 6265 666f   validation befo
│ │ │ │ -000090d0: 7265 2062 6569 6e67 3c2f 7370 616e 3e0a  re being.
│ │ │ │ -000090e0: 3c73 7061 6e20 636c 6173 733d 2273 6422          added t
│ │ │ │ -00009100: 6f20 7468 6520 7175 6572 792e 3c2f 7370  o the query...        Ar
│ │ │ │ -00009130: 6775 6d65 6e74 733a 3c2f 7370 616e 3e0a  guments:.
│ │ │ │ -00009140: 3c73 7061 6e20 636c 6173 733d 2273 6422           * quer
│ │ │ │ -00009160: 793a 2074 6865 2062 6163 6b65 6e64 2071  y: the backend q
│ │ │ │ -00009170: 7565 7279 2069 6d70 6c65 6d65 6e74 6174  uery implementat
│ │ │ │ -00009180: 696f 6e3c 2f73 7061 6e3e 0a3c 7370 616e  ion.    
│ │ │ │ -000091a0: 2020 2020 202a 2061 6c6c 6f77 5f6a 6f69       * allow_joi
│ │ │ │ -000091b0: 6e73 3a20 626f 6f6c 6561 6e20 616c 6c6f  ns: boolean allo
│ │ │ │ -000091c0: 7769 6e67 206f 7220 6465 6e79 696e 6720  wing or denying 
│ │ │ │ -000091d0: 7573 6520 6f66 206a 6f69 6e73 3c2f 7370  use of joins.           
│ │ │ │ -00009200: 696e 2074 6869 7320 7175 6572 793c 2f73  in this query.         *
│ │ │ │ -00009230: 2072 6575 7365 3a20 6120 7365 7420 6f66   reuse: a set of
│ │ │ │ -00009240: 2072 6575 7361 626c 6520 6a6f 696e 7320   reusable joins 
│ │ │ │ -00009250: 666f 7220 6d75 6c74 696a 6f69 6e73 3c2f  for multijoins.         
│ │ │ │ -00009280: 2a20 7375 6d6d 6172 697a 653a 2061 2074  * summarize: a t
│ │ │ │ -00009290: 6572 6d69 6e61 6c20 6167 6772 6567 6174  erminal aggregat
│ │ │ │ -000092a0: 6520 636c 6175 7365 3c2f 7370 616e 3e0a  e clause.
│ │ │ │ -000092b0: 3c73 7061 6e20 636c 6173 733d 2273 6422           * for_
│ │ │ │ -000092d0: 7361 7665 3a20 7768 6574 6865 7220 7468  save: whether th
│ │ │ │ -000092e0: 6973 2065 7870 7265 7373 696f 6e20 6162  is expression ab
│ │ │ │ -000092f0: 6f75 7420 746f 2062 6520 7573 6564 2069  out to be used i
│ │ │ │ -00009300: 6e20 6120 7361 7665 206f 7220 7570 6461  n a save or upda
│ │ │ │ -00009310: 7465 3c2f 7370 616e 3e0a 0a3c 7370 616e  te..    
│ │ │ │ -00009330: 2020 2020 5265 7475 726e 3a20 616e 2045      Return: an E
│ │ │ │ -00009340: 7870 7265 7373 696f 6e20 746f 2062 6520  xpression to be 
│ │ │ │ -00009350: 6164 6465 6420 746f 2074 6865 2071 7565  added to the que
│ │ │ │ -00009360: 7279 2e3c 2f73 7061 6e3e 0a3c 7370 616e  ry..    
│ │ │ │ -00009380: 2020 2020 2671 756f 743b 2671 756f 743b      ""
│ │ │ │ -00009390: 2671 756f 743b 3c2f 7370 616e 3e0a 2020  ".  
│ │ │ │ -000093a0: 2020 2020 2020 3c73 7061 6e20 636c 6173        c <
│ │ │ │ -000093c0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d  span class="o">=
│ │ │ │ -000093d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   self.copy
│ │ │ │ -00009420: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ()
│ │ │ │ -00009440: 0a20 2020 2020 2020 203c 7370 616e 2063  .        c.is_summ
│ │ │ │ -00009490: 6172 793c 2f73 7061 6e3e 203c 7370 616e  ary = summarize.        c.set
│ │ │ │ -00009520: 5f73 6f75 7263 655f 6578 7072 6573 7369  _source_expressi
│ │ │ │ -00009530: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20  ons(.            <
│ │ │ │ -00009560: 7370 616e 2063 6c61 7373 3d22 7022 3e5b  span class="p">[
│ │ │ │ -00009570: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00009580: 2020 2020 2020 2020 3c73 7061 6e20 636c          expr.resol
│ │ │ │ -000095d0: 7665 5f65 7870 7265 7373 696f 6e3c 2f73  ve_expression(quer
│ │ │ │ -00009610: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c  y,
│ │ │ │ -00009630: 203c 7370 616e 2063 6c61 7373 3d22 6e22   allow_joins..    de
│ │ │ │ +00004c40: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f __or__
│ │ │ │ +00004c60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +00004c80: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +00004c90: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self, other
│ │ │ │ +00004cd0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00004ce0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ +00004cf0: 2020 3c73 7061 6e20 636c 6173 733d 226b    if get
│ │ │ │ +00004d20: 6174 7472 3c2f 7370 616e 3e3c 7370 616e  attr(self<
│ │ │ │ +00004d60: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00004d70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   "c
│ │ │ │ +00004d90: 6f6e 6469 7469 6f6e 616c 2671 756f 743b  onditional"
│ │ │ │ +00004da0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ +00004dc0: 3c73 7061 6e20 636c 6173 733d 226b 6322  False) and getattr(other, &
│ │ │ │ +00004e90: 7175 6f74 3b63 6f6e 6469 7469 6f6e 616c  quot;conditional
│ │ │ │ +00004ea0: 2671 756f 743b 3c2f 7370 616e 3e3c 7370  ", False):.   
│ │ │ │ +00004f00: 2020 2020 2020 2020 203c 7370 616e 2063           return<
│ │ │ │ +00004f20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> Q<
│ │ │ │ +00004f40: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +00004f50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self) | Q(other).      
│ │ │ │ +00005010: 2020 3c73 7061 6e20 636c 6173 733d 226b    raise <
│ │ │ │ +00005030: 7370 616e 2063 6c61 7373 3d22 6e65 223e  span class="ne">
│ │ │ │ +00005040: 4e6f 7449 6d70 6c65 6d65 6e74 6564 4572  NotImplementedEr
│ │ │ │ +00005050: 726f 723c 2f73 7061 6e3e 3c73 7061 6e20  ror(.            <
│ │ │ │ +00005080: 7370 616e 2063 6c61 7373 3d22 7332 223e  span class="s2">
│ │ │ │ +00005090: 2671 756f 743b 5573 6520 2e62 6974 616e  "Use .bitan
│ │ │ │ +000050a0: 6428 292c 202e 6269 746f 7228 292c 2061  d(), .bitor(), a
│ │ │ │ +000050b0: 6e64 202e 6269 7478 6f72 2829 2066 6f72  nd .bitxor() for
│ │ │ │ +000050c0: 2062 6974 7769 7365 206c 6f67 6963 616c   bitwise logical
│ │ │ │ +000050d0: 206f 7065 7261 7469 6f6e 732e 2671 756f   operations.&quo
│ │ │ │ +000050e0: 743b 3c2f 7370 616e 3e0a 2020 2020 2020  t;.      
│ │ │ │ +000050f0: 2020 3c73 7061 6e20 636c 6173 733d 2270    )..    
│ │ │ │ +00005110: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +00005120: 6465 663c 2f73 7061 6e3e 203c 7370 616e  def bito
│ │ │ │ +00005140: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r(
│ │ │ │ +00005160: 3c73 7061 6e20 636c 6173 733d 2262 7022  self, other):.     
│ │ │ │ +000051d0: 2020 203c 7370 616e 2063 6c61 7373 3d22     return
│ │ │ │ +000051f0: 203c 7370 616e 2063 6c61 7373 3d22 6270   self._combine(othe
│ │ │ │ +00005270: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r,
│ │ │ │ +00005290: 203c 7370 616e 2063 6c61 7373 3d22 6270   self.BITOR, False
│ │ │ │ +00005310: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ).
│ │ │ │ +00005330: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ +00005350: 3c73 7061 6e20 636c 6173 733d 2266 6d22  __radd__
│ │ │ │ +00005370: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00005380: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self, oth
│ │ │ │ +000053d0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063  er):.        retur
│ │ │ │ +00005410: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n self._co
│ │ │ │ +00005460: 6d62 696e 653c 2f73 7061 6e3e 3c73 7061  mbine(other
│ │ │ │ +000054a0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +000054b0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , self.ADD
│ │ │ │ +00005500: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ +00005520: 3c73 7061 6e20 636c 6173 733d 226b 6322  True)..    def __rsub__(se
│ │ │ │ +000055c0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf, other):
│ │ │ │ +00005610: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +00005620: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +00005630: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return s
│ │ │ │ +00005650: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf._combine(other, s
│ │ │ │ +000056f0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf.SUB, True)..    <
│ │ │ │ +00005780: 7370 616e 2063 6c61 7373 3d22 6b22 3e64  span class="k">d
│ │ │ │ +00005790: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20  ef __rmu
│ │ │ │ +000057b0: 6c5f 5f3c 2f73 7061 6e3e 3c73 7061 6e20  l__(self,<
│ │ │ │ +00005800: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> other):.   
│ │ │ │ +00005840: 2020 2020 203c 7370 616e 2063 6c61 7373       return self<
│ │ │ │ +00005880: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ +00005890: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  _combine<
│ │ │ │ +000058b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(ot
│ │ │ │ +000058e0: 6865 723c 2f73 7061 6e3e 3c73 7061 6e20  her, self<
│ │ │ │ +00005920: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ +00005930: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  MUL, True<
│ │ │ │ +00005980: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>)..
│ │ │ │ +000059a0: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ +000059c0: 7370 616e 2063 6c61 7373 3d22 666d 223e  span class="fm">
│ │ │ │ +000059d0: 5f5f 7274 7275 6564 6976 5f5f 3c2f 7370  __rtruediv__(self
│ │ │ │ +00005a10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ +00005a30: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00005a40: 6f74 6865 723c 2f73 7061 6e3e 3c73 7061  other):.        re
│ │ │ │ +00005a80: 7475 726e 3c2f 7370 616e 3e20 3c73 7061  turn sel
│ │ │ │ +00005aa0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ +00005ac0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00005ad0: 5f63 6f6d 6269 6e65 3c2f 7370 616e 3e3c  _combine<
│ │ │ │ +00005ae0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +00005af0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  other, sel
│ │ │ │ +00005b40: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ +00005b60: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00005b70: 4449 563c 2f73 7061 6e3e 3c73 7061 6e20  DIV, True<
│ │ │ │ +00005bb0: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ +00005bc0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ +00005be0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   __rmod_
│ │ │ │ +00005c00: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c  _(
│ │ │ │ +00005c20: 3c73 7061 6e20 636c 6173 733d 2262 7022  self, other):.     
│ │ │ │ +00005c90: 2020 203c 7370 616e 2063 6c61 7373 3d22     return
│ │ │ │ +00005cb0: 203c 7370 616e 2063 6c61 7373 3d22 6270   self._combine(othe
│ │ │ │ +00005d30: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r,
│ │ │ │ +00005d50: 203c 7370 616e 2063 6c61 7373 3d22 6270   self.MOD<
│ │ │ │ +00005da0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00005db0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   True)..  
│ │ │ │ +00005df0: 2020 3c73 7061 6e20 636c 6173 733d 226b    def __
│ │ │ │ +00005e20: 7270 6f77 5f5f 3c2f 7370 616e 3e3c 7370  rpow__(self, other<
│ │ │ │ +00005e90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>):.
│ │ │ │ +00005eb0: 2020 2020 2020 2020 3c73 7061 6e20 636c          return self._combi
│ │ │ │ +00005f20: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063  ne(other, self.POW, Tr
│ │ │ │ +00005ff0: 7565 3c2f 7370 616e 3e3c 7370 616e 2063  ue)..    def __rand__(self<
│ │ │ │ +00006080: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ +000060a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f  span class="n">o
│ │ │ │ +000060b0: 7468 6572 3c2f 7370 616e 3e3c 7370 616e  ther):.        rai
│ │ │ │ +000060f0: 7365 3c2f 7370 616e 3e20 3c73 7061 6e20  se NotIm
│ │ │ │ +00006110: 706c 656d 656e 7465 6445 7272 6f72 3c2f  plementedError(.  
│ │ │ │ +00006140: 2020 2020 2020 2020 2020 3c73 7061 6e20            "
│ │ │ │ +00006160: 3b55 7365 202e 6269 7461 6e64 2829 2c20  ;Use .bitand(), 
│ │ │ │ +00006170: 2e62 6974 6f72 2829 2c20 616e 6420 2e62  .bitor(), and .b
│ │ │ │ +00006180: 6974 786f 7228 2920 666f 7220 6269 7477  itxor() for bitw
│ │ │ │ +00006190: 6973 6520 6c6f 6769 6361 6c20 6f70 6572  ise logical oper
│ │ │ │ +000061a0: 6174 696f 6e73 2e26 7175 6f74 3b3c 2f73  ations.".        )..    def __ror__(se
│ │ │ │ +00006240: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf, other):
│ │ │ │ +00006290: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +000062a0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +000062b0: 7261 6973 653c 2f73 7061 6e3e 203c 7370  raise No
│ │ │ │ +000062d0: 7449 6d70 6c65 6d65 6e74 6564 4572 726f  tImplementedErro
│ │ │ │ +000062e0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r(
│ │ │ │ +00006300: 0a20 2020 2020 2020 2020 2020 203c 7370  .            &q
│ │ │ │ +00006320: 756f 743b 5573 6520 2e62 6974 616e 6428  uot;Use .bitand(
│ │ │ │ +00006330: 292c 202e 6269 746f 7228 292c 2061 6e64  ), .bitor(), and
│ │ │ │ +00006340: 202e 6269 7478 6f72 2829 2066 6f72 2062   .bitxor() for b
│ │ │ │ +00006350: 6974 7769 7365 206c 6f67 6963 616c 206f  itwise logical o
│ │ │ │ +00006360: 7065 7261 7469 6f6e 732e 2671 756f 743b  perations."
│ │ │ │ +00006370: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +00006380: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00006390: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73  )..    de
│ │ │ │ +000063b0: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f __rxor
│ │ │ │ +000063d0: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063  __(self, other):.    
│ │ │ │ +00006460: 2020 2020 3c73 7061 6e20 636c 6173 733d      raise
│ │ │ │ +00006480: 203c 7370 616e 2063 6c61 7373 3d22 6e65   NotImplemented
│ │ │ │ +000064a0: 4572 726f 723c 2f73 7061 6e3e 3c73 7061  Error(.           
│ │ │ │ +000064d0: 203c 7370 616e 2063 6c61 7373 3d22 7332   "Use .bit
│ │ │ │ +000064f0: 616e 6428 292c 202e 6269 746f 7228 292c  and(), .bitor(),
│ │ │ │ +00006500: 2061 6e64 202e 6269 7478 6f72 2829 2066   and .bitxor() f
│ │ │ │ +00006510: 6f72 2062 6974 7769 7365 206c 6f67 6963  or bitwise logic
│ │ │ │ +00006520: 616c 206f 7065 7261 7469 6f6e 732e 2671  al operations.&q
│ │ │ │ +00006530: 756f 743b 3c2f 7370 616e 3e0a 2020 2020  uot;.    
│ │ │ │ +00006540: 2020 2020 3c73 7061 6e20 636c 6173 733d      )..  
│ │ │ │ +00006560: 2020 3c73 7061 6e20 636c 6173 733d 226b    def __
│ │ │ │ +00006590: 696e 7665 7274 5f5f 3c2f 7370 616e 3e3c  invert__<
│ │ │ │ +000065a0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +000065b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self):.   
│ │ │ │ +000065f0: 2020 2020 203c 7370 616e 2063 6c61 7373       return NegatedExpres
│ │ │ │ +00006630: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e  sion(self<
│ │ │ │ +00006670: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ +00006680: 3c2f 7370 616e 3e0a 0a0a 3c73 7061 6e20  ...class<
│ │ │ │ +000066a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> BaseExpr
│ │ │ │ +000066c0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370  ession:.    ""&q
│ │ │ │ +00006720: 756f 743b 4261 7365 2063 6c61 7373 2066  uot;Base class f
│ │ │ │ +00006730: 6f72 2061 6c6c 2071 7565 7279 2065 7870  or all query exp
│ │ │ │ +00006740: 7265 7373 696f 6e73 2e26 7175 6f74 3b26  ressions."&
│ │ │ │ +00006750: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061  quot;"..    empty_re
│ │ │ │ +00006780: 7375 6c74 5f73 6574 5f76 616c 7565 3c2f  sult_set_value = <
│ │ │ │ +000067b0: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +000067c0: 4e6f 7449 6d70 6c65 6d65 6e74 6564 3c2f  NotImplemented.    # agg
│ │ │ │ +000067f0: 7265 6761 7465 2073 7065 6369 6669 6320  regate specific 
│ │ │ │ +00006800: 6669 656c 6473 3c2f 7370 616e 3e0a 2020  fields.  
│ │ │ │ +00006810: 2020 3c73 7061 6e20 636c 6173 733d 226e    is_summary = Fa
│ │ │ │ +00006860: 6c73 653c 2f73 7061 6e3e 0a20 2020 203c  lse.    <
│ │ │ │ +00006870: 7370 616e 2063 6c61 7373 3d22 6e22 3e5f  span class="n">_
│ │ │ │ +00006880: 6f75 7470 7574 5f66 6965 6c64 5f72 6573  output_field_res
│ │ │ │ +00006890: 6f6c 7665 645f 746f 5f6e 6f6e 653c 2f73  olved_to_none = F
│ │ │ │ +000068d0: 616c 7365 3c2f 7370 616e 3e0a 2020 2020  alse.    
│ │ │ │ +000068e0: 3c73 7061 6e20 636c 6173 733d 2263 3122  # Can the expre
│ │ │ │ +00006900: 7373 696f 6e20 6265 2075 7365 6420 696e  ssion be used in
│ │ │ │ +00006910: 2061 2057 4845 5245 2063 6c61 7573 653f   a WHERE clause?
│ │ │ │ +00006920: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061  .    filt
│ │ │ │ +00006940: 6572 6162 6c65 3c2f 7370 616e 3e20 3c73  erable =<
│ │ │ │ +00006960: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> True.    # Can t
│ │ │ │ +000069a0: 6865 2065 7870 7265 7373 696f 6e20 6361  he expression ca
│ │ │ │ +000069b0: 6e20 6265 2075 7365 6420 6173 2061 2073  n be used as a s
│ │ │ │ +000069c0: 6f75 7263 6520 6578 7072 6573 7369 6f6e  ource expression
│ │ │ │ +000069d0: 2069 6e20 5769 6e64 6f77 3f3c 2f73 7061   in Window?.    window_co
│ │ │ │ +00006a00: 6d70 6174 6962 6c65 3c2f 7370 616e 3e20  mpatible 
│ │ │ │ +00006a10: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +00006a20: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063  = False<
│ │ │ │ +00006a40: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061  /span>..    def<
│ │ │ │ +00006a60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> __init__
│ │ │ │ +00006a80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +00006aa0: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +00006ab0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self, output_field
│ │ │ │ +00006af0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  =<
│ │ │ │ +00006b10: 7370 616e 2063 6c61 7373 3d22 6b63 223e  span class="kc">
│ │ │ │ +00006b20: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e  None):.        if<
│ │ │ │ +00006b60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> output_fi
│ │ │ │ +00006b80: 656c 643c 2f73 7061 6e3e 203c 7370 616e  eld is not None:<
│ │ │ │ +00006bf0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ +00006c00: 2020 203c 7370 616e 2063 6c61 7373 3d22     self<
│ │ │ │ +00006c20: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ +00006c30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  output_fi
│ │ │ │ +00006c50: 656c 643c 2f73 7061 6e3e 203c 7370 616e  eld = output_field
│ │ │ │ +00006c90: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ +00006cb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   __getst
│ │ │ │ +00006cd0: 6174 655f 5f3c 2f73 7061 6e3e 3c73 7061  ate__(self
│ │ │ │ +00006d10: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00006d20: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ +00006d30: 2020 3c73 7061 6e20 636c 6173 733d 226e    state <
│ │ │ │ +00006d50: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d  span class="o">=
│ │ │ │ +00006d60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   self.__d
│ │ │ │ +00006db0: 6963 745f 5f3c 2f73 7061 6e3e 3c73 7061  ict__.copy<
│ │ │ │ +00006df0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +00006e00: 293c 2f73 7061 6e3e 0a20 2020 2020 2020  ).       
│ │ │ │ +00006e10: 203c 7370 616e 2063 6c61 7373 3d22 6e22   state.pop<
│ │ │ │ +00006e60: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +00006e70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  "co
│ │ │ │ +00006e90: 6e76 6572 745f 7661 6c75 6526 7175 6f74  nvert_value"
│ │ │ │ +00006ea0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c  ;,
│ │ │ │ +00006ec0: 203c 7370 616e 2063 6c61 7373 3d22 6b63   None).        re
│ │ │ │ +00006f10: 7475 726e 3c2f 7370 616e 3e20 3c73 7061  turn stat
│ │ │ │ +00006f30: 653c 2f73 7061 6e3e 0a0a 2020 2020 3c73  e..    de
│ │ │ │ +00006f50: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f get_db
│ │ │ │ +00006f70: 5f63 6f6e 7665 7274 6572 733c 2f73 7061  _converters(self<
│ │ │ │ +00006fb0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ +00006fd0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63  span class="n">c
│ │ │ │ +00006fe0: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e  onnection
│ │ │ │ +00006ff0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00007000: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ +00007010: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ +00007030: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00007040: 283c 2f73 7061 6e3e 0a20 2020 2020 2020  (.       
│ │ │ │ +00007050: 2020 2020 203c 7370 616e 2063 6c61 7373       []. 
│ │ │ │ +00007070: 2020 2020 2020 2020 2020 203c 7370 616e             if self.convert
│ │ │ │ +000070e0: 5f76 616c 7565 3c2f 7370 616e 3e20 3c73  _value i
│ │ │ │ +00007100: 733c 2f73 7061 6e3e 203c 7370 616e 2063  s self._co
│ │ │ │ +00007150: 6e76 6572 745f 7661 6c75 655f 6e6f 6f70  nvert_value_noop
│ │ │ │ +00007160: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +00007170: 2020 2020 3c73 7061 6e20 636c 6173 733d      else 
│ │ │ │ +00007190: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +000071a0: 5b3c 2f73 7061 6e3e 3c73 7061 6e20 636c  [self.conv
│ │ │ │ +000071f0: 6572 745f 7661 6c75 653c 2f73 7061 6e3e  ert_value
│ │ │ │ +00007200: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00007210: 5d3c 2f73 7061 6e3e 0a20 2020 2020 2020  ].       
│ │ │ │ +00007220: 203c 7370 616e 2063 6c61 7373 3d22 7022   ) + self<
│ │ │ │ +00007270: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ +00007280: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  output_fi
│ │ │ │ +000072a0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20  eld.get_db_convert
│ │ │ │ +000072e0: 6572 733c 2f73 7061 6e3e 3c73 7061 6e20  ers(connection)..   
│ │ │ │ +00007340: 203c 7370 616e 2063 6c61 7373 3d22 6b22   def get
│ │ │ │ +00007370: 5f73 6f75 7263 655f 6578 7072 6573 7369  _source_expressi
│ │ │ │ +00007380: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20  ons(self):
│ │ │ │ +000073d0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +000073e0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +000073f0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return []
│ │ │ │ +00007410: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ +00007430: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   set_sou
│ │ │ │ +00007450: 7263 655f 6578 7072 6573 7369 6f6e 733c  rce_expressions<
│ │ │ │ +00007460: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(s
│ │ │ │ +00007490: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf, exprs<
│ │ │ │ +000074d0: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ +000074e0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ +000074f0: 203c 7370 616e 2063 6c61 7373 3d22 6b22   assert <
│ │ │ │ +00007510: 7370 616e 2063 6c61 7373 3d22 6f77 223e  span class="ow">
│ │ │ │ +00007520: 6e6f 743c 2f73 7061 6e3e 203c 7370 616e  not exprs
│ │ │ │ +00007540: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ +00007560: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   _parse_
│ │ │ │ +00007580: 6578 7072 6573 7369 6f6e 733c 2f73 7061  expressions(self<
│ │ │ │ +000075c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ +000075e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2a  span class="o">*
│ │ │ │ +000075f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  expressio
│ │ │ │ +00007610: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063  ns):.        retur
│ │ │ │ +00007650: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n [.            ar
│ │ │ │ +00007690: 673c 2f73 7061 6e3e 0a20 2020 2020 2020  g.       
│ │ │ │ +000076a0: 2020 2020 203c 7370 616e 2063 6c61 7373       if <
│ │ │ │ +000076c0: 7370 616e 2063 6c61 7373 3d22 6e62 223e  span class="nb">
│ │ │ │ +000076d0: 6861 7361 7474 723c 2f73 7061 6e3e 3c73  hasattr(<
│ │ │ │ +000076f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>arg
│ │ │ │ +00007710: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00007720: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , "
│ │ │ │ +00007740: 7265 736f 6c76 655f 6578 7072 6573 7369  resolve_expressi
│ │ │ │ +00007750: 6f6e 2671 756f 743b 3c2f 7370 616e 3e3c  on"<
│ │ │ │ +00007760: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ +00007770: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +00007780: 2020 2020 3c73 7061 6e20 636c 6173 733d      else 
│ │ │ │ +000077a0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +000077b0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (F
│ │ │ │ +000077d0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +000077e0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (arg) if isinstance
│ │ │ │ +00007850: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +00007870: 7370 616e 2063 6c61 7373 3d22 6e22 3e61  span class="n">a
│ │ │ │ +00007880: 7267 3c2f 7370 616e 3e3c 7370 616e 2063  rg, str) else Value(<
│ │ │ │ +00007920: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>arg
│ │ │ │ +00007940: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00007950: 2929 3c2f 7370 616e 3e0a 2020 2020 2020  )).      
│ │ │ │ +00007960: 2020 2020 2020 3c73 7061 6e20 636c 6173        for
│ │ │ │ +00007980: 203c 7370 616e 2063 6c61 7373 3d22 6e22   arg in<
│ │ │ │ +000079b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> expressio
│ │ │ │ +000079d0: 6e73 3c2f 7370 616e 3e0a 2020 2020 2020  ns.      
│ │ │ │ +000079e0: 2020 3c73 7061 6e20 636c 6173 733d 2270    ]..    
│ │ │ │ +00007a00: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +00007a10: 6465 663c 2f73 7061 6e3e 203c 7370 616e  def as_s
│ │ │ │ +00007a30: 716c 3c2f 7370 616e 3e3c 7370 616e 2063  ql(self, compiler, co
│ │ │ │ +00007ad0: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c  nnection<
│ │ │ │ +00007ae0: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ +00007af0: 3a3c 2f73 7061 6e3e 0a3c 7370 616e 2063  :.       
│ │ │ │ +00007b10: 203c 2f73 7061 6e3e 3c73 7061 6e20 636c   "&
│ │ │ │ +00007b30: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061  quot;".        Resp
│ │ │ │ +00007b60: 6f6e 7369 626c 6520 666f 7220 7265 7475  onsible for retu
│ │ │ │ +00007b70: 726e 696e 6720 6120 2873 716c 2c20 5b70  rning a (sql, [p
│ │ │ │ +00007b80: 6172 616d 735d 2920 7475 706c 6520 746f  arams]) tuple to
│ │ │ │ +00007b90: 2062 6520 696e 636c 7564 6564 3c2f 7370   be included.        in 
│ │ │ │ +00007bc0: 7468 6520 6375 7272 656e 7420 7175 6572  the current quer
│ │ │ │ +00007bd0: 792e 3c2f 7370 616e 3e0a 0a3c 7370 616e  y...    
│ │ │ │ +00007bf0: 2020 2020 4469 6666 6572 656e 7420 6261      Different ba
│ │ │ │ +00007c00: 636b 656e 6473 2063 616e 2070 726f 7669  ckends can provi
│ │ │ │ +00007c10: 6465 2074 6865 6972 206f 776e 2069 6d70  de their own imp
│ │ │ │ +00007c20: 6c65 6d65 6e74 6174 696f 6e2c 2062 793c  lementation, by<
│ │ │ │ +00007c30: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ +00007c50: 7072 6f76 6964 696e 6720 616e 2060 6173  providing an `as
│ │ │ │ +00007c60: 5f7b 7665 6e64 6f72 7d60 206d 6574 686f  _{vendor}` metho
│ │ │ │ +00007c70: 6420 616e 6420 7061 7463 6869 6e67 2074  d and patching t
│ │ │ │ +00007c80: 6865 2045 7870 7265 7373 696f 6e3a 3c2f  he Expression:..        
│ │ │ │ +00007cb0: 6060 603c 2f73 7061 6e3e 0a3c 7370 616e  ```.    
│ │ │ │ +00007cd0: 2020 2020 6465 6620 6f76 6572 7269 6465      def override
│ │ │ │ +00007ce0: 5f61 735f 7371 6c28 7365 6c66 2c20 636f  _as_sql(self, co
│ │ │ │ +00007cf0: 6d70 696c 6572 2c20 636f 6e6e 6563 7469  mpiler, connecti
│ │ │ │ +00007d00: 6f6e 293a 3c2f 7370 616e 3e0a 3c73 7061  on):.   
│ │ │ │ +00007d20: 2020 2020 2020 2020 2023 2063 7573 746f           # custo
│ │ │ │ +00007d30: 6d20 6c6f 6769 633c 2f73 7061 6e3e 0a3c  m logic.<
│ │ │ │ +00007d40: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ +00007d50: 2020 2020 2020 2020 2020 2020 7265 7475              retu
│ │ │ │ +00007d60: 726e 2073 7570 6572 2829 2e61 735f 7371  rn super().as_sq
│ │ │ │ +00007d70: 6c28 636f 6d70 696c 6572 2c20 636f 6e6e  l(compiler, conn
│ │ │ │ +00007d80: 6563 7469 6f6e 293c 2f73 7061 6e3e 0a3c  ection).<
│ │ │ │ +00007d90: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ +00007da0: 2020 2020 2020 2020 7365 7461 7474 7228          setattr(
│ │ │ │ +00007db0: 4578 7072 6573 7369 6f6e 2c20 2623 3339  Expression, '
│ │ │ │ +00007dc0: 3b61 735f 2623 3339 3b20 2b20 636f 6e6e  ;as_' + conn
│ │ │ │ +00007dd0: 6563 7469 6f6e 2e76 656e 646f 722c 206f  ection.vendor, o
│ │ │ │ +00007de0: 7665 7272 6964 655f 6173 5f73 716c 293c  verride_as_sql)<
│ │ │ │ +00007df0: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ +00007e10: 6060 603c 2f73 7061 6e3e 0a0a 3c73 7061  ```..   
│ │ │ │ +00007e30: 2020 2020 2041 7267 756d 656e 7473 3a3c       Arguments:<
│ │ │ │ +00007e40: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ +00007e60: 202a 2063 6f6d 7069 6c65 723a 2074 6865   * compiler: the
│ │ │ │ +00007e70: 2071 7565 7279 2063 6f6d 7069 6c65 7220   query compiler 
│ │ │ │ +00007e80: 7265 7370 6f6e 7369 626c 6520 666f 7220  responsible for 
│ │ │ │ +00007e90: 6765 6e65 7261 7469 6e67 2074 6865 2071  generating the q
│ │ │ │ +00007ea0: 7565 7279 2e3c 2f73 7061 6e3e 0a3c 7370  uery..  
│ │ │ │ +00007ec0: 2020 2020 2020 2020 204d 7573 7420 6861           Must ha
│ │ │ │ +00007ed0: 7665 2061 2063 6f6d 7069 6c65 206d 6574  ve a compile met
│ │ │ │ +00007ee0: 686f 642c 2072 6574 7572 6e69 6e67 2061  hod, returning a
│ │ │ │ +00007ef0: 2028 7371 6c2c 205b 7061 7261 6d73 5d29   (sql, [params])
│ │ │ │ +00007f00: 2074 7570 6c65 2e3c 2f73 7061 6e3e 0a3c   tuple..<
│ │ │ │ +00007f10: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ +00007f20: 2020 2020 2020 2020 2020 2043 616c 6c69             Calli
│ │ │ │ +00007f30: 6e67 2063 6f6d 7069 6c65 7228 7661 6c75  ng compiler(valu
│ │ │ │ +00007f40: 6529 2077 696c 6c20 7265 7475 726e 2061  e) will return a
│ │ │ │ +00007f50: 2071 756f 7465 6420 6076 616c 7565 602e   quoted `value`.
│ │ │ │ +00007f60: 3c2f 7370 616e 3e0a 0a3c 7370 616e 2063  ..      
│ │ │ │ +00007f80: 2020 202a 2063 6f6e 6e65 6374 696f 6e3a     * connection:
│ │ │ │ +00007f90: 2074 6865 2064 6174 6162 6173 6520 636f   the database co
│ │ │ │ +00007fa0: 6e6e 6563 7469 6f6e 2075 7365 6420 666f  nnection used fo
│ │ │ │ +00007fb0: 7220 7468 6520 6375 7272 656e 7420 7175  r the current qu
│ │ │ │ +00007fc0: 6572 792e 3c2f 7370 616e 3e0a 0a3c 7370  ery...  
│ │ │ │ +00007fe0: 2020 2020 2020 5265 7475 726e 3a20 2873        Return: (s
│ │ │ │ +00007ff0: 716c 2c20 7061 7261 6d73 293c 2f73 7061  ql, params).          Wh
│ │ │ │ +00008020: 6572 6520 6073 716c 6020 6973 2061 2073  ere `sql` is a s
│ │ │ │ +00008030: 7472 696e 6720 636f 6e74 6169 6e69 6e67  tring containing
│ │ │ │ +00008040: 206f 7264 6572 6564 2073 716c 2070 6172   ordered sql par
│ │ │ │ +00008050: 616d 6574 6572 7320 746f 2062 653c 2f73  ameters to be.          
│ │ │ │ +00008080: 7265 706c 6163 6564 2077 6974 6820 7468  replaced with th
│ │ │ │ +00008090: 6520 656c 656d 656e 7473 206f 6620 7468  e elements of th
│ │ │ │ +000080a0: 6520 6c69 7374 2060 7061 7261 6d73 602e  e list `params`.
│ │ │ │ +000080b0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .       
│ │ │ │ +000080d0: 2026 7175 6f74 3b26 7175 6f74 3b26 7175   ""&qu
│ │ │ │ +000080e0: 6f74 3b3c 2f73 7061 6e3e 0a20 2020 2020  ot;.     
│ │ │ │ +000080f0: 2020 203c 7370 616e 2063 6c61 7373 3d22     raise 
│ │ │ │ +00008110: 3c73 7061 6e20 636c 6173 733d 226e 6522  NotImplementedE
│ │ │ │ +00008130: 7272 6f72 3c2f 7370 616e 3e3c 7370 616e  rror("Subcla
│ │ │ │ +00008170: 7373 6573 206d 7573 7420 696d 706c 656d  sses must implem
│ │ │ │ +00008180: 656e 7420 6173 5f73 716c 2829 2671 756f  ent as_sql()&quo
│ │ │ │ +00008190: 743b 3c2f 7370 616e 3e3c 7370 616e 2063  t;)..    @cached_
│ │ │ │ +000081d0: 7072 6f70 6572 7479 3c2f 7370 616e 3e0a  property.
│ │ │ │ +000081e0: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ +00008200: 7370 616e 2063 6c61 7373 3d22 6e66 223e  span class="nf">
│ │ │ │ +00008210: 636f 6e74 6169 6e73 5f61 6767 7265 6761  contains_aggrega
│ │ │ │ +00008220: 7465 3c2f 7370 616e 3e3c 7370 616e 2063  te(self):<
│ │ │ │ +00008270: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ +00008280: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ +00008290: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn an
│ │ │ │ +000082b0: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c  y(
│ │ │ │ +000082d0: 0a20 2020 2020 2020 2020 2020 203c 7370  .            exp
│ │ │ │ +000082f0: 723c 2f73 7061 6e3e 203c 7370 616e 2063  r and expr
│ │ │ │ +00008330: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +00008340: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .contains
│ │ │ │ +00008360: 5f61 6767 7265 6761 7465 3c2f 7370 616e  _aggregate for exp
│ │ │ │ +000083a0: 723c 2f73 7061 6e3e 203c 7370 616e 2063  r in self
│ │ │ │ +000083e0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +000083f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .get_sour
│ │ │ │ +00008410: 6365 5f65 7870 7265 7373 696f 6e73 3c2f  ce_expressions(). 
│ │ │ │ +00008440: 2020 2020 2020 203c 7370 616e 2063 6c61         ).
│ │ │ │ +00008460: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    @cached_pr
│ │ │ │ +00008480: 6f70 6572 7479 3c2f 7370 616e 3e0a 2020  operty.  
│ │ │ │ +00008490: 2020 3c73 7061 6e20 636c 6173 733d 226b    def co
│ │ │ │ +000084c0: 6e74 6169 6e73 5f6f 7665 725f 636c 6175  ntains_over_clau
│ │ │ │ +000084d0: 7365 3c2f 7370 616e 3e3c 7370 616e 2063  se(self):<
│ │ │ │ +00008520: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ +00008530: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ +00008540: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn an
│ │ │ │ +00008560: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c  y(
│ │ │ │ +00008580: 0a20 2020 2020 2020 2020 2020 203c 7370  .            exp
│ │ │ │ +000085a0: 723c 2f73 7061 6e3e 203c 7370 616e 2063  r and expr
│ │ │ │ +000085e0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +000085f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .contains
│ │ │ │ +00008610: 5f6f 7665 725f 636c 6175 7365 3c2f 7370  _over_clause for <
│ │ │ │ +00008640: 7370 616e 2063 6c61 7373 3d22 6e22 3e65  span class="n">e
│ │ │ │ +00008650: 7870 723c 2f73 7061 6e3e 203c 7370 616e  xpr in self.get_so
│ │ │ │ +000086c0: 7572 6365 5f65 7870 7265 7373 696f 6e73  urce_expressions
│ │ │ │ +000086d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ()
│ │ │ │ +000086f0: 0a20 2020 2020 2020 203c 7370 616e 2063  .        )..    @cached_
│ │ │ │ +00008730: 7072 6f70 6572 7479 3c2f 7370 616e 3e0a  property.
│ │ │ │ +00008740: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ +00008760: 7370 616e 2063 6c61 7373 3d22 6e66 223e  span class="nf">
│ │ │ │ +00008770: 636f 6e74 6169 6e73 5f63 6f6c 756d 6e5f  contains_column_
│ │ │ │ +00008780: 7265 6665 7265 6e63 6573 3c2f 7370 616e  references(self):. 
│ │ │ │ +000087e0: 2020 2020 2020 203c 7370 616e 2063 6c61         return any
│ │ │ │ +00008820: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00008830: 283c 2f73 7061 6e3e 0a20 2020 2020 2020  (.       
│ │ │ │ +00008840: 2020 2020 203c 7370 616e 2063 6c61 7373       expr
│ │ │ │ +00008860: 203c 7370 616e 2063 6c61 7373 3d22 6f77   and exp
│ │ │ │ +00008890: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r.
│ │ │ │ +000088b0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +000088c0: 636f 6e74 6169 6e73 5f63 6f6c 756d 6e5f  contains_column_
│ │ │ │ +000088d0: 7265 6665 7265 6e63 6573 3c2f 7370 616e  references.            fo
│ │ │ │ +00008900: 723c 2f73 7061 6e3e 203c 7370 616e 2063  r expr in 
│ │ │ │ +00008940: 3c73 7061 6e20 636c 6173 733d 2262 7022  self.get_source_e
│ │ │ │ +00008990: 7870 7265 7373 696f 6e73 3c2f 7370 616e  xpressions().     
│ │ │ │ +000089c0: 2020 203c 7370 616e 2063 6c61 7373 3d22     )..   
│ │ │ │ +000089e0: 203c 7370 616e 2063 6c61 7373 3d22 6e64   @cached_proper
│ │ │ │ +00008a00: 7479 3c2f 7370 616e 3e0a 2020 2020 3c73  ty.    de
│ │ │ │ +00008a20: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f contai
│ │ │ │ +00008a40: 6e73 5f73 7562 7175 6572 793c 2f73 7061  ns_subquery(self<
│ │ │ │ +00008a80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>):.
│ │ │ │ +00008aa0: 2020 2020 2020 2020 3c73 7061 6e20 636c          return any(.      
│ │ │ │ +00008b00: 2020 2020 2020 3c73 7061 6e20 636c 6173        expr and (<
│ │ │ │ +00008b50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>getattr(exp
│ │ │ │ +00008ba0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r,
│ │ │ │ +00008bc0: 203c 7370 616e 2063 6c61 7373 3d22 7332   "subquery
│ │ │ │ +00008be0: 2671 756f 743b 3c2f 7370 616e 3e3c 7370  ", False) or<
│ │ │ │ +00008c50: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> expr.contai
│ │ │ │ +00008ca0: 6e73 5f73 7562 7175 6572 793c 2f73 7061  ns_subquery).     
│ │ │ │ +00008cd0: 2020 2020 2020 203c 7370 616e 2063 6c61         for expr i
│ │ │ │ +00008d20: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n self.get
│ │ │ │ +00008d70: 5f73 6f75 7263 655f 6578 7072 6573 7369  _source_expressi
│ │ │ │ +00008d80: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20  ons().        )..    def resolve_ex
│ │ │ │ +00008e00: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c  pression<
│ │ │ │ +00008e10: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +00008e20: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +00008e30: 3c73 7061 6e20 636c 6173 733d 2262 7022  self, query=None, al
│ │ │ │ +00008ee0: 6c6f 775f 6a6f 696e 733c 2f73 7061 6e3e  low_joins
│ │ │ │ +00008ef0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +00008f00: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c  =True, reu
│ │ │ │ +00008f50: 7365 3c2f 7370 616e 3e3c 7370 616e 2063  se=None, summarize<
│ │ │ │ +00008fc0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>=F
│ │ │ │ +00008ff0: 616c 7365 3c2f 7370 616e 3e3c 7370 616e  alse, for_save=Fals
│ │ │ │ +00009060: 653c 2f73 7061 6e3e 0a20 2020 203c 7370  e.    ):<
│ │ │ │ +00009080: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        <
│ │ │ │ +000090a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>"&qu
│ │ │ │ +000090c0: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e  ot;"
│ │ │ │ +000090d0: 0a3c 7370 616e 2063 6c61 7373 3d22 7364  .        Provid
│ │ │ │ +000090f0: 6520 7468 6520 6368 616e 6365 2074 6f20  e the chance to 
│ │ │ │ +00009100: 646f 2061 6e79 2070 7265 7072 6f63 6573  do any preproces
│ │ │ │ +00009110: 7369 6e67 206f 7220 7661 6c69 6461 7469  sing or validati
│ │ │ │ +00009120: 6f6e 2062 6566 6f72 6520 6265 696e 673c  on before being<
│ │ │ │ +00009130: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ +00009150: 6164 6465 6420 746f 2074 6865 2071 7565  added to the que
│ │ │ │ +00009160: 7279 2e3c 2f73 7061 6e3e 0a0a 3c73 7061  ry...   
│ │ │ │ +00009180: 2020 2020 2041 7267 756d 656e 7473 3a3c       Arguments:<
│ │ │ │ +00009190: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ +000091b0: 202a 2071 7565 7279 3a20 7468 6520 6261   * query: the ba
│ │ │ │ +000091c0: 636b 656e 6420 7175 6572 7920 696d 706c  ckend query impl
│ │ │ │ +000091d0: 656d 656e 7461 7469 6f6e 3c2f 7370 616e  ementation.         * al
│ │ │ │ +00009200: 6c6f 775f 6a6f 696e 733a 2062 6f6f 6c65  low_joins: boole
│ │ │ │ +00009210: 616e 2061 6c6c 6f77 696e 6720 6f72 2064  an allowing or d
│ │ │ │ +00009220: 656e 7969 6e67 2075 7365 206f 6620 6a6f  enying use of jo
│ │ │ │ +00009230: 696e 733c 2f73 7061 6e3e 0a3c 7370 616e  ins.    
│ │ │ │ +00009250: 2020 2020 2020 2069 6e20 7468 6973 2071         in this q
│ │ │ │ +00009260: 7565 7279 3c2f 7370 616e 3e0a 3c73 7061  uery.   
│ │ │ │ +00009280: 2020 2020 2020 2a20 7265 7573 653a 2061        * reuse: a
│ │ │ │ +00009290: 2073 6574 206f 6620 7265 7573 6162 6c65   set of reusable
│ │ │ │ +000092a0: 206a 6f69 6e73 2066 6f72 206d 756c 7469   joins for multi
│ │ │ │ +000092b0: 6a6f 696e 733c 2f73 7061 6e3e 0a3c 7370  joins.  
│ │ │ │ +000092d0: 2020 2020 2020 202a 2073 756d 6d61 7269         * summari
│ │ │ │ +000092e0: 7a65 3a20 6120 7465 726d 696e 616c 2061  ze: a terminal a
│ │ │ │ +000092f0: 6767 7265 6761 7465 2063 6c61 7573 653c  ggregate clause<
│ │ │ │ +00009300: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ +00009320: 202a 2066 6f72 5f73 6176 653a 2077 6865   * for_save: whe
│ │ │ │ +00009330: 7468 6572 2074 6869 7320 6578 7072 6573  ther this expres
│ │ │ │ +00009340: 7369 6f6e 2061 626f 7574 2074 6f20 6265  sion about to be
│ │ │ │ +00009350: 2075 7365 6420 696e 2061 2073 6176 6520   used in a save 
│ │ │ │ +00009360: 6f72 2075 7064 6174 653c 2f73 7061 6e3e  or update
│ │ │ │ +00009370: 0a0a 3c73 7061 6e20 636c 6173 733d 2273  ..        Retur
│ │ │ │ +00009390: 6e3a 2061 6e20 4578 7072 6573 7369 6f6e  n: an Expression
│ │ │ │ +000093a0: 2074 6f20 6265 2061 6464 6564 2074 6f20   to be added to 
│ │ │ │ +000093b0: 7468 6520 7175 6572 792e 3c2f 7370 616e  the query..        "
│ │ │ │ +000093e0: 3b26 7175 6f74 3b26 7175 6f74 3b3c 2f73  ;"".        c = <
│ │ │ │ +00009430: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +00009440: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self.copy()
│ │ │ │ +00009490: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +000094a0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +000094b0: 633c 2f73 7061 6e3e 3c73 7061 6e20 636c  c.
│ │ │ │ +000094d0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +000094e0: 6973 5f73 756d 6d61 7279 3c2f 7370 616e  is_summary = summa
│ │ │ │ +00009520: 7269 7a65 3c2f 7370 616e 3e0a 2020 2020  rize.    
│ │ │ │ +00009530: 2020 2020 3c73 7061 6e20 636c 6173 733d      c.set_source_e
│ │ │ │ +00009580: 7870 7265 7373 696f 6e73 3c2f 7370 616e  xpressions(.      
│ │ │ │ +000095b0: 2020 2020 2020 3c73 7061 6e20 636c 6173        [. 
│ │ │ │ +000095d0: 2020 2020 2020 2020 2020 2020 2020 203c                 <
│ │ │ │ +000095e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65  span class="n">e
│ │ │ │ +000095f0: 7870 723c 2f73 7061 6e3e 3c73 7061 6e20  xpr.resolve_expres
│ │ │ │ +00009630: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e  sion(, reus
│ │ │ │ -00009680: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e,
│ │ │ │ -000096a0: 203c 7370 616e 2063 6c61 7373 3d22 6e22   summarize).      
│ │ │ │ -000096e0: 2020 2020 2020 2020 2020 3c73 7061 6e20            if expr.
│ │ │ │ -00009720: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ -00009730: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -00009740: 656c 7365 3c2f 7370 616e 3e20 3c73 7061  else Non
│ │ │ │ -00009760: 653c 2f73 7061 6e3e 0a20 2020 2020 2020  e.       
│ │ │ │ -00009770: 2020 2020 2020 2020 203c 7370 616e 2063           for expr 
│ │ │ │ -000097b0: 3c73 7061 6e20 636c 6173 733d 226f 7722  in c.get_s
│ │ │ │ -00009810: 6f75 7263 655f 6578 7072 6573 7369 6f6e  ource_expression
│ │ │ │ -00009820: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s().            ]<
│ │ │ │ -00009860: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ -00009870: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -00009880: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -00009890: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -000098a0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return c<
│ │ │ │ -000098c0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061  /span>..    @pr
│ │ │ │ -000098e0: 6f70 6572 7479 3c2f 7370 616e 3e0a 2020  operty.  
│ │ │ │ -000098f0: 2020 3c73 7061 6e20 636c 6173 733d 226b    def co
│ │ │ │ -00009920: 6e64 6974 696f 6e61 6c3c 2f73 7061 6e3e  nditional
│ │ │ │ -00009930: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00009940: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self):.  
│ │ │ │ -00009980: 2020 2020 2020 3c73 7061 6e20 636c 6173        return isinstance<
│ │ │ │ -000099c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(s
│ │ │ │ -000099f0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf.output_fieldquery<
│ │ │ │ +00009670: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +00009680: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   allow_jo
│ │ │ │ +000096a0: 696e 733c 2f73 7061 6e3e 3c73 7061 6e20  ins, reuse<
│ │ │ │ +000096e0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +000096f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   summariz
│ │ │ │ +00009710: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e)
│ │ │ │ +00009730: 0a20 2020 2020 2020 2020 2020 2020 2020  .               
│ │ │ │ +00009740: 203c 7370 616e 2063 6c61 7373 3d22 6b22   if expr<
│ │ │ │ +00009770: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ +00009780: 2020 2020 2020 203c 7370 616e 2063 6c61         else None.
│ │ │ │ +000097c0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +000097d0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +000097e0: 666f 723c 2f73 7061 6e3e 203c 7370 616e  for expr<
│ │ │ │ +00009800: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> in c.get_source_exp
│ │ │ │ +00009870: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c  ressions<
│ │ │ │ +00009880: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +00009890: 293c 2f73 7061 6e3e 0a20 2020 2020 2020  ).       
│ │ │ │ +000098a0: 2020 2020 203c 7370 616e 2063 6c61 7373       ].  
│ │ │ │ +000098c0: 2020 2020 2020 3c73 7061 6e20 636c 6173        ). 
│ │ │ │ +000098e0: 2020 2020 2020 203c 7370 616e 2063 6c61         return c.. 
│ │ │ │ +00009920: 2020 203c 7370 616e 2063 6c61 7373 3d22     @property.    def conditional
│ │ │ │ +00009980: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +000099a0: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +000099b0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self):.        ret
│ │ │ │ +000099f0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e  urn isin
│ │ │ │ +00009a10: 7374 616e 6365 3c2f 7370 616e 3e3c 7370  stance(, fi
│ │ │ │ -00009a60: 656c 6473 3c2f 7370 616e 3e3c 7370 616e  elds.BooleanField<
│ │ │ │ -00009aa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>)..
│ │ │ │ -00009ac0: 2020 2020 3c73 7061 6e20 636c 6173 733d      @property.    def field(self<
│ │ │ │ -00009b50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>):.
│ │ │ │ -00009b70: 2020 2020 2020 2020 3c73 7061 6e20 636c          return self.output
│ │ │ │ -00009be0: 5f66 6965 6c64 3c2f 7370 616e 3e0a 0a20  _field.. 
│ │ │ │ -00009bf0: 2020 203c 7370 616e 2063 6c61 7373 3d22     @cached_prop
│ │ │ │ -00009c10: 6572 7479 3c2f 7370 616e 3e0a 2020 2020  erty.    
│ │ │ │ -00009c20: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -00009c30: 6465 663c 2f73 7061 6e3e 203c 7370 616e  def outp
│ │ │ │ -00009c50: 7574 5f66 6965 6c64 3c2f 7370 616e 3e3c  ut_field<
│ │ │ │ -00009c60: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ -00009c70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self):.   
│ │ │ │ -00009cc0: 2020 2020 203c 2f73 7061 6e3e 3c73 7061       &qu
│ │ │ │ -00009ce0: 6f74 3b26 7175 6f74 3b26 7175 6f74 3b52  ot;""R
│ │ │ │ -00009cf0: 6574 7572 6e20 7468 6520 6f75 7470 7574  eturn the output
│ │ │ │ -00009d00: 2074 7970 6520 6f66 2074 6869 7320 6578   type of this ex
│ │ │ │ -00009d10: 7072 6573 7369 6f6e 732e 2671 756f 743b  pressions."
│ │ │ │ -00009d20: 2671 756f 743b 2671 756f 743b 3c2f 7370  "".        outp
│ │ │ │ -00009d50: 7574 5f66 6965 6c64 3c2f 7370 616e 3e20  ut_field 
│ │ │ │ -00009d60: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ -00009d70: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063  = self._re
│ │ │ │ -00009dc0: 736f 6c76 655f 6f75 7470 7574 5f66 6965  solve_output_fie
│ │ │ │ -00009dd0: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063  ld().        if output_fiel
│ │ │ │ -00009e30: 643c 2f73 7061 6e3e 203c 7370 616e 2063  d is None
│ │ │ │ -00009e70: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -00009e80: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ -00009e90: 2020 2020 203c 7370 616e 2063 6c61 7373       self._output
│ │ │ │ -00009ee0: 5f66 6965 6c64 5f72 6573 6f6c 7665 645f  _field_resolved_
│ │ │ │ -00009ef0: 746f 5f6e 6f6e 653c 2f73 7061 6e3e 203c  to_none <
│ │ │ │ -00009f00: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d  span class="o">=
│ │ │ │ -00009f10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   True.           
│ │ │ │ -00009f40: 203c 7370 616e 2063 6c61 7373 3d22 6b22   raise Fi
│ │ │ │ -00009f70: 656c 6445 7272 6f72 3c2f 7370 616e 3e3c  eldError<
│ │ │ │ -00009f80: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ -00009f90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  "Ca
│ │ │ │ -00009fb0: 6e6e 6f74 2072 6573 6f6c 7665 2065 7870  nnot resolve exp
│ │ │ │ -00009fc0: 7265 7373 696f 6e20 7479 7065 2c20 756e  ression type, un
│ │ │ │ -00009fd0: 6b6e 6f77 6e20 6f75 7470 7574 5f66 6965  known output_fie
│ │ │ │ -00009fe0: 6c64 2671 756f 743b 3c2f 7370 616e 3e3c  ld"<
│ │ │ │ -00009ff0: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -0000a000: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -0000a010: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -0000a020: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return ou
│ │ │ │ -0000a040: 7470 7574 5f66 6965 6c64 3c2f 7370 616e  tput_field..    @cached_
│ │ │ │ -0000a070: 7072 6f70 6572 7479 3c2f 7370 616e 3e0a  property.
│ │ │ │ -0000a080: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ -0000a0a0: 7370 616e 2063 6c61 7373 3d22 6e66 223e  span class="nf">
│ │ │ │ -0000a0b0: 5f6f 7574 7075 745f 6669 656c 645f 6f72  _output_field_or
│ │ │ │ -0000a0c0: 5f6e 6f6e 653c 2f73 7061 6e3e 3c73 7061  _none(self
│ │ │ │ -0000a100: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000a110: 293a 3c2f 7370 616e 3e0a 3c73 7061 6e20  ):.      
│ │ │ │ -0000a130: 2020 3c2f 7370 616e 3e3c 7370 616e 2063    "
│ │ │ │ -0000a150: 2671 756f 743b 2671 756f 743b 3c2f 7370  "".        Ret
│ │ │ │ -0000a180: 7572 6e20 7468 6520 6f75 7470 7574 2066  urn the output f
│ │ │ │ -0000a190: 6965 6c64 206f 6620 7468 6973 2065 7870  ield of this exp
│ │ │ │ -0000a1a0: 7265 7373 696f 6e2c 206f 7220 4e6f 6e65  ression, or None
│ │ │ │ -0000a1b0: 2069 663c 2f73 7061 6e3e 0a3c 7370 616e   if.self.output_
│ │ │ │ +00009a80: 6669 656c 643c 2f73 7061 6e3e 3c73 7061  field, fields.Boolea
│ │ │ │ +00009af0: 6e46 6965 6c64 3c2f 7370 616e 3e3c 7370  nField)..    @pro
│ │ │ │ +00009b30: 7065 7274 793c 2f73 7061 6e3e 0a20 2020  perty.   
│ │ │ │ +00009b40: 203c 7370 616e 2063 6c61 7373 3d22 6b22   def fie
│ │ │ │ +00009b70: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063  ld(self):<
│ │ │ │ +00009bc0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ +00009bd0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ +00009be0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn se
│ │ │ │ +00009c00: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.output_field..    @cach
│ │ │ │ +00009c60: 6564 5f70 726f 7065 7274 793c 2f73 7061  ed_property.    def output_field<
│ │ │ │ +00009cb0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(s
│ │ │ │ +00009ce0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf):.        ""
│ │ │ │ +00009d40: 2671 756f 743b 5265 7475 726e 2074 6865  "Return the
│ │ │ │ +00009d50: 206f 7574 7075 7420 7479 7065 206f 6620   output type of 
│ │ │ │ +00009d60: 7468 6973 2065 7870 7265 7373 696f 6e73  this expressions
│ │ │ │ +00009d70: 2e26 7175 6f74 3b26 7175 6f74 3b26 7175  .""&qu
│ │ │ │ +00009d80: 6f74 3b3c 2f73 7061 6e3e 0a20 2020 2020  ot;.     
│ │ │ │ +00009d90: 2020 203c 7370 616e 2063 6c61 7373 3d22     output_field<
│ │ │ │ +00009db0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> = 
│ │ │ │ +00009dd0: 3c73 7061 6e20 636c 6173 733d 2262 7022  self._resolve_out
│ │ │ │ +00009e20: 7075 745f 6669 656c 643c 2f73 7061 6e3e  put_field
│ │ │ │ +00009e30: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +00009e40: 2829 3c2f 7370 616e 3e0a 2020 2020 2020  ().      
│ │ │ │ +00009e50: 2020 3c73 7061 6e20 636c 6173 733d 226b    if outp
│ │ │ │ +00009e80: 7574 5f66 6965 6c64 3c2f 7370 616e 3e20  ut_field 
│ │ │ │ +00009e90: 3c73 7061 6e20 636c 6173 733d 226f 7722  is None
│ │ │ │ +00009ec0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  :.
│ │ │ │ +00009ee0: 2020 2020 2020 2020 2020 2020 3c73 7061              sel
│ │ │ │ +00009f00: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f.
│ │ │ │ +00009f20: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +00009f30: 5f6f 7574 7075 745f 6669 656c 645f 7265  _output_field_re
│ │ │ │ +00009f40: 736f 6c76 6564 5f74 6f5f 6e6f 6e65 3c2f  solved_to_none = <
│ │ │ │ +00009f70: 7370 616e 2063 6c61 7373 3d22 6b63 223e  span class="kc">
│ │ │ │ +00009f80: 5472 7565 3c2f 7370 616e 3e0a 2020 2020  True.    
│ │ │ │ +00009f90: 2020 2020 2020 2020 3c73 7061 6e20 636c          raise FieldError<
│ │ │ │ +00009fd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(&
│ │ │ │ +0000a000: 7175 6f74 3b43 616e 6e6f 7420 7265 736f  quot;Cannot reso
│ │ │ │ +0000a010: 6c76 6520 6578 7072 6573 7369 6f6e 2074  lve expression t
│ │ │ │ +0000a020: 7970 652c 2075 6e6b 6e6f 776e 206f 7574  ype, unknown out
│ │ │ │ +0000a030: 7075 745f 6669 656c 6426 7175 6f74 3b3c  put_field"<
│ │ │ │ +0000a040: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>). 
│ │ │ │ +0000a060: 2020 2020 2020 203c 7370 616e 2063 6c61         return output_fiel
│ │ │ │ +0000a0a0: 643c 2f73 7061 6e3e 0a0a 2020 2020 3c73  d..    @
│ │ │ │ +0000a0c0: 6361 6368 6564 5f70 726f 7065 7274 793c  cached_property<
│ │ │ │ +0000a0d0: 2f73 7061 6e3e 0a20 2020 203c 7370 616e  /span>.    def _output_f
│ │ │ │ +0000a110: 6965 6c64 5f6f 725f 6e6f 6e65 3c2f 7370  ield_or_none(self
│ │ │ │ +0000a150: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ +0000a170: 0a3c 7370 616e 2063 6c61 7373 3d22 7722  .        
│ │ │ │ +0000a190: 3c73 7061 6e20 636c 6173 733d 2273 6422  ""&qu
│ │ │ │ +0000a1b0: 6f74 3b3c 2f73 7061 6e3e 0a3c 7370 616e  ot;.    
│ │ │ │ -0000a1d0: 2020 2020 5f72 6573 6f6c 7665 5f6f 7574      _resolve_out
│ │ │ │ -0000a1e0: 7075 745f 6669 656c 6428 2920 6469 646e  put_field() didn
│ │ │ │ -0000a1f0: 2623 3339 3b74 2072 6574 7572 6e20 616e  't return an
│ │ │ │ -0000a200: 206f 7574 7075 7420 7479 7065 2e3c 2f73   output type..        &q
│ │ │ │ -0000a230: 756f 743b 2671 756f 743b 2671 756f 743b  uot;""
│ │ │ │ -0000a240: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -0000a250: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -0000a260: 7472 793c 2f73 7061 6e3e 3c73 7061 6e20  try:.            <
│ │ │ │ -0000a290: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ -0000a2a0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn se
│ │ │ │ -0000a2c0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.output_field.        exc
│ │ │ │ -0000a320: 6570 743c 2f73 7061 6e3e 203c 7370 616e  ept Field
│ │ │ │ -0000a340: 4572 726f 723c 2f73 7061 6e3e 3c73 7061  Error:.           
│ │ │ │ -0000a370: 203c 7370 616e 2063 6c61 7373 3d22 6b22   if not<
│ │ │ │ -0000a3a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self._outp
│ │ │ │ -0000a3f0: 7574 5f66 6965 6c64 5f72 6573 6f6c 7665  ut_field_resolve
│ │ │ │ -0000a400: 645f 746f 5f6e 6f6e 653c 2f73 7061 6e3e  d_to_none
│ │ │ │ -0000a410: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000a420: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ -0000a430: 2020 2020 2020 2020 203c 7370 616e 2063           raise..    def _resolve_
│ │ │ │ -0000a490: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370  output_field(self
│ │ │ │ -0000a4d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ -0000a4f0: 0a3c 7370 616e 2063 6c61 7373 3d22 7722  .        
│ │ │ │ -0000a510: 3c73 7061 6e20 636c 6173 733d 2273 6422  ""&qu
│ │ │ │ -0000a530: 6f74 3b3c 2f73 7061 6e3e 0a3c 7370 616e  ot;.    
│ │ │ │ -0000a550: 2020 2020 4174 7465 6d70 7420 746f 2069      Attempt to i
│ │ │ │ -0000a560: 6e66 6572 2074 6865 206f 7574 7075 7420  nfer the output 
│ │ │ │ -0000a570: 7479 7065 206f 6620 7468 6520 6578 7072  type of the expr
│ │ │ │ -0000a580: 6573 7369 6f6e 2e3c 2f73 7061 6e3e 0a0a  ession...
│ │ │ │ -0000a590: 3c73 7061 6e20 636c 6173 733d 2273 6422          As a gu
│ │ │ │ -0000a5b0: 6573 732c 2069 6620 7468 6520 6f75 7470  ess, if the outp
│ │ │ │ -0000a5c0: 7574 2066 6965 6c64 7320 6f66 2061 6c6c  ut fields of all
│ │ │ │ -0000a5d0: 2073 6f75 7263 6520 6669 656c 6473 206d   source fields m
│ │ │ │ -0000a5e0: 6174 6368 2074 6865 6e20 7369 6d70 6c79  atch then simply
│ │ │ │ -0000a5f0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .       
│ │ │ │ -0000a610: 2069 6e66 6572 2074 6865 2073 616d 6520   infer the same 
│ │ │ │ -0000a620: 7479 7065 2068 6572 652e 3c2f 7370 616e  type here...        If a
│ │ │ │ -0000a650: 2073 6f75 7263 6526 2333 393b 7320 6f75   source's ou
│ │ │ │ -0000a660: 7470 7574 2066 6965 6c64 2072 6573 6f6c  tput field resol
│ │ │ │ -0000a670: 7665 7320 746f 204e 6f6e 652c 2065 7863  ves to None, exc
│ │ │ │ -0000a680: 6c75 6465 2069 7420 6672 6f6d 2074 6869  lude it from thi
│ │ │ │ -0000a690: 7320 6368 6563 6b2e 3c2f 7370 616e 3e0a  s check..
│ │ │ │ -0000a6a0: 3c73 7061 6e20 636c 6173 733d 2273 6422          If all 
│ │ │ │ -0000a6c0: 736f 7572 6365 7320 6172 6520 4e6f 6e65  sources are None
│ │ │ │ -0000a6d0: 2c20 7468 656e 2061 6e20 6572 726f 7220  , then an error 
│ │ │ │ -0000a6e0: 6973 2072 6169 7365 6420 6869 6768 6572  is raised higher
│ │ │ │ -0000a6f0: 2075 7020 7468 6520 7374 6163 6b20 696e   up the stack in
│ │ │ │ -0000a700: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .       
│ │ │ │ -0000a720: 2074 6865 206f 7574 7075 745f 6669 656c   the output_fiel
│ │ │ │ -0000a730: 6420 7072 6f70 6572 7479 2e3c 2f73 7061  d property..        &quo
│ │ │ │ -0000a760: 743b 2671 756f 743b 2671 756f 743b 3c2f  t;"".        #
│ │ │ │ -0000a790: 2054 6869 7320 6775 6573 7320 6973 206d   This guess is m
│ │ │ │ -0000a7a0: 6f73 746c 7920 6120 6261 6420 6964 6561  ostly a bad idea
│ │ │ │ -0000a7b0: 2c20 6275 7420 7468 6572 6520 6973 2071  , but there is q
│ │ │ │ -0000a7c0: 7569 7465 2061 206c 6f74 206f 6620 636f  uite a lot of co
│ │ │ │ -0000a7d0: 6465 3c2f 7370 616e 3e0a 2020 2020 2020  de.      
│ │ │ │ -0000a7e0: 2020 3c73 7061 6e20 636c 6173 733d 2263    # (especially
│ │ │ │ -0000a800: 2033 7264 2070 6172 7479 2046 756e 6320   3rd party Func 
│ │ │ │ -0000a810: 7375 6263 6c61 7373 6573 2920 7468 6174  subclasses) that
│ │ │ │ -0000a820: 2064 6570 656e 6420 6f6e 2069 742c 2077   depend on it, w
│ │ │ │ -0000a830: 6526 2333 393b 6420 6e65 6564 2061 3c2f  e'd need a.        #
│ │ │ │ -0000a860: 2064 6570 7265 6361 7469 6f6e 2070 6174   deprecation pat
│ │ │ │ -0000a870: 6820 746f 2066 6978 2069 742e 3c2f 7370  h to fix it..        sour
│ │ │ │ -0000a8a0: 6365 735f 6974 6572 3c2f 7370 616e 3e20  ces_iter 
│ │ │ │ -0000a8b0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ -0000a8c0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063  = (.            so
│ │ │ │ -0000a900: 7572 6365 3c2f 7370 616e 3e20 3c73 7061  urce for<
│ │ │ │ -0000a920: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> source in 
│ │ │ │ -0000a960: 3c73 7061 6e20 636c 6173 733d 2262 7022  self.get_source_f
│ │ │ │ -0000a9b0: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061  ields() if 
│ │ │ │ -0000a9f0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000aa00: 736f 7572 6365 3c2f 7370 616e 3e20 3c73  source i
│ │ │ │ -0000aa20: 733c 2f73 7061 6e3e 203c 7370 616e 2063  s not None.        ).        for output_fie
│ │ │ │ -0000aac0: 6c64 3c2f 7370 616e 3e20 3c73 7061 6e20  ld in sources_ite
│ │ │ │ -0000ab00: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r:
│ │ │ │ -0000ab20: 0a20 2020 2020 2020 2020 2020 203c 7370  .            for
│ │ │ │ -0000ab40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   source in
│ │ │ │ -0000ab80: 203c 7370 616e 2063 6c61 7373 3d22 6e22   sources_iter:.   
│ │ │ │ -0000abc0: 2020 2020 2020 2020 2020 2020 203c 7370               if<
│ │ │ │ -0000abe0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> not isinstance(out
│ │ │ │ -0000ac50: 7075 745f 6669 656c 643c 2f73 7061 6e3e  put_field
│ │ │ │ -0000ac60: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000ac70: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , source<
│ │ │ │ -0000ac90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>._
│ │ │ │ -0000acc0: 5f63 6c61 7373 5f5f 3c2f 7370 616e 3e3c  _class__<
│ │ │ │ -0000acd0: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -0000ace0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ -0000acf0: 2020 2020 2020 2020 2020 2020 203c 7370               rai
│ │ │ │ -0000ad10: 7365 3c2f 7370 616e 3e20 3c73 7061 6e20  se FieldE
│ │ │ │ -0000ad30: 7272 6f72 3c2f 7370 616e 3e3c 7370 616e  rror(.            
│ │ │ │ -0000ad60: 2020 2020 2020 2020 2020 2020 3c73 7061              &qu
│ │ │ │ -0000ad80: 6f74 3b45 7870 7265 7373 696f 6e20 636f  ot;Expression co
│ │ │ │ -0000ad90: 6e74 6169 6e73 206d 6978 6564 2074 7970  ntains mixed typ
│ │ │ │ -0000ada0: 6573 3a20 3c2f 7370 616e 3e3c 7370 616e  es: %s, <
│ │ │ │ -0000ade0: 7370 616e 2063 6c61 7373 3d22 7369 223e  span class="si">
│ │ │ │ -0000adf0: 2573 3c2f 7370 616e 3e3c 7370 616e 2063  %s. You 
│ │ │ │ -0000ae10: 6d75 7374 2026 7175 6f74 3b3c 2f73 7061  must ".             
│ │ │ │ -0000ae30: 2020 2020 2020 2020 2020 203c 7370 616e             &quo
│ │ │ │ -0000ae50: 743b 7365 7420 6f75 7470 7574 5f66 6965  t;set output_fie
│ │ │ │ -0000ae60: 6c64 2e26 7175 6f74 3b3c 2f73 7061 6e3e  ld."
│ │ │ │ -0000ae70: 0a20 2020 2020 2020 2020 2020 2020 2020  .               
│ │ │ │ -0000ae80: 2020 2020 2020 2020 203c 7370 616e 2063           % (.     
│ │ │ │ -0000aec0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ -0000aed0: 2020 2020 2020 203c 7370 616e 2063 6c61         output_fi
│ │ │ │ -0000aef0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20  eld.__class__.__na
│ │ │ │ -0000af60: 6d65 5f5f 3c2f 7370 616e 3e3c 7370 616e  me__,.            
│ │ │ │ -0000af90: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ -0000afa0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000afb0: 736f 7572 6365 3c2f 7370 616e 3e3c 7370  source.__class__<
│ │ │ │ -0000aff0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>._
│ │ │ │ -0000b020: 5f6e 616d 655f 5f3c 2f73 7061 6e3e 3c73  _name__,<
│ │ │ │ -0000b040: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ -0000b050: 2020 2020 2020 2020 2020 2020 2020 203c                 <
│ │ │ │ -0000b060: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -0000b070: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -0000b080: 2020 2020 2020 2020 2020 2020 3c73 7061              ).           
│ │ │ │ -0000b0b0: 203c 7370 616e 2063 6c61 7373 3d22 6b22   return <
│ │ │ │ -0000b0d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f  span class="n">o
│ │ │ │ -0000b0e0: 7574 7075 745f 6669 656c 643c 2f73 7061  utput_field..    @static
│ │ │ │ -0000b110: 6d65 7468 6f64 3c2f 7370 616e 3e0a 2020  method.  
│ │ │ │ -0000b120: 2020 3c73 7061 6e20 636c 6173 733d 226b    def _c
│ │ │ │ -0000b150: 6f6e 7665 7274 5f76 616c 7565 5f6e 6f6f  onvert_value_noo
│ │ │ │ -0000b160: 703c 2f73 7061 6e3e 3c73 7061 6e20 636c  p(
│ │ │ │ -0000b180: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000b190: 7661 6c75 653c 2f73 7061 6e3e 3c73 7061  value, expression<
│ │ │ │ -0000b1d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>, <
│ │ │ │ -0000b1f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63  span class="n">c
│ │ │ │ -0000b200: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e  onnection
│ │ │ │ -0000b210: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000b220: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ -0000b230: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ -0000b250: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000b260: 7661 6c75 653c 2f73 7061 6e3e 0a0a 2020  value..  
│ │ │ │ -0000b270: 2020 3c73 7061 6e20 636c 6173 733d 226e    @cached_prope
│ │ │ │ -0000b290: 7274 793c 2f73 7061 6e3e 0a20 2020 203c  rty.    <
│ │ │ │ -0000b2a0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64  span class="k">d
│ │ │ │ -0000b2b0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20  ef conve
│ │ │ │ -0000b2d0: 7274 5f76 616c 7565 3c2f 7370 616e 3e3c  rt_value<
│ │ │ │ -0000b2e0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ -0000b2f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self):.   
│ │ │ │ -0000b340: 2020 2020 203c 2f73 7061 6e3e 3c73 7061       &qu
│ │ │ │ -0000b360: 6f74 3b26 7175 6f74 3b26 7175 6f74 3b3c  ot;""<
│ │ │ │ -0000b370: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ -0000b390: 4578 7072 6573 7369 6f6e 7320 7072 6f76  Expressions prov
│ │ │ │ -0000b3a0: 6964 6520 7468 6569 7220 6f77 6e20 636f  ide their own co
│ │ │ │ -0000b3b0: 6e76 6572 7465 7273 2062 6563 6175 7365  nverters because
│ │ │ │ -0000b3c0: 2075 7365 7273 2068 6176 6520 7468 6520   users have the 
│ │ │ │ -0000b3d0: 6f70 7469 6f6e 3c2f 7370 616e 3e0a 3c73  option. 
│ │ │ │ -0000b3f0: 2020 2020 2020 206f 6620 6d61 6e75 616c         of manual
│ │ │ │ -0000b400: 6c79 2073 7065 6369 6679 696e 6720 7468  ly specifying th
│ │ │ │ -0000b410: 6520 6f75 7470 7574 5f66 6965 6c64 2077  e output_field w
│ │ │ │ -0000b420: 6869 6368 206d 6179 2062 6520 6120 6469  hich may be a di
│ │ │ │ -0000b430: 6666 6572 656e 7420 7479 7065 3c2f 7370  fferent type.        fro
│ │ │ │ -0000b460: 6d20 7468 6520 6f6e 6520 7468 6520 6461  m the one the da
│ │ │ │ -0000b470: 7461 6261 7365 2072 6574 7572 6e73 2e3c  tabase returns.<
│ │ │ │ -0000b480: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ -0000b4a0: 2671 756f 743b 2671 756f 743b 2671 756f  ""&quo
│ │ │ │ -0000b4b0: 743b 3c2f 7370 616e 3e0a 2020 2020 2020  t;.      
│ │ │ │ -0000b4c0: 2020 3c73 7061 6e20 636c 6173 733d 226e    field <
│ │ │ │ -0000b4e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d  span class="o">=
│ │ │ │ -0000b4f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   self.outp
│ │ │ │ -0000b540: 7574 5f66 6965 6c64 3c2f 7370 616e 3e0a  ut_field.
│ │ │ │ -0000b550: 2020 2020 2020 2020 3c73 7061 6e20 636c          internal
│ │ │ │ -0000b570: 5f74 7970 653c 2f73 7061 6e3e 203c 7370  _type = field.get_in
│ │ │ │ -0000b5e0: 7465 726e 616c 5f74 7970 653c 2f73 7061  ternal_type().    
│ │ │ │ -0000b610: 2020 2020 3c73 7061 6e20 636c 6173 733d      if in
│ │ │ │ -0000b640: 7465 726e 616c 5f74 7970 653c 2f73 7061  ternal_type == &q
│ │ │ │ -0000b680: 756f 743b 466c 6f61 7446 6965 6c64 2671  uot;FloatField&q
│ │ │ │ -0000b690: 756f 743b 3c2f 7370 616e 3e3c 7370 616e  uot;:.            
│ │ │ │ -0000b6c0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -0000b6d0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return (<
│ │ │ │ -0000b6f0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ -0000b700: 2020 2020 2020 203c 7370 616e 2063 6c61         lambda value, expres
│ │ │ │ -0000b770: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e  sion, connection: N
│ │ │ │ -0000b7e0: 6f6e 653c 2f73 7061 6e3e 0a20 2020 2020  one.     
│ │ │ │ -0000b7f0: 2020 2020 2020 2020 2020 203c 7370 616e             if value is No
│ │ │ │ -0000b860: 6e65 3c2f 7370 616e 3e0a 2020 2020 2020  ne.      
│ │ │ │ -0000b870: 2020 2020 2020 2020 2020 3c73 7061 6e20            else float(value
│ │ │ │ -0000b8e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ).
│ │ │ │ -0000b900: 2020 2020 2020 2020 2020 2020 3c73 7061              ).        eli
│ │ │ │ -0000b940: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f interna
│ │ │ │ -0000b960: 6c5f 7479 7065 3c2f 7370 616e 3e3c 7370  l_type.endswith(&qu
│ │ │ │ -0000b9d0: 6f74 3b49 6e74 6567 6572 4669 656c 6426  ot;IntegerField&
│ │ │ │ -0000b9e0: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061  quot;):.          
│ │ │ │ -0000ba10: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ -0000ba30: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000ba40: 283c 2f73 7061 6e3e 0a20 2020 2020 2020  (.       
│ │ │ │ -0000ba50: 2020 2020 2020 2020 203c 7370 616e 2063           lambda<
│ │ │ │ -0000ba70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> value, expr
│ │ │ │ -0000bac0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370  ession, connection
│ │ │ │ -0000bb00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  : 
│ │ │ │ -0000bb20: 3c73 7061 6e20 636c 6173 733d 226b 6322  None.   
│ │ │ │ -0000bb40: 2020 2020 2020 2020 2020 2020 203c 7370               if<
│ │ │ │ -0000bb60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> value is <
│ │ │ │ -0000bba0: 7370 616e 2063 6c61 7373 3d22 6b63 223e  span class="kc">
│ │ │ │ -0000bbb0: 4e6f 6e65 3c2f 7370 616e 3e0a 2020 2020  None.    
│ │ │ │ -0000bbc0: 2020 2020 2020 2020 2020 2020 3c73 7061              else
│ │ │ │ -0000bbe0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   int(value
│ │ │ │ -0000bc30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ).
│ │ │ │ -0000bc50: 2020 2020 2020 2020 2020 2020 3c73 7061              ).        eli
│ │ │ │ -0000bc90: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f interna
│ │ │ │ -0000bcb0: 6c5f 7479 7065 3c2f 7370 616e 3e20 3c73  l_type ==
│ │ │ │ -0000bcd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   "D
│ │ │ │ -0000bcf0: 6563 696d 616c 4669 656c 6426 7175 6f74  ecimalField"
│ │ │ │ -0000bd00: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c  ;:
│ │ │ │ -0000bd20: 0a20 2020 2020 2020 2020 2020 203c 7370  .            ret
│ │ │ │ -0000bd40: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e  urn (.            
│ │ │ │ -0000bd70: 2020 2020 3c73 7061 6e20 636c 6173 733d      lambda value,<
│ │ │ │ -0000bdc0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> expressio
│ │ │ │ -0000bde0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  n,
│ │ │ │ -0000be00: 203c 7370 616e 2063 6c61 7373 3d22 6e22   connection: None
│ │ │ │ -0000be50: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -0000be60: 2020 2020 2020 2020 3c73 7061 6e20 636c          if value <
│ │ │ │ -0000bea0: 7370 616e 2063 6c61 7373 3d22 6f77 223e  span class="ow">
│ │ │ │ -0000beb0: 6973 3c2f 7370 616e 3e20 3c73 7061 6e20  is None<
│ │ │ │ -0000bed0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ -0000bee0: 2020 2020 2020 203c 7370 616e 2063 6c61         else Decimal(value).  
│ │ │ │ -0000bf70: 2020 2020 2020 2020 2020 3c73 7061 6e20            ).        retur
│ │ │ │ -0000bfb0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n self._co
│ │ │ │ -0000c000: 6e76 6572 745f 7661 6c75 655f 6e6f 6f70  nvert_value_noop
│ │ │ │ -0000c010: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ -0000c030: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   get_loo
│ │ │ │ -0000c050: 6b75 703c 2f73 7061 6e3e 3c73 7061 6e20  kup(self,<
│ │ │ │ -0000c0a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> lookup):.  
│ │ │ │ -0000c0e0: 2020 2020 2020 3c73 7061 6e20 636c 6173        return self
│ │ │ │ -0000c120: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ -0000c130: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .output_f
│ │ │ │ -0000c150: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e  ield.get_lookup(look
│ │ │ │ -0000c1c0: 7570 3c2f 7370 616e 3e3c 7370 616e 2063  up)..    def get_transform
│ │ │ │ -0000c220: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -0000c240: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -0000c250: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self, name<
│ │ │ │ -0000c290: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -0000c2a0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ -0000c2b0: 203c 7370 616e 2063 6c61 7373 3d22 6b22   return <
│ │ │ │ -0000c2d0: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -0000c2e0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self.output_field<
│ │ │ │ -0000c320: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>.ge
│ │ │ │ -0000c350: 745f 7472 616e 7366 6f72 6d3c 2f73 7061  t_transform(name.        _reso
│ │ │ │ +0000a230: 6c76 655f 6f75 7470 7574 5f66 6965 6c64  lve_output_field
│ │ │ │ +0000a240: 2829 2064 6964 6e26 2333 393b 7420 7265  () didn't re
│ │ │ │ +0000a250: 7475 726e 2061 6e20 6f75 7470 7574 2074  turn an output t
│ │ │ │ +0000a260: 7970 652e 3c2f 7370 616e 3e0a 3c73 7061  ype..   
│ │ │ │ +0000a280: 2020 2020 2026 7175 6f74 3b26 7175 6f74       ""
│ │ │ │ +0000a290: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 0a20  ;". 
│ │ │ │ +0000a2a0: 2020 2020 2020 203c 7370 616e 2063 6c61         try:.      
│ │ │ │ +0000a2e0: 2020 2020 2020 3c73 7061 6e20 636c 6173        return self
│ │ │ │ +0000a320: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000a330: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .output_f
│ │ │ │ +0000a350: 6965 6c64 3c2f 7370 616e 3e0a 2020 2020  ield.    
│ │ │ │ +0000a360: 2020 2020 3c73 7061 6e20 636c 6173 733d      except FieldError:.    
│ │ │ │ +0000a3c0: 2020 2020 2020 2020 3c73 7061 6e20 636c          if not s
│ │ │ │ +0000a410: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf._output_field_
│ │ │ │ +0000a450: 7265 736f 6c76 6564 5f74 6f5f 6e6f 6e65  resolved_to_none
│ │ │ │ +0000a460: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  :.
│ │ │ │ +0000a480: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000a490: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +0000a4a0: 7261 6973 653c 2f73 7061 6e3e 0a0a 2020  raise..  
│ │ │ │ +0000a4b0: 2020 3c73 7061 6e20 636c 6173 733d 226b    def _r
│ │ │ │ +0000a4e0: 6573 6f6c 7665 5f6f 7574 7075 745f 6669  esolve_output_fi
│ │ │ │ +0000a4f0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20  eld(self):
│ │ │ │ +0000a540: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .        
│ │ │ │ +0000a560: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  "&q
│ │ │ │ +0000a580: 756f 743b 2671 756f 743b 3c2f 7370 616e  uot;".        Attem
│ │ │ │ +0000a5b0: 7074 2074 6f20 696e 6665 7220 7468 6520  pt to infer the 
│ │ │ │ +0000a5c0: 6f75 7470 7574 2074 7970 6520 6f66 2074  output type of t
│ │ │ │ +0000a5d0: 6865 2065 7870 7265 7373 696f 6e2e 3c2f  he expression...        
│ │ │ │ +0000a600: 4173 2061 2067 7565 7373 2c20 6966 2074  As a guess, if t
│ │ │ │ +0000a610: 6865 206f 7574 7075 7420 6669 656c 6473  he output fields
│ │ │ │ +0000a620: 206f 6620 616c 6c20 736f 7572 6365 2066   of all source f
│ │ │ │ +0000a630: 6965 6c64 7320 6d61 7463 6820 7468 656e  ields match then
│ │ │ │ +0000a640: 2073 696d 706c 793c 2f73 7061 6e3e 0a3c   simply.<
│ │ │ │ +0000a650: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ +0000a660: 2020 2020 2020 2020 696e 6665 7220 7468          infer th
│ │ │ │ +0000a670: 6520 7361 6d65 2074 7970 6520 6865 7265  e same type here
│ │ │ │ +0000a680: 2e3c 2f73 7061 6e3e 0a0a 3c73 7061 6e20  ...     
│ │ │ │ +0000a6a0: 2020 2049 6620 6120 736f 7572 6365 2623     If a source&#
│ │ │ │ +0000a6b0: 3339 3b73 206f 7574 7075 7420 6669 656c  39;s output fiel
│ │ │ │ +0000a6c0: 6420 7265 736f 6c76 6573 2074 6f20 4e6f  d resolves to No
│ │ │ │ +0000a6d0: 6e65 2c20 6578 636c 7564 6520 6974 2066  ne, exclude it f
│ │ │ │ +0000a6e0: 726f 6d20 7468 6973 2063 6865 636b 2e3c  rom this check.<
│ │ │ │ +0000a6f0: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ +0000a710: 4966 2061 6c6c 2073 6f75 7263 6573 2061  If all sources a
│ │ │ │ +0000a720: 7265 204e 6f6e 652c 2074 6865 6e20 616e  re None, then an
│ │ │ │ +0000a730: 2065 7272 6f72 2069 7320 7261 6973 6564   error is raised
│ │ │ │ +0000a740: 2068 6967 6865 7220 7570 2074 6865 2073   higher up the s
│ │ │ │ +0000a750: 7461 636b 2069 6e3c 2f73 7061 6e3e 0a3c  tack in.<
│ │ │ │ +0000a760: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ +0000a770: 2020 2020 2020 2020 7468 6520 6f75 7470          the outp
│ │ │ │ +0000a780: 7574 5f66 6965 6c64 2070 726f 7065 7274  ut_field propert
│ │ │ │ +0000a790: 792e 3c2f 7370 616e 3e0a 3c73 7061 6e20  y..     
│ │ │ │ +0000a7b0: 2020 2026 7175 6f74 3b26 7175 6f74 3b26     ""&
│ │ │ │ +0000a7c0: 7175 6f74 3b3c 2f73 7061 6e3e 0a20 2020  quot;.   
│ │ │ │ +0000a7d0: 2020 2020 203c 7370 616e 2063 6c61 7373       # This gue
│ │ │ │ +0000a7f0: 7373 2069 7320 6d6f 7374 6c79 2061 2062  ss is mostly a b
│ │ │ │ +0000a800: 6164 2069 6465 612c 2062 7574 2074 6865  ad idea, but the
│ │ │ │ +0000a810: 7265 2069 7320 7175 6974 6520 6120 6c6f  re is quite a lo
│ │ │ │ +0000a820: 7420 6f66 2063 6f64 653c 2f73 7061 6e3e  t of code
│ │ │ │ +0000a830: 0a20 2020 2020 2020 203c 7370 616e 2063  .        # (esp
│ │ │ │ +0000a850: 6563 6961 6c6c 7920 3372 6420 7061 7274  ecially 3rd part
│ │ │ │ +0000a860: 7920 4675 6e63 2073 7562 636c 6173 7365  y Func subclasse
│ │ │ │ +0000a870: 7329 2074 6861 7420 6465 7065 6e64 206f  s) that depend o
│ │ │ │ +0000a880: 6e20 6974 2c20 7765 2623 3339 3b64 206e  n it, we'd n
│ │ │ │ +0000a890: 6565 6420 613c 2f73 7061 6e3e 0a20 2020  eed a.   
│ │ │ │ +0000a8a0: 2020 2020 203c 7370 616e 2063 6c61 7373       # deprecat
│ │ │ │ +0000a8c0: 696f 6e20 7061 7468 2074 6f20 6669 7820  ion path to fix 
│ │ │ │ +0000a8d0: 6974 2e3c 2f73 7061 6e3e 0a20 2020 2020  it..     
│ │ │ │ +0000a8e0: 2020 203c 7370 616e 2063 6c61 7373 3d22     sources_iter<
│ │ │ │ +0000a900: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> = 
│ │ │ │ +0000a920: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000a930: 283c 2f73 7061 6e3e 0a20 2020 2020 2020  (.       
│ │ │ │ +0000a940: 2020 2020 203c 7370 616e 2063 6c61 7373       source for so
│ │ │ │ +0000a990: 7572 6365 3c2f 7370 616e 3e20 3c73 7061  urce in<
│ │ │ │ +0000a9b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self.get_s
│ │ │ │ +0000aa00: 6f75 7263 655f 6669 656c 6473 3c2f 7370  ource_fields() if<
│ │ │ │ +0000aa40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> source is 
│ │ │ │ +0000aa80: 3c73 7061 6e20 636c 6173 733d 226f 7722  not Non
│ │ │ │ +0000aab0: 653c 2f73 7061 6e3e 0a20 2020 2020 2020  e.       
│ │ │ │ +0000aac0: 203c 7370 616e 2063 6c61 7373 3d22 7022   ).      
│ │ │ │ +0000aae0: 2020 3c73 7061 6e20 636c 6173 733d 226b    for out
│ │ │ │ +0000ab10: 7075 745f 6669 656c 643c 2f73 7061 6e3e  put_field
│ │ │ │ +0000ab20: 203c 7370 616e 2063 6c61 7373 3d22 6f77   in sour
│ │ │ │ +0000ab50: 6365 735f 6974 6572 3c2f 7370 616e 3e3c  ces_iter<
│ │ │ │ +0000ab60: 7370 616e 2063 6c61 7373 3d22 7022 3e3a  span class="p">:
│ │ │ │ +0000ab70: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +0000ab80: 2020 2020 3c73 7061 6e20 636c 6173 733d      for <
│ │ │ │ +0000aba0: 7370 616e 2063 6c61 7373 3d22 6e22 3e73  span class="n">s
│ │ │ │ +0000abb0: 6f75 7263 653c 2f73 7061 6e3e 203c 7370  ource in
│ │ │ │ +0000abd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   sources_
│ │ │ │ +0000abf0: 6974 6572 3c2f 7370 616e 3e3c 7370 616e  iter:.            
│ │ │ │ +0000ac20: 2020 2020 3c73 7061 6e20 636c 6173 733d      if n
│ │ │ │ +0000ac50: 6f74 3c2f 7370 616e 3e20 3c73 7061 6e20  ot isins
│ │ │ │ +0000ac70: 7461 6e63 653c 2f73 7061 6e3e 3c73 7061  tance(output_field
│ │ │ │ +0000acb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ +0000acd0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000ace0: 736f 7572 6365 3c2f 7370 616e 3e3c 7370  source.__class__<
│ │ │ │ +0000ad20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>):.
│ │ │ │ +0000ad40: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000ad50: 2020 2020 3c73 7061 6e20 636c 6173 733d      raise
│ │ │ │ +0000ad70: 203c 7370 616e 2063 6c61 7373 3d22 6e22   FieldError(.     
│ │ │ │ +0000adb0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000adc0: 2020 203c 7370 616e 2063 6c61 7373 3d22     "Expres
│ │ │ │ +0000ade0: 7369 6f6e 2063 6f6e 7461 696e 7320 6d69  sion contains mi
│ │ │ │ +0000adf0: 7865 6420 7479 7065 733a 203c 2f73 7061  xed types: %s, <
│ │ │ │ +0000ae30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>%s
│ │ │ │ +0000ae50: 3c73 7061 6e20 636c 6173 733d 2273 3222  . You must &quo
│ │ │ │ +0000ae70: 743b 3c2f 7370 616e 3e0a 2020 2020 2020  t;.      
│ │ │ │ +0000ae80: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000ae90: 2020 3c73 7061 6e20 636c 6173 733d 2273    "set out
│ │ │ │ +0000aeb0: 7075 745f 6669 656c 642e 2671 756f 743b  put_field."
│ │ │ │ +0000aec0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +0000aed0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000aee0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000aef0: 253c 2f73 7061 6e3e 203c 7370 616e 2063  % (.              
│ │ │ │ +0000af20: 2020 2020 2020 2020 2020 2020 2020 3c73                ou
│ │ │ │ +0000af40: 7470 7574 5f66 6965 6c64 3c2f 7370 616e  tput_field.__clas
│ │ │ │ +0000af80: 735f 5f3c 2f73 7061 6e3e 3c73 7061 6e20  s__.__name__,.     
│ │ │ │ +0000afe0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000aff0: 2020 2020 2020 203c 7370 616e 2063 6c61         source.__c
│ │ │ │ +0000b040: 6c61 7373 5f5f 3c2f 7370 616e 3e3c 7370  lass__.__name__,.  
│ │ │ │ +0000b0a0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000b0b0: 2020 2020 2020 3c73 7061 6e20 636c 6173        ). 
│ │ │ │ +0000b0d0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000b0e0: 2020 203c 7370 616e 2063 6c61 7373 3d22     ).    
│ │ │ │ +0000b100: 2020 2020 2020 2020 3c73 7061 6e20 636c          return output_fie
│ │ │ │ +0000b140: 6c64 3c2f 7370 616e 3e0a 0a20 2020 203c  ld..    <
│ │ │ │ +0000b150: 7370 616e 2063 6c61 7373 3d22 6e64 223e  span class="nd">
│ │ │ │ +0000b160: 4073 7461 7469 636d 6574 686f 643c 2f73  @staticmethod.    def _convert_va
│ │ │ │ +0000b1b0: 6c75 655f 6e6f 6f70 3c2f 7370 616e 3e3c  lue_noop<
│ │ │ │ +0000b1c0: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +0000b1d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  value, expr
│ │ │ │ +0000b220: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370  ession, connection
│ │ │ │ +0000b260: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ +0000b280: 0a20 2020 2020 2020 203c 7370 616e 2063  .        return<
│ │ │ │ +0000b2a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> value..    @cache
│ │ │ │ +0000b2e0: 645f 7072 6f70 6572 7479 3c2f 7370 616e  d_property.    def
│ │ │ │ +0000b310: 203c 7370 616e 2063 6c61 7373 3d22 6e66   convert_value<
│ │ │ │ +0000b330: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(s
│ │ │ │ +0000b360: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf):.        ""
│ │ │ │ +0000b3c0: 2671 756f 743b 3c2f 7370 616e 3e0a 3c73  ". 
│ │ │ │ +0000b3e0: 2020 2020 2020 2045 7870 7265 7373 696f         Expressio
│ │ │ │ +0000b3f0: 6e73 2070 726f 7669 6465 2074 6865 6972  ns provide their
│ │ │ │ +0000b400: 206f 776e 2063 6f6e 7665 7274 6572 7320   own converters 
│ │ │ │ +0000b410: 6265 6361 7573 6520 7573 6572 7320 6861  because users ha
│ │ │ │ +0000b420: 7665 2074 6865 206f 7074 696f 6e3c 2f73  ve the option.        of
│ │ │ │ +0000b450: 206d 616e 7561 6c6c 7920 7370 6563 6966   manually specif
│ │ │ │ +0000b460: 7969 6e67 2074 6865 206f 7574 7075 745f  ying the output_
│ │ │ │ +0000b470: 6669 656c 6420 7768 6963 6820 6d61 7920  field which may 
│ │ │ │ +0000b480: 6265 2061 2064 6966 6665 7265 6e74 2074  be a different t
│ │ │ │ +0000b490: 7970 653c 2f73 7061 6e3e 0a3c 7370 616e  ype.    
│ │ │ │ +0000b4b0: 2020 2020 6672 6f6d 2074 6865 206f 6e65      from the one
│ │ │ │ +0000b4c0: 2074 6865 2064 6174 6162 6173 6520 7265   the database re
│ │ │ │ +0000b4d0: 7475 726e 732e 3c2f 7370 616e 3e0a 3c73  turns.. 
│ │ │ │ +0000b4f0: 2020 2020 2020 2026 7175 6f74 3b26 7175         "&qu
│ │ │ │ +0000b500: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e  ot;"
│ │ │ │ +0000b510: 0a20 2020 2020 2020 203c 7370 616e 2063  .        field = <
│ │ │ │ +0000b550: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +0000b560: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self.output_field<
│ │ │ │ +0000b5a0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ +0000b5b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e69  span class="n">i
│ │ │ │ +0000b5c0: 6e74 6572 6e61 6c5f 7479 7065 3c2f 7370  nternal_type = fie
│ │ │ │ +0000b600: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063  ld.get_internal_ty
│ │ │ │ +0000b640: 7065 3c2f 7370 616e 3e3c 7370 616e 2063  pe().        if internal_ty
│ │ │ │ +0000b6a0: 7065 3c2f 7370 616e 3e20 3c73 7061 6e20  pe == "Float
│ │ │ │ +0000b6e0: 4669 656c 6426 7175 6f74 3b3c 2f73 7061  Field":.     
│ │ │ │ +0000b710: 2020 2020 2020 203c 7370 616e 2063 6c61         return (.  
│ │ │ │ +0000b750: 2020 2020 2020 2020 2020 2020 2020 3c73                la
│ │ │ │ +0000b770: 6d62 6461 3c2f 7370 616e 3e20 3c73 7061  mbda valu
│ │ │ │ +0000b790: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e,
│ │ │ │ +0000b7b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22   expression, conne
│ │ │ │ +0000b800: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061  ction: None.              
│ │ │ │ +0000b850: 2020 3c73 7061 6e20 636c 6173 733d 226b    if valu
│ │ │ │ +0000b880: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e is None
│ │ │ │ +0000b8c0: 0a20 2020 2020 2020 2020 2020 2020 2020  .               
│ │ │ │ +0000b8d0: 203c 7370 616e 2063 6c61 7373 3d22 6b22   else fl
│ │ │ │ +0000b900: 6f61 743c 2f73 7061 6e3e 3c73 7061 6e20  oat(value)<
│ │ │ │ +0000b950: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ +0000b960: 2020 203c 7370 616e 2063 6c61 7373 3d22     ).    
│ │ │ │ +0000b980: 2020 2020 3c73 7061 6e20 636c 6173 733d      elif 
│ │ │ │ +0000b9a0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000b9b0: 696e 7465 726e 616c 5f74 7970 653c 2f73  internal_type.ends
│ │ │ │ +0000b9f0: 7769 7468 3c2f 7370 616e 3e3c 7370 616e  with("Intege
│ │ │ │ +0000ba30: 7246 6965 6c64 2671 756f 743b 3c2f 7370  rField"):.   
│ │ │ │ +0000ba60: 2020 2020 2020 2020 203c 7370 616e 2063           return<
│ │ │ │ +0000ba80: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> (.
│ │ │ │ +0000baa0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000bab0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +0000bac0: 6c61 6d62 6461 3c2f 7370 616e 3e20 3c73  lambda va
│ │ │ │ +0000bae0: 6c75 653c 2f73 7061 6e3e 3c73 7061 6e20  lue, expression, con
│ │ │ │ +0000bb50: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73  nection:<
│ │ │ │ +0000bb70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> None.            
│ │ │ │ +0000bba0: 2020 2020 3c73 7061 6e20 636c 6173 733d      if va
│ │ │ │ +0000bbd0: 6c75 653c 2f73 7061 6e3e 203c 7370 616e  lue is None.             
│ │ │ │ +0000bc20: 2020 203c 7370 616e 2063 6c61 7373 3d22     else <
│ │ │ │ +0000bc40: 7370 616e 2063 6c61 7373 3d22 6e62 223e  span class="nb">
│ │ │ │ +0000bc50: 696e 743c 2f73 7061 6e3e 3c73 7061 6e20  int(value)<
│ │ │ │ +0000bca0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ +0000bcb0: 2020 203c 7370 616e 2063 6c61 7373 3d22     ).    
│ │ │ │ +0000bcd0: 2020 2020 3c73 7061 6e20 636c 6173 733d      elif 
│ │ │ │ +0000bcf0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000bd00: 696e 7465 726e 616c 5f74 7970 653c 2f73  internal_type == <
│ │ │ │ +0000bd30: 7370 616e 2063 6c61 7373 3d22 7332 223e  span class="s2">
│ │ │ │ +0000bd40: 2671 756f 743b 4465 6369 6d61 6c46 6965  "DecimalFie
│ │ │ │ +0000bd50: 6c64 2671 756f 743b 3c2f 7370 616e 3e3c  ld"<
│ │ │ │ +0000bd60: 7370 616e 2063 6c61 7373 3d22 7022 3e3a  span class="p">:
│ │ │ │ +0000bd70: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +0000bd80: 2020 2020 3c73 7061 6e20 636c 6173 733d      return (.     
│ │ │ │ +0000bdc0: 2020 2020 2020 2020 2020 203c 7370 616e             lambd
│ │ │ │ +0000bde0: 613c 2f73 7061 6e3e 203c 7370 616e 2063  a value, ex
│ │ │ │ +0000be30: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c  pression<
│ │ │ │ +0000be40: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +0000be50: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   connecti
│ │ │ │ +0000be70: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063  on: None. 
│ │ │ │ +0000beb0: 2020 2020 2020 2020 2020 2020 2020 203c                 <
│ │ │ │ +0000bec0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69  span class="k">i
│ │ │ │ +0000bed0: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f value is
│ │ │ │ +0000bf10: 203c 7370 616e 2063 6c61 7373 3d22 6b63   None.  
│ │ │ │ +0000bf30: 2020 2020 2020 2020 2020 2020 2020 3c73                el
│ │ │ │ +0000bf50: 7365 3c2f 7370 616e 3e20 3c73 7061 6e20  se Decima
│ │ │ │ +0000bf70: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c  l(
│ │ │ │ +0000bf90: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000bfa0: 7661 6c75 653c 2f73 7061 6e3e 3c73 7061  value).           
│ │ │ │ +0000bfd0: 203c 7370 616e 2063 6c61 7373 3d22 7022   ).      
│ │ │ │ +0000bff0: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ +0000c010: 3c73 7061 6e20 636c 6173 733d 2262 7022  self._convert_val
│ │ │ │ +0000c060: 7565 5f6e 6f6f 703c 2f73 7061 6e3e 0a0a  ue_noop..
│ │ │ │ +0000c070: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ +0000c090: 7370 616e 2063 6c61 7373 3d22 6e66 223e  span class="nf">
│ │ │ │ +0000c0a0: 6765 745f 6c6f 6f6b 7570 3c2f 7370 616e  get_lookup(self, lo
│ │ │ │ +0000c110: 6f6b 7570 3c2f 7370 616e 3e3c 7370 616e  okup):.        ret
│ │ │ │ +0000c150: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e  urn self
│ │ │ │ +0000c170: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  .<
│ │ │ │ +0000c190: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f  span class="n">o
│ │ │ │ +0000c1a0: 7574 7075 745f 6669 656c 643c 2f73 7061  utput_field.get_lo
│ │ │ │ +0000c1e0: 6f6b 7570 3c2f 7370 616e 3e3c 7370 616e  okup(lookup
│ │ │ │ +0000c220: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000c230: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73  )..    de
│ │ │ │ +0000c250: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f get_tr
│ │ │ │ +0000c270: 616e 7366 6f72 6d3c 2f73 7061 6e3e 3c73  ansform(<
│ │ │ │ +0000c290: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self, name<
│ │ │ │ +0000c2e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>):.
│ │ │ │ +0000c300: 2020 2020 2020 2020 3c73 7061 6e20 636c          return self.output
│ │ │ │ +0000c370: 5f66 6965 6c64 3c2f 7370 616e 3e3c 7370  _field.).. 
│ │ │ │ -0000c3b0: 2020 203c 7370 616e 2063 6c61 7373 3d22     def r
│ │ │ │ -0000c3e0: 656c 6162 656c 6564 5f63 6c6f 6e65 3c2f  elabeled_clone(se
│ │ │ │ -0000c420: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf, change_map):.   
│ │ │ │ -0000c480: 2020 2020 203c 7370 616e 2063 6c61 7373       clone = self
│ │ │ │ -0000c4d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  .<
│ │ │ │ -0000c4f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63  span class="n">c
│ │ │ │ -0000c500: 6f70 793c 2f73 7061 6e3e 3c73 7061 6e20  opy().        clon
│ │ │ │ -0000c540: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e.
│ │ │ │ -0000c560: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000c570: 7365 745f 736f 7572 6365 5f65 7870 7265  set_source_expre
│ │ │ │ -0000c580: 7373 696f 6e73 3c2f 7370 616e 3e3c 7370  ssions(.          
│ │ │ │ -0000c5b0: 2020 3c73 7061 6e20 636c 6173 733d 2270    [.     
│ │ │ │ -0000c5d0: 2020 2020 2020 2020 2020 203c 7370 616e             e.relab
│ │ │ │ -0000c620: 656c 6564 5f63 6c6f 6e65 3c2f 7370 616e  eled_clone(change_
│ │ │ │ -0000c660: 6d61 703c 2f73 7061 6e3e 3c73 7061 6e20  map) if e is
│ │ │ │ -0000c6d0: 203c 7370 616e 2063 6c61 7373 3d22 6f77   not No
│ │ │ │ -0000c700: 6e65 3c2f 7370 616e 3e20 3c73 7061 6e20  ne else None.             
│ │ │ │ -0000c750: 2020 203c 7370 616e 2063 6c61 7373 3d22     for e<
│ │ │ │ -0000c780: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> in self.<
│ │ │ │ -0000c7d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>get_source
│ │ │ │ -0000c7f0: 5f65 7870 7265 7373 696f 6e73 3c2f 7370  _expressions().   
│ │ │ │ -0000c820: 2020 2020 2020 2020 203c 7370 616e 2063           ].        ).        retur
│ │ │ │ -0000c880: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n clone..    def replace_e
│ │ │ │ -0000c8e0: 7870 7265 7373 696f 6e73 3c2f 7370 616e  xpressions(self, re
│ │ │ │ -0000c950: 706c 6163 656d 656e 7473 3c2f 7370 616e  placements):.     
│ │ │ │ -0000c980: 2020 203c 7370 616e 2063 6c61 7373 3d22     if rep
│ │ │ │ -0000c9b0: 6c61 6365 6d65 6e74 3c2f 7370 616e 3e20  lacement 
│ │ │ │ -0000c9c0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ -0000c9d0: 3a3d 3c2f 7370 616e 3e20 3c73 7061 6e20  := replac
│ │ │ │ -0000c9f0: 656d 656e 7473 3c2f 7370 616e 3e3c 7370  ements.get<
│ │ │ │ -0000ca30: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ -0000ca40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  self):.   
│ │ │ │ -0000ca80: 2020 2020 2020 2020 203c 7370 616e 2063           return<
│ │ │ │ -0000caa0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> replaceme
│ │ │ │ -0000cac0: 6e74 3c2f 7370 616e 3e0a 2020 2020 2020  nt.      
│ │ │ │ -0000cad0: 2020 3c73 7061 6e20 636c 6173 733d 226e    clone <
│ │ │ │ -0000caf0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d  span class="o">=
│ │ │ │ -0000cb00: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   self.copy
│ │ │ │ -0000cb50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ()
│ │ │ │ -0000cb70: 0a20 2020 2020 2020 203c 7370 616e 2063  .        source_
│ │ │ │ -0000cb90: 6578 7072 6573 7369 6f6e 733c 2f73 7061  expressions = clon
│ │ │ │ -0000cbd0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e.
│ │ │ │ -0000cbf0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000cc00: 6765 745f 736f 7572 6365 5f65 7870 7265  get_source_expre
│ │ │ │ -0000cc10: 7373 696f 6e73 3c2f 7370 616e 3e3c 7370  ssions()<
│ │ │ │ -0000cc30: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ -0000cc40: 7370 616e 2063 6c61 7373 3d22 6e22 3e63  span class="n">c
│ │ │ │ -0000cc50: 6c6f 6e65 3c2f 7370 616e 3e3c 7370 616e  lone.set_source_ex
│ │ │ │ -0000cc90: 7072 6573 7369 6f6e 733c 2f73 7061 6e3e  pressions
│ │ │ │ -0000cca0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000ccb0: 283c 2f73 7061 6e3e 0a20 2020 2020 2020  (.       
│ │ │ │ -0000ccc0: 2020 2020 203c 7370 616e 2063 6c61 7373       [.  
│ │ │ │ -0000cce0: 2020 2020 2020 2020 2020 2020 2020 3c73                ex
│ │ │ │ -0000cd00: 7072 3c2f 7370 616e 3e3c 7370 616e 2063  pr.replace_express
│ │ │ │ -0000cd40: 696f 6e73 3c2f 7370 616e 3e3c 7370 616e  ions(replacements<
│ │ │ │ -0000cd80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>) <
│ │ │ │ -0000cda0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69  span class="k">i
│ │ │ │ -0000cdb0: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f expr else
│ │ │ │ -0000cdf0: 203c 7370 616e 2063 6c61 7373 3d22 6b63   None.  
│ │ │ │ -0000ce10: 2020 2020 2020 2020 2020 2020 2020 3c73                fo
│ │ │ │ -0000ce30: 723c 2f73 7061 6e3e 203c 7370 616e 2063  r expr in 
│ │ │ │ -0000ce70: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000ce80: 736f 7572 6365 5f65 7870 7265 7373 696f  source_expressio
│ │ │ │ -0000ce90: 6e73 3c2f 7370 616e 3e0a 2020 2020 2020  ns.      
│ │ │ │ -0000cea0: 2020 2020 2020 3c73 7061 6e20 636c 6173        ]. 
│ │ │ │ -0000cec0: 2020 2020 2020 203c 7370 616e 2063 6c61         ).
│ │ │ │ -0000cee0: 2020 2020 2020 2020 3c73 7061 6e20 636c          return clone..    def get_refs(self
│ │ │ │ -0000cf90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ -0000cfb0: 0a20 2020 2020 2020 203c 7370 616e 2063  .        refs = s
│ │ │ │ -0000d000: 6574 3c2f 7370 616e 3e3c 7370 616e 2063  et().        for expr in se
│ │ │ │ -0000d090: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.get_source_expr
│ │ │ │ -0000d0d0: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73  essions()
│ │ │ │ -0000d0f0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ -0000d100: 2020 2020 203c 7370 616e 2063 6c61 7373       refs
│ │ │ │ -0000d120: 203c 7370 616e 2063 6c61 7373 3d22 6f22   |= expr<
│ │ │ │ -0000d150: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>.ge
│ │ │ │ -0000d180: 745f 7265 6673 3c2f 7370 616e 3e3c 7370  t_refs()<
│ │ │ │ -0000d1a0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ -0000d1b0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ -0000d1c0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn ref
│ │ │ │ -0000d1e0: 733c 2f73 7061 6e3e 0a0a 2020 2020 3c73  s..    de
│ │ │ │ -0000d200: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f copy(se
│ │ │ │ -0000d250: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf):.        retur
│ │ │ │ -0000d290: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n copy.copy
│ │ │ │ -0000d2e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -0000d300: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -0000d310: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self)..    def prefix_refe
│ │ │ │ -0000d370: 7265 6e63 6573 3c2f 7370 616e 3e3c 7370  rences(self, prefix
│ │ │ │ -0000d3e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ -0000d400: 0a20 2020 2020 2020 203c 7370 616e 2063  .        clone = <
│ │ │ │ -0000d440: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ -0000d450: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self.copy()
│ │ │ │ -0000d4a0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -0000d4b0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000d4c0: 636c 6f6e 653c 2f73 7061 6e3e 3c73 7061  clone.set_source_e
│ │ │ │ -0000d500: 7870 7265 7373 696f 6e73 3c2f 7370 616e  xpressions(.      
│ │ │ │ -0000d530: 2020 2020 2020 3c73 7061 6e20 636c 6173        [. 
│ │ │ │ -0000d550: 2020 2020 2020 2020 2020 2020 2020 203c                 <
│ │ │ │ -0000d560: 7370 616e 2063 6c61 7373 3d22 6e22 3e46  span class="n">F
│ │ │ │ -0000d570: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ -0000d590: 7370 616e 2063 6c61 7373 3d22 7361 223e  span class="sa">
│ │ │ │ -0000d5a0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f"<
│ │ │ │ -0000d5c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>{<
│ │ │ │ -0000d5e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e70  span class="n">p
│ │ │ │ -0000d5f0: 7265 6669 783c 2f73 7061 6e3e 3c73 7061  refix}{<
│ │ │ │ -0000d610: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>expr.name}&q
│ │ │ │ -0000d690: 756f 743b 3c2f 7370 616e 3e3c 7370 616e  uot;).            
│ │ │ │ -0000d6c0: 2020 2020 3c73 7061 6e20 636c 6173 733d      if i
│ │ │ │ -0000d6f0: 7369 6e73 7461 6e63 653c 2f73 7061 6e3e  sinstance
│ │ │ │ -0000d700: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000d710: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (expr, F).   
│ │ │ │ -0000d780: 2020 2020 2020 2020 2020 2020 203c 7370               els
│ │ │ │ -0000d7a0: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e expr.pref
│ │ │ │ -0000d7f0: 6978 5f72 6566 6572 656e 6365 733c 2f73  ix_references(pref
│ │ │ │ -0000d830: 6978 3c2f 7370 616e 3e3c 7370 616e 2063  ix).              
│ │ │ │ -0000d860: 2020 3c73 7061 6e20 636c 6173 733d 226b    for exp
│ │ │ │ -0000d890: 723c 2f73 7061 6e3e 203c 7370 616e 2063  r in self
│ │ │ │ -0000d8d0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ -0000d8e0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .get_sour
│ │ │ │ -0000d900: 6365 5f65 7870 7265 7373 696f 6e73 3c2f  ce_expressions(). 
│ │ │ │ -0000d930: 2020 2020 2020 2020 2020 203c 7370 616e             ].        ).        ret
│ │ │ │ -0000d990: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e  urn clone
│ │ │ │ -0000d9b0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ -0000d9d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   get_gro
│ │ │ │ -0000d9f0: 7570 5f62 795f 636f 6c73 3c2f 7370 616e  up_by_cols(self):. 
│ │ │ │ -0000da50: 2020 2020 2020 203c 7370 616e 2063 6c61         if
│ │ │ │ -0000da70: 203c 7370 616e 2063 6c61 7373 3d22 6f77   not se
│ │ │ │ -0000daa0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.contains_aggreg
│ │ │ │ -0000dae0: 6174 653c 2f73 7061 6e3e 3c73 7061 6e20  ate:.            <
│ │ │ │ -0000db10: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ -0000db20: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn [self].      
│ │ │ │ -0000db80: 2020 3c73 7061 6e20 636c 6173 733d 226e    cols =<
│ │ │ │ -0000dbb0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> []
│ │ │ │ +0000c3a0: 3d22 6e22 3e67 6574 5f74 7261 6e73 666f  ="n">get_transfo
│ │ │ │ +0000c3b0: 726d 3c2f 7370 616e 3e3c 7370 616e 2063  rm(name)..    def relabeled_
│ │ │ │ +0000c440: 636c 6f6e 653c 2f73 7061 6e3e 3c73 7061  clone(self
│ │ │ │ +0000c480: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000c490: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , change_
│ │ │ │ +0000c4b0: 6d61 703c 2f73 7061 6e3e 3c73 7061 6e20  map):.        clon
│ │ │ │ +0000c4f0: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e = self.<
│ │ │ │ +0000c540: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>copy().     
│ │ │ │ +0000c580: 2020 203c 7370 616e 2063 6c61 7373 3d22     clone<
│ │ │ │ +0000c5a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ +0000c5b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  set_sourc
│ │ │ │ +0000c5d0: 655f 6578 7072 6573 7369 6f6e 733c 2f73  e_expressions(.   
│ │ │ │ +0000c600: 2020 2020 2020 2020 203c 7370 616e 2063           [.              
│ │ │ │ +0000c630: 2020 3c73 7061 6e20 636c 6173 733d 226e    e.relabeled_clon
│ │ │ │ +0000c680: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c  e(
│ │ │ │ +0000c6a0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000c6b0: 6368 616e 6765 5f6d 6170 3c2f 7370 616e  change_map) if e is
│ │ │ │ +0000c720: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   not None
│ │ │ │ +0000c760: 203c 7370 616e 2063 6c61 7373 3d22 6b22   else No
│ │ │ │ +0000c790: 6e65 3c2f 7370 616e 3e0a 2020 2020 2020  ne.      
│ │ │ │ +0000c7a0: 2020 2020 2020 2020 2020 3c73 7061 6e20            for e i
│ │ │ │ +0000c7f0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n self.get
│ │ │ │ +0000c840: 5f73 6f75 7263 655f 6578 7072 6573 7369  _source_expressi
│ │ │ │ +0000c850: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20  ons().            
│ │ │ │ +0000c880: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000c890: 5d3c 2f73 7061 6e3e 0a20 2020 2020 2020  ].       
│ │ │ │ +0000c8a0: 203c 7370 616e 2063 6c61 7373 3d22 7022   ).      
│ │ │ │ +0000c8c0: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ +0000c8e0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000c8f0: 636c 6f6e 653c 2f73 7061 6e3e 0a0a 2020  clone..  
│ │ │ │ +0000c900: 2020 3c73 7061 6e20 636c 6173 733d 226b    def re
│ │ │ │ +0000c930: 706c 6163 655f 6578 7072 6573 7369 6f6e  place_expression
│ │ │ │ +0000c940: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s(
│ │ │ │ +0000c960: 3c73 7061 6e20 636c 6173 733d 2262 7022  self, replacement
│ │ │ │ +0000c9b0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s):.        if replacement<
│ │ │ │ +0000ca10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> :=
│ │ │ │ +0000ca30: 203c 7370 616e 2063 6c61 7373 3d22 6e22   replacements.get<
│ │ │ │ +0000ca80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(s
│ │ │ │ +0000cab0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf):.            
│ │ │ │ +0000cae0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +0000caf0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return re
│ │ │ │ +0000cb10: 706c 6163 656d 656e 743c 2f73 7061 6e3e  placement
│ │ │ │ +0000cb20: 0a20 2020 2020 2020 203c 7370 616e 2063  .        clone = <
│ │ │ │ +0000cb60: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +0000cb70: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self.copy()
│ │ │ │ +0000cbc0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +0000cbd0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000cbe0: 736f 7572 6365 5f65 7870 7265 7373 696f  source_expressio
│ │ │ │ +0000cbf0: 6e73 3c2f 7370 616e 3e20 3c73 7061 6e20  ns = clone<
│ │ │ │ +0000cc30: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ +0000cc40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  get_sourc
│ │ │ │ +0000cc60: 655f 6578 7072 6573 7369 6f6e 733c 2f73  e_expressions().  
│ │ │ │ +0000cc90: 2020 2020 2020 3c73 7061 6e20 636c 6173        clone.set_so
│ │ │ │ +0000cce0: 7572 6365 5f65 7870 7265 7373 696f 6e73  urce_expressions
│ │ │ │ +0000ccf0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (.
│ │ │ │ +0000cd10: 2020 2020 2020 2020 2020 2020 3c73 7061              [.           
│ │ │ │ +0000cd40: 2020 2020 203c 7370 616e 2063 6c61 7373       expr
│ │ │ │ +0000cd60: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000cd70: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .replace_
│ │ │ │ +0000cd90: 6578 7072 6573 7369 6f6e 733c 2f73 7061  expressions(replac
│ │ │ │ +0000cdd0: 656d 656e 7473 3c2f 7370 616e 3e3c 7370  ements) if 
│ │ │ │ +0000ce10: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000ce20: 6578 7072 3c2f 7370 616e 3e20 3c73 7061  expr else
│ │ │ │ +0000ce40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   None.           
│ │ │ │ +0000ce70: 2020 2020 203c 7370 616e 2063 6c61 7373       for 
│ │ │ │ +0000ce90: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000cea0: 6578 7072 3c2f 7370 616e 3e20 3c73 7061  expr in<
│ │ │ │ +0000cec0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> source_ex
│ │ │ │ +0000cee0: 7072 6573 7369 6f6e 733c 2f73 7061 6e3e  pressions
│ │ │ │ +0000cef0: 0a20 2020 2020 2020 2020 2020 203c 7370  .            ].        )<
│ │ │ │ +0000cf30: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ +0000cf40: 7370 616e 2063 6c61 7373 3d22 6b22 3e72  span class="k">r
│ │ │ │ +0000cf50: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370  eturn clo
│ │ │ │ +0000cf70: 6e65 3c2f 7370 616e 3e0a 0a20 2020 203c  ne..    <
│ │ │ │ +0000cf80: 7370 616e 2063 6c61 7373 3d22 6b22 3e64  span class="k">d
│ │ │ │ +0000cf90: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20  ef get_r
│ │ │ │ +0000cfb0: 6566 733c 2f73 7061 6e3e 3c73 7061 6e20  efs(self):
│ │ │ │ +0000d000: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +0000d010: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000d020: 7265 6673 3c2f 7370 616e 3e20 3c73 7061  refs = set
│ │ │ │ +0000d060: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000d070: 2829 3c2f 7370 616e 3e0a 2020 2020 2020  ().      
│ │ │ │ +0000d080: 2020 3c73 7061 6e20 636c 6173 733d 226b    for exp
│ │ │ │ +0000d0b0: 723c 2f73 7061 6e3e 203c 7370 616e 2063  r in self
│ │ │ │ +0000d0f0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000d100: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .get_sour
│ │ │ │ +0000d120: 6365 5f65 7870 7265 7373 696f 6e73 3c2f  ce_expressions():.
│ │ │ │ +0000d150: 2020 2020 2020 2020 2020 2020 3c73 7061              refs
│ │ │ │ +0000d170: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   |= expr.get_refs().  
│ │ │ │ +0000d200: 2020 2020 2020 3c73 7061 6e20 636c 6173        return refs.
│ │ │ │ +0000d240: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ +0000d260: 3c73 7061 6e20 636c 6173 733d 226e 6622  copy(self
│ │ │ │ +0000d2b0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000d2c0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ +0000d2d0: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ +0000d2f0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000d300: 636f 7079 3c2f 7370 616e 3e3c 7370 616e  copy.copy(<
│ │ │ │ +0000d350: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self)..    
│ │ │ │ +0000d390: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +0000d3a0: 6465 663c 2f73 7061 6e3e 203c 7370 616e  def pref
│ │ │ │ +0000d3c0: 6978 5f72 6566 6572 656e 6365 733c 2f73  ix_references(sel
│ │ │ │ +0000d400: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f,
│ │ │ │ +0000d420: 203c 7370 616e 2063 6c61 7373 3d22 6e22   prefix):
│ │ │ │ +0000d450: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +0000d460: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000d470: 636c 6f6e 653c 2f73 7061 6e3e 203c 7370  clone = self.copy(). 
│ │ │ │ +0000d500: 2020 2020 2020 203c 7370 616e 2063 6c61         clone.set_s
│ │ │ │ +0000d550: 6f75 7263 655f 6578 7072 6573 7369 6f6e  ource_expression
│ │ │ │ +0000d560: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s(
│ │ │ │ +0000d580: 0a20 2020 2020 2020 2020 2020 203c 7370  .            [.          
│ │ │ │ +0000d5b0: 2020 2020 2020 3c73 7061 6e20 636c 6173        F(<
│ │ │ │ +0000d5e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>f<
│ │ │ │ +0000d600: 7370 616e 2063 6c61 7373 3d22 7332 223e  span class="s2">
│ │ │ │ +0000d610: 2671 756f 743b 3c2f 7370 616e 3e3c 7370  "{<
│ │ │ │ +0000d630: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>prefix}{exp
│ │ │ │ +0000d680: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r.
│ │ │ │ +0000d6a0: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000d6b0: 6e61 6d65 3c2f 7370 616e 3e3c 7370 616e  name}").     
│ │ │ │ +0000d710: 2020 2020 2020 2020 2020 203c 7370 616e             if isinstance
│ │ │ │ +0000d750: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +0000d770: 7370 616e 2063 6c61 7373 3d22 6e22 3e65  span class="n">e
│ │ │ │ +0000d780: 7870 723c 2f73 7061 6e3e 3c73 7061 6e20  xpr, F).            
│ │ │ │ +0000d7e0: 2020 2020 3c73 7061 6e20 636c 6173 733d      else 
│ │ │ │ +0000d800: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000d810: 6578 7072 3c2f 7370 616e 3e3c 7370 616e  expr.prefix_refere
│ │ │ │ +0000d850: 6e63 6573 3c2f 7370 616e 3e3c 7370 616e  nces(prefix
│ │ │ │ +0000d890: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000d8a0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020  ).       
│ │ │ │ +0000d8b0: 2020 2020 2020 2020 203c 7370 616e 2063           for expr 
│ │ │ │ +0000d8f0: 3c73 7061 6e20 636c 6173 733d 226f 7722  in self
│ │ │ │ +0000d920: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  .<
│ │ │ │ +0000d940: 7370 616e 2063 6c61 7373 3d22 6e22 3e67  span class="n">g
│ │ │ │ +0000d950: 6574 5f73 6f75 7263 655f 6578 7072 6573  et_source_expres
│ │ │ │ +0000d960: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061  sions().          
│ │ │ │ +0000d990: 2020 3c73 7061 6e20 636c 6173 733d 2270    ].     
│ │ │ │ +0000d9b0: 2020 203c 7370 616e 2063 6c61 7373 3d22     ).    
│ │ │ │ +0000d9d0: 2020 2020 3c73 7061 6e20 636c 6173 733d      return clone..
│ │ │ │ +0000da10: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ +0000da30: 7370 616e 2063 6c61 7373 3d22 6e66 223e  span class="nf">
│ │ │ │ +0000da40: 6765 745f 6772 6f75 705f 6279 5f63 6f6c  get_group_by_col
│ │ │ │ +0000da50: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s(
│ │ │ │ +0000da70: 3c73 7061 6e20 636c 6173 733d 2262 7022  self):.        if
│ │ │ │ +0000dac0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   not self
│ │ │ │ +0000db00: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000db10: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .contains
│ │ │ │ +0000db30: 5f61 6767 7265 6761 7465 3c2f 7370 616e  _aggregate:.      
│ │ │ │ +0000db60: 2020 2020 2020 3c73 7061 6e20 636c 6173        return [sel
│ │ │ │ +0000dbb0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f]
│ │ │ │  0000dbd0: 0a20 2020 2020 2020 203c 7370 616e 2063  .        for source in se
│ │ │ │ -0000dc40: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.get_source_expr
│ │ │ │ -0000dc80: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73  essions()
│ │ │ │ -0000dca0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020  :.       
│ │ │ │ -0000dcb0: 2020 2020 203c 7370 616e 2063 6c61 7373       cols
│ │ │ │ -0000dcd0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ -0000dce0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .extend(sou
│ │ │ │ -0000dd30: 7263 653c 2f73 7061 6e3e 3c73 7061 6e20  rce.get_group_by_c
│ │ │ │ -0000dd70: 6f6c 733c 2f73 7061 6e3e 3c73 7061 6e20  ols()).        ret
│ │ │ │ -0000ddb0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e  urn cols<
│ │ │ │ -0000ddd0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061  /span>..    def<
│ │ │ │ -0000ddf0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> get_sour
│ │ │ │ -0000de10: 6365 5f66 6965 6c64 733c 2f73 7061 6e3e  ce_fields
│ │ │ │ -0000de20: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000de30: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self):.  
│ │ │ │ -0000de80: 2020 2020 2020 3c2f 7370 616e 3e3c 7370        &q
│ │ │ │ -0000dea0: 756f 743b 2671 756f 743b 2671 756f 743b  uot;""
│ │ │ │ -0000deb0: 5265 7475 726e 2074 6865 2075 6e64 6572  Return the under
│ │ │ │ -0000dec0: 6c79 696e 6720 6669 656c 6420 7479 7065  lying field type
│ │ │ │ -0000ded0: 7320 7573 6564 2062 7920 7468 6973 2061  s used by this a
│ │ │ │ -0000dee0: 6767 7265 6761 7465 2e26 7175 6f74 3b26  ggregate."&
│ │ │ │ -0000def0: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061  quot;".        retur
│ │ │ │ -0000df20: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063  n [e._output_field_o
│ │ │ │ -0000df90: 725f 6e6f 6e65 3c2f 7370 616e 3e20 3c73  r_none fo
│ │ │ │ -0000dfb0: 723c 2f73 7061 6e3e 203c 7370 616e 2063  r e in se
│ │ │ │ -0000e000: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf.get_source_expr
│ │ │ │ -0000e040: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73  essions()
│ │ │ │ -0000e060: 5d3c 2f73 7061 6e3e 0a0a 2020 2020 3c73  ]..    de
│ │ │ │ -0000e080: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f asc(sel
│ │ │ │ -0000e0d0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f,
│ │ │ │ -0000e0f0: 203c 7370 616e 2063 6c61 7373 3d22 6f22   **kwargs
│ │ │ │ -0000e120: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ -0000e140: 0a20 2020 2020 2020 203c 7370 616e 2063  .        return<
│ │ │ │ -0000e160: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> OrderBy(se
│ │ │ │ -0000e1b0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf, **kwarg
│ │ │ │ -0000e200: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s)
│ │ │ │ -0000e220: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    def
│ │ │ │ -0000e240: 203c 7370 616e 2063 6c61 7373 3d22 6e66   desc(self, **kwargs
│ │ │ │ -0000e2e0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000e2f0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ -0000e300: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ -0000e320: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000e330: 4f72 6465 7242 793c 2f73 7061 6e3e 3c73  OrderBy(<
│ │ │ │ -0000e350: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self, desce
│ │ │ │ -0000e3a0: 6e64 696e 673c 2f73 7061 6e3e 3c73 7061  nding=True
│ │ │ │ -0000e3e0: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000e3f0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , **kwargs<
│ │ │ │ -0000e430: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ -0000e440: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ -0000e460: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   reverse
│ │ │ │ -0000e480: 5f6f 7264 6572 696e 673c 2f73 7061 6e3e  _ordering
│ │ │ │ -0000e490: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000e4a0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self):.  
│ │ │ │ -0000e4e0: 2020 2020 2020 3c73 7061 6e20 636c 6173        return self
│ │ │ │ -0000e520: 0a0a 2020 2020 3c73 7061 6e20 636c 6173  ..    def
│ │ │ │ -0000e540: 203c 7370 616e 2063 6c61 7373 3d22 6e66   flatten
│ │ │ │ -0000e560: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ -0000e570: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c  (self):.  
│ │ │ │ -0000e5c0: 2020 2020 2020 3c2f 7370 616e 3e3c 7370        &q
│ │ │ │ -0000e5e0: 756f 743b 2671 756f 743b 2671 756f 743b  uot;""
│ │ │ │ -0000e5f0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .       
│ │ │ │ -0000e610: 2052 6563 7572 7369 7665 6c79 2079 6965   Recursively yie
│ │ │ │ -0000e620: 6c64 2074 6869 7320 6578 7072 6573 7369  ld this expressi
│ │ │ │ -0000e630: 6f6e 2061 6e64 2061 6c6c 2073 7562 6578  on and all subex
│ │ │ │ -0000e640: 7072 6573 7369 6f6e 732c 2069 6e3c 2f73  pressions, in.        de
│ │ │ │ -0000e670: 7074 682d 6669 7273 7420 6f72 6465 722e  pth-first order.
│ │ │ │ -0000e680: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c  .       
│ │ │ │ -0000e6a0: 2026 7175 6f74 3b26 7175 6f74 3b26 7175   ""&qu
│ │ │ │ -0000e6b0: 6f74 3b3c 2f73 7061 6e3e 0a20 2020 2020  ot;.     
│ │ │ │ -0000e6c0: 2020 203c 7370 616e 2063 6c61 7373 3d22     yield 
│ │ │ │ -0000e6e0: 3c73 7061 6e20 636c 6173 733d 2262 7022  self.   
│ │ │ │ -0000e700: 2020 2020 203c 7370 616e 2063 6c61 7373       for 
│ │ │ │ -0000e720: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000e730: 6578 7072 3c2f 7370 616e 3e20 3c73 7061  expr in<
│ │ │ │ -0000e750: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self.get_s
│ │ │ │ -0000e7a0: 6f75 7263 655f 6578 7072 6573 7369 6f6e  ource_expression
│ │ │ │ -0000e7b0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s():.            <
│ │ │ │ -0000e7e0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69  span class="k">i
│ │ │ │ -0000e7f0: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f expr:.   
│ │ │ │ -0000e830: 2020 2020 2020 2020 2020 2020 203c 7370               if<
│ │ │ │ -0000e850: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> hasattr<
│ │ │ │ -0000e870: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>(ex
│ │ │ │ -0000e8a0: 7072 3c2f 7370 616e 3e3c 7370 616e 2063  pr, "flatten
│ │ │ │ -0000e8e0: 2671 756f 743b 3c2f 7370 616e 3e3c 7370  "):<
│ │ │ │ -0000e900: 2f73 7061 6e3e 0a20 2020 2020 2020 2020  /span>.         
│ │ │ │ -0000e910: 2020 2020 2020 2020 2020 203c 7370 616e             yield
│ │ │ │ -0000e930: 2066 726f 6d3c 2f73 7061 6e3e 203c 7370   from exp
│ │ │ │ -0000e950: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r.
│ │ │ │ -0000e970: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000e980: 666c 6174 7465 6e3c 2f73 7061 6e3e 3c73  flatten()
│ │ │ │ -0000e9a0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ -0000e9b0: 2020 2020 2020 2020 3c73 7061 6e20 636c          else:.    
│ │ │ │ -0000e9f0: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ -0000ea00: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ -0000ea10: 7969 656c 643c 2f73 7061 6e3e 203c 7370  yield exp
│ │ │ │ -0000ea30: 723c 2f73 7061 6e3e 0a0a 2020 2020 3c73  r..    de
│ │ │ │ -0000ea50: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f select
│ │ │ │ -0000ea70: 5f66 6f72 6d61 743c 2f73 7061 6e3e 3c73  _format(<
│ │ │ │ -0000ea90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>self, compi
│ │ │ │ -0000eae0: 6c65 723c 2f73 7061 6e3e 3c73 7061 6e20  ler, sql, params):.   
│ │ │ │ -0000eb80: 2020 2020 203c 2f73 7061 6e3e 3c73 7061       &qu
│ │ │ │ -0000eba0: 6f74 3b26 7175 6f74 3b26 7175 6f74 3b3c  ot;""<
│ │ │ │ -0000ebb0: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61  /span>.        
│ │ │ │ -0000ebd0: 4375 7374 6f6d 2066 6f72 6d61 7420 666f  Custom format fo
│ │ │ │ -0000ebe0: 7220 7365 6c65 6374 2063 6c61 7573 6573  r select clauses
│ │ │ │ -0000ebf0: 2e20 466f 7220 6578 616d 706c 652c 2045  . For example, E
│ │ │ │ -0000ec00: 5849 5354 5320 6578 7072 6573 7369 6f6e  XISTS expression
│ │ │ │ -0000ec10: 7320 6e65 6564 3c2f 7370 616e 3e0a 3c73  s need. 
│ │ │ │ -0000ec30: 2020 2020 2020 2074 6f20 6265 2077 7261         to be wra
│ │ │ │ -0000ec40: 7070 6564 2069 6e20 4341 5345 2057 4845  pped in CASE WHE
│ │ │ │ -0000ec50: 4e20 6f6e 204f 7261 636c 652e 3c2f 7370  N on Oracle..        &qu
│ │ │ │ -0000ec80: 6f74 3b26 7175 6f74 3b26 7175 6f74 3b3c  ot;""<
│ │ │ │ -0000ec90: 2f73 7061 6e3e 0a20 2020 2020 2020 203c  /span>.        <
│ │ │ │ -0000eca0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69  span class="k">i
│ │ │ │ -0000ecb0: 663c 2f73 7061 6e3e 203c 7370 616e 2063  f hasatt
│ │ │ │ -0000ecd0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c  r(
│ │ │ │ -0000ecf0: 3c73 7061 6e20 636c 6173 733d 2262 7022  self.output_field
│ │ │ │ +0000dbe0: 6c61 7373 3d22 6e22 3e63 6f6c 733c 2f73  lass="n">cols = []
│ │ │ │ +0000dc20: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +0000dc30: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +0000dc40: 666f 723c 2f73 7061 6e3e 203c 7370 616e  for sourc
│ │ │ │ +0000dc60: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e in self
│ │ │ │ +0000dca0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000dcb0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .get_sour
│ │ │ │ +0000dcd0: 6365 5f65 7870 7265 7373 696f 6e73 3c2f  ce_expressions():.
│ │ │ │ +0000dd00: 2020 2020 2020 2020 2020 2020 3c73 7061              cols
│ │ │ │ +0000dd20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  .<
│ │ │ │ +0000dd40: 7370 616e 2063 6c61 7373 3d22 6e22 3e65  span class="n">e
│ │ │ │ +0000dd50: 7874 656e 643c 2f73 7061 6e3e 3c73 7061  xtend(source.get_gro
│ │ │ │ +0000ddc0: 7570 5f62 795f 636f 6c73 3c2f 7370 616e  up_by_cols()).    
│ │ │ │ +0000ddf0: 2020 2020 3c73 7061 6e20 636c 6173 733d      return cols.. 
│ │ │ │ +0000de30: 2020 203c 7370 616e 2063 6c61 7373 3d22     def g
│ │ │ │ +0000de60: 6574 5f73 6f75 7263 655f 6669 656c 6473  et_source_fields
│ │ │ │ +0000de70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +0000de90: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +0000dea0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self):.        ""
│ │ │ │ +0000df00: 3b26 7175 6f74 3b52 6574 7572 6e20 7468  ;"Return th
│ │ │ │ +0000df10: 6520 756e 6465 726c 7969 6e67 2066 6965  e underlying fie
│ │ │ │ +0000df20: 6c64 2074 7970 6573 2075 7365 6420 6279  ld types used by
│ │ │ │ +0000df30: 2074 6869 7320 6167 6772 6567 6174 652e   this aggregate.
│ │ │ │ +0000df40: 2671 756f 743b 2671 756f 743b 2671 756f  ""&quo
│ │ │ │ +0000df50: 743b 3c2f 7370 616e 3e0a 2020 2020 2020  t;.      
│ │ │ │ +0000df60: 2020 3c73 7061 6e20 636c 6173 733d 226b    return 
│ │ │ │ +0000df80: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000df90: 5b3c 2f73 7061 6e3e 3c73 7061 6e20 636c  [e
│ │ │ │ +0000dfb0: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000dfc0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  ._output_
│ │ │ │ +0000dfe0: 6669 656c 645f 6f72 5f6e 6f6e 653c 2f73  field_or_none for 
│ │ │ │ +0000e010: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000e020: 653c 2f73 7061 6e3e 203c 7370 616e 2063  e in self
│ │ │ │ +0000e060: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000e070: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c  .get_sour
│ │ │ │ +0000e090: 6365 5f65 7870 7265 7373 696f 6e73 3c2f  ce_expressions()].
│ │ │ │ +0000e0c0: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ +0000e0e0: 3c73 7061 6e20 636c 6173 733d 226e 6622  asc(self<
│ │ │ │ +0000e130: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ +0000e140: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   **kwargs):
│ │ │ │ +0000e190: 3c2f 7370 616e 3e0a 2020 2020 2020 2020  .        
│ │ │ │ +0000e1a0: 3c73 7061 6e20 636c 6173 733d 226b 223e  
│ │ │ │ +0000e1b0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73  return Or
│ │ │ │ +0000e1d0: 6465 7242 793c 2f73 7061 6e3e 3c73 7061  derBy(self
│ │ │ │ +0000e210: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000e220: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , **kwargs<
│ │ │ │ +0000e260: 7370 616e 2063 6c61 7373 3d22 7022 3e29  span class="p">)
│ │ │ │ +0000e270: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ +0000e290: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   desc(sel
│ │ │ │ +0000e2e0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c  f,
│ │ │ │ +0000e300: 203c 7370 616e 2063 6c61 7373 3d22 6f22   **kwargs
│ │ │ │ +0000e330: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  ):
│ │ │ │ +0000e350: 0a20 2020 2020 2020 203c 7370 616e 2063  .        return<
│ │ │ │ +0000e370: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> OrderBy(se
│ │ │ │ +0000e3c0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf, descending=True
│ │ │ │ +0000e430: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ +0000e450: 3c73 7061 6e20 636c 6173 733d 226f 223e  
│ │ │ │ +0000e460: 2a2a 3c2f 7370 616e 3e3c 7370 616e 2063  **kwargs<
│ │ │ │ +0000e480: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173  /span>)..
│ │ │ │ +0000e4a0: 2020 2020 3c73 7061 6e20 636c 6173 733d      def <
│ │ │ │ +0000e4c0: 7370 616e 2063 6c61 7373 3d22 6e66 223e  span class="nf">
│ │ │ │ +0000e4d0: 7265 7665 7273 655f 6f72 6465 7269 6e67  reverse_ordering
│ │ │ │ +0000e4e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +0000e500: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +0000e510: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self):.        ret
│ │ │ │ +0000e550: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e  urn self
│ │ │ │ +0000e570: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370  ..    def
│ │ │ │ +0000e590: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   flatten
│ │ │ │ +0000e5b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  (<
│ │ │ │ +0000e5d0: 7370 616e 2063 6c61 7373 3d22 6270 223e  span class="bp">
│ │ │ │ +0000e5e0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e  self):.        ""
│ │ │ │ +0000e640: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 0a3c  ;".<
│ │ │ │ +0000e650: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ +0000e660: 2020 2020 2020 2020 5265 6375 7273 6976          Recursiv
│ │ │ │ +0000e670: 656c 7920 7969 656c 6420 7468 6973 2065  ely yield this e
│ │ │ │ +0000e680: 7870 7265 7373 696f 6e20 616e 6420 616c  xpression and al
│ │ │ │ +0000e690: 6c20 7375 6265 7870 7265 7373 696f 6e73  l subexpressions
│ │ │ │ +0000e6a0: 2c20 696e 3c2f 7370 616e 3e0a 3c73 7061  , in.   
│ │ │ │ +0000e6c0: 2020 2020 2064 6570 7468 2d66 6972 7374       depth-first
│ │ │ │ +0000e6d0: 206f 7264 6572 2e3c 2f73 7061 6e3e 0a3c   order..<
│ │ │ │ +0000e6e0: 7370 616e 2063 6c61 7373 3d22 7364 223e  span class="sd">
│ │ │ │ +0000e6f0: 2020 2020 2020 2020 2671 756f 743b 2671          "&q
│ │ │ │ +0000e700: 756f 743b 2671 756f 743b 3c2f 7370 616e  uot;".        yield<
│ │ │ │ +0000e730: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> self.        for<
│ │ │ │ +0000e770: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> expr in s
│ │ │ │ +0000e7c0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20  elf.get_source_exp
│ │ │ │ +0000e800: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c  ressions<
│ │ │ │ +0000e810: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │ +0000e820: 293a 3c2f 7370 616e 3e0a 2020 2020 2020  ):.      
│ │ │ │ +0000e830: 2020 2020 2020 3c73 7061 6e20 636c 6173        if 
│ │ │ │ +0000e850: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ +0000e860: 6578 7072 3c2f 7370 616e 3e3c 7370 616e  expr:.            
│ │ │ │ +0000e890: 2020 2020 3c73 7061 6e20 636c 6173 733d      if h
│ │ │ │ +0000e8c0: 6173 6174 7472 3c2f 7370 616e 3e3c 7370  asattr(expr
│ │ │ │ +0000e900: 3c73 7061 6e20 636c 6173 733d 2270 223e  
│ │ │ │ +0000e910: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063  , "
│ │ │ │ +0000e930: 666c 6174 7465 6e26 7175 6f74 3b3c 2f73  flatten"):.  
│ │ │ │ +0000e960: 2020 2020 2020 2020 2020 2020 2020 2020                  
│ │ │ │ +0000e970: 2020 3c73 7061 6e20 636c 6173 733d 226b    yield from expr<
│ │ │ │ +0000e9b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e  span class="o">.
│ │ │ │ +0000e9c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  flatten(). 
│ │ │ │ +0000ea00: 2020 2020 2020 2020 2020 2020 2020 203c                 <
│ │ │ │ +0000ea10: 7370 616e 2063 6c61 7373 3d22 6b22 3e65  span class="k">e
│ │ │ │ +0000ea20: 6c73 653c 2f73 7061 6e3e 3c73 7061 6e20  lse:.             
│ │ │ │ +0000ea50: 2020 2020 2020 203c 7370 616e 2063 6c61         yield expr.
│ │ │ │ +0000ea90: 0a20 2020 203c 7370 616e 2063 6c61 7373  .    def 
│ │ │ │ +0000eab0: 3c73 7061 6e20 636c 6173 733d 226e 6622  select_format(se
│ │ │ │ +0000eb00: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063  lf, compiler, sql, par
│ │ │ │ +0000eba0: 616d 733c 2f73 7061 6e3e 3c73 7061 6e20  ams):.        ""
│ │ │ │ +0000ec00: 2671 756f 743b 3c2f 7370 616e 3e0a 3c73  ". 
│ │ │ │ +0000ec20: 2020 2020 2020 2043 7573 746f 6d20 666f         Custom fo
│ │ │ │ +0000ec30: 726d 6174 2066 6f72 2073 656c 6563 7420  rmat for select 
│ │ │ │ +0000ec40: 636c 6175 7365 732e 2046 6f72 2065 7861  clauses. For exa
│ │ │ │ +0000ec50: 6d70 6c65 2c20 4558 4953 5453 2065 7870  mple, EXISTS exp
│ │ │ │ +0000ec60: 7265 7373 696f 6e73 206e 6565 643c 2f73  ressions need.        to
│ │ │ │ +0000ec90: 2062 6520 7772 6170 7065 6420 696e 2043   be wrapped in C
│ │ │ │ +0000eca0: 4153 4520 5748 454e 206f 6e20 4f72 6163  ASE WHEN on Orac
│ │ │ │ +0000ecb0: 6c65 2e3c 2f73 7061 6e3e 0a3c 7370 616e  le..    
│ │ │ │ +0000ecd0: 2020 2020 2671 756f 743b 2671 756f 743b      ""
│ │ │ │ +0000ece0: 2671 756f 743b 3c2f 7370 616e 3e0a 2020  ".  
│ │ │ │ +0000ecf0: 2020 2020 2020 3c73 7061 6e20 636c 6173        if 
│ │ │ │ +0000ed10: 3c73 7061 6e20 636c 6173 733d 226e 6222  hasattr<
│ │ │ │ +0000ed30: 7370 616e 2063 6c61 7373 3d22 7022 3e28  span class="p">(
│ │ │ │  0000ed40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61  , 
│ │ │ │ -0000ed60: 3c73 7061 6e20 636c 6173 733d 2273 3222  "select_fo
│ │ │ │ -0000ed80: 726d 6174 2671 756f 743b 3c2f 7370 616e  rmat"):.     
│ │ │ │ -0000edb0: 2020 2020 2020 203c 7370 616e 2063 6c61         return self.output_
│ │ │ │ -0000ee20: 6669 656c 643c 2f73 7061 6e3e 3c73 7061  field.select_forma
│ │ │ │ -0000ee60: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c  t(
│ │ │ │ -0000ee80: 3c73 7061 6e20 636c 6173 733d 226e 223e  
│ │ │ │ -0000ee90: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c  compiler<
│ │ │ │ -0000eea0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c  span class="p">,
│ │ │ │ -0000eeb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c   sql, param
│ │ │ │ -0000ef00: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c  s)
│ │ │ │ -0000ef20: 0a20 2020 2020 2020 203c 7370 616e 2063  .        return<
│ │ │ │ -0000ef40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61  /span> sql, params
│ │ │ │ -0000ef90: 3c2f 7370 616e 3e0a 0a0a 3c64 6976 2063  ...
.[docs].@deconstructi │ │ │ │ -0000f060: 626c 653c 2f73 7061 6e3e 0a3c 7370 616e ble.class │ │ │ │ -0000f080: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c Express │ │ │ │ -0000f0a0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion(BaseExpression │ │ │ │ -0000f0e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0000f100: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0000f110: 436f 6d62 696e 6162 6c65 3c2f 7370 616e Combinable):. < │ │ │ │ -0000f150: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"&qu │ │ │ │ -0000f170: 6f74 3b26 7175 6f74 3b41 6e20 6578 7072 ot;"An expr │ │ │ │ -0000f180: 6573 7369 6f6e 2074 6861 7420 6361 6e20 ession that can │ │ │ │ -0000f190: 6265 2063 6f6d 6269 6e65 6420 7769 7468 be combined with │ │ │ │ -0000f1a0: 206f 7468 6572 2065 7870 7265 7373 696f other expressio │ │ │ │ -0000f1b0: 6e73 2e26 7175 6f74 3b26 7175 6f74 3b26 ns.""& │ │ │ │ -0000f1c0: 7175 6f74 3b3c 2f73 7061 6e3e 0a0a 2020 quot;.. │ │ │ │ -0000f1d0: 2020 3c73 7061 6e20 636c 6173 733d 226e @cached_prope │ │ │ │ -0000f1f0: 7274 793c 2f73 7061 6e3e 0a20 2020 203c rty. < │ │ │ │ -0000f200: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -0000f210: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef ident │ │ │ │ -0000f230: 6974 793c 2f73 7061 6e3e 3c73 7061 6e20 ity(self): │ │ │ │ -0000f280: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0000f290: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0000f2a0: 636f 6e73 7472 7563 746f 725f 7369 676e constructor_sign │ │ │ │ -0000f2b0: 6174 7572 653c 2f73 7061 6e3e 203c 7370 ature = inspect.sign │ │ │ │ -0000f320: 6174 7572 653c 2f73 7061 6e3e 3c73 7061 ature(self │ │ │ │ -0000f360: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0000f370: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .__init_ │ │ │ │ -0000f390: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c _) │ │ │ │ -0000f3b0: 0a20 2020 2020 2020 203c 7370 616e 2063 . argsself.outpu │ │ │ │ +0000ed90: 745f 6669 656c 643c 2f73 7061 6e3e 3c73 t_field,< │ │ │ │ +0000edb0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "se │ │ │ │ +0000edd0: 6c65 6374 5f66 6f72 6d61 7426 7175 6f74 lect_format" │ │ │ │ +0000ede0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;):. re │ │ │ │ +0000ee20: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn sel │ │ │ │ +0000ee40: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +0000ee60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0000ee70: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field.selec │ │ │ │ +0000eeb0: 745f 666f 726d 6174 3c2f 7370 616e 3e3c t_format< │ │ │ │ +0000eec0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0000eed0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 compiler< │ │ │ │ +0000eef0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0000ef10: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ +0000ef20: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql, params< │ │ │ │ +0000ef60: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0000ef70: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0000ef80: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0000ef90: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return sq │ │ │ │ +0000efb0: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l, │ │ │ │ +0000efd0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 params.. │ │ │ │ +0000eff0: 0a3c 6469 7620 636c 6173 733d 2276 6965 .
.[d │ │ │ │ +0000f090: 6f63 756d 656e 7469 5d3c 2f61 3e0a 3c73 ocumenti].@ │ │ │ │ +0000f0b0: 6465 636f 6e73 7472 7563 7469 626c 653c deconstructible< │ │ │ │ +0000f0c0: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61 /span>.class Expression< │ │ │ │ +0000f100: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(Ba │ │ │ │ +0000f130: 7365 4578 7072 6573 7369 6f6e 3c2f 7370 seExpression, Comb │ │ │ │ +0000f170: 696e 6162 6c65 3c2f 7370 616e 3e3c 7370 inable):< │ │ │ │ +0000f190: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61 /span>. ""& │ │ │ │ +0000f1d0: 7175 6f74 3b41 6e20 6578 7072 6573 7369 quot;An expressi │ │ │ │ +0000f1e0: 6f6e 2074 6861 7420 6361 6e20 6265 2063 on that can be c │ │ │ │ +0000f1f0: 6f6d 6269 6e65 6420 7769 7468 206f 7468 ombined with oth │ │ │ │ +0000f200: 6572 2065 7870 7265 7373 696f 6e73 2e26 er expressions.& │ │ │ │ +0000f210: 7175 6f74 3b26 7175 6f74 3b26 7175 6f74 quot;"" │ │ │ │ +0000f220: 3b3c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ;.. @ │ │ │ │ +0000f240: 6361 6368 6564 5f70 726f 7065 7274 793c cached_property< │ │ │ │ +0000f250: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. def identity< │ │ │ │ +0000f290: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0000f2c0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. cons │ │ │ │ +0000f300: 7472 7563 746f 725f 7369 676e 6174 7572 tructor_signatur │ │ │ │ +0000f310: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = inspect │ │ │ │ +0000f350: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0000f360: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .signatur │ │ │ │ +0000f380: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ +0000f3a0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self., kwa │ │ │ │ -0000f400: 7267 733c 2f73 7061 6e3e 203c 7370 616e rgs = self │ │ │ │ -0000f440: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0000f450: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c ._constru │ │ │ │ -0000f470: 6374 6f72 5f61 7267 733c 2f73 7061 6e3e ctor_args │ │ │ │ -0000f480: 0a20 2020 2020 2020 203c 7370 616e 2063 . signatu │ │ │ │ -0000f4a0: 7265 3c2f 7370 616e 3e20 3c73 7061 6e20 re = constructor_s │ │ │ │ -0000f4e0: 6967 6e61 7475 7265 3c2f 7370 616e 3e3c ignature< │ │ │ │ -0000f4f0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0000f500: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 bind_part │ │ │ │ -0000f520: 6961 6c3c 2f73 7061 6e3e 3c73 7061 6e20 ial(*args, ** │ │ │ │ -0000f5a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 kwargs). │ │ │ │ -0000f5e0: 2020 2020 203c 7370 616e 2063 6c61 7373 signature.app │ │ │ │ -0000f630: 6c79 5f64 6566 6175 6c74 733c 2f73 7061 ly_defaults(). │ │ │ │ -0000f660: 2020 2020 3c73 7061 6e20 636c 6173 733d arguments = si │ │ │ │ -0000f6b0: 676e 6174 7572 653c 2f73 7061 6e3e 3c73 gnature.< │ │ │ │ -0000f6d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>arguments< │ │ │ │ -0000f6f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.it │ │ │ │ -0000f720: 656d 733c 2f73 7061 6e3e 3c73 7061 6e20 ems(). iden │ │ │ │ -0000f760: 7469 7479 3c2f 7370 616e 3e20 3c73 7061 tity = [se │ │ │ │ -0000f7b0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.__class__]. │ │ │ │ -0000f810: 2020 203c 7370 616e 2063 6c61 7373 3d22 for ar │ │ │ │ -0000f840: 673c 2f73 7061 6e3e 3c73 7061 6e20 636c g, │ │ │ │ -0000f860: 203c 7370 616e 2063 6c61 7373 3d22 6e22 value i │ │ │ │ -0000f890: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n argumen │ │ │ │ -0000f8b0: 7473 3c2f 7370 616e 3e3c 7370 616e 2063 ts:. if │ │ │ │ -0000f8f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c isinsta │ │ │ │ -0000f910: 6e63 653c 2f73 7061 6e3e 3c73 7061 6e20 nce(value,< │ │ │ │ -0000f960: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> fields.Fiel │ │ │ │ -0000f9b0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d):. │ │ │ │ -0000f9e0: 2020 3c73 7061 6e20 636c 6173 733d 226b if valu │ │ │ │ -0000fa10: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e. │ │ │ │ -0000fa30: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0000fa40: 6e61 6d65 3c2f 7370 616e 3e20 3c73 7061 name and │ │ │ │ -0000fa60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c value.mode │ │ │ │ -0000fab0: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l: │ │ │ │ -0000fad0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0000fae0: 2020 2020 203c 7370 616e 2063 6c61 7373 value = (value< │ │ │ │ -0000fb50: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0000fb60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 model._meta │ │ │ │ -0000fbb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0000fbd0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6c span class="n">l │ │ │ │ -0000fbe0: 6162 656c 3c2f 7370 616e 3e3c 7370 616e abel, value │ │ │ │ -0000fc20: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0000fc30: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .name). │ │ │ │ -0000fc70: 2020 2020 2020 2020 2020 2020 3c73 7061 else │ │ │ │ -0000fc90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ -0000fcb0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0000fcc0: 2020 2020 3c73 7061 6e20 636c 6173 733d value │ │ │ │ -0000fce0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = type< │ │ │ │ -0000fd10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(va │ │ │ │ -0000fd40: 6c75 653c 2f73 7061 6e3e 3c73 7061 6e20 lue). < │ │ │ │ -0000fd70: 7370 616e 2063 6c61 7373 3d22 6b22 3e65 span class="k">e │ │ │ │ -0000fd80: 6c73 653c 2f73 7061 6e3e 3c73 7061 6e20 lse:. │ │ │ │ -0000fdb0: 2020 203c 7370 616e 2063 6c61 7373 3d22 value │ │ │ │ -0000fdd0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0000fde0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = make_ha │ │ │ │ -0000fe00: 7368 6162 6c65 3c2f 7370 616e 3e3c 7370 shable(value). │ │ │ │ -0000fe60: 2020 2020 2020 3c73 7061 6e20 636c 6173 identity.app │ │ │ │ -0000feb0: 656e 643c 2f73 7061 6e3e 3c73 7061 6e20 end((arg, value)). │ │ │ │ -0000ff40: 2020 2020 3c73 7061 6e20 636c 6173 733d return__init__). │ │ │ │ +0000f410: 2020 2020 203c 7370 616e 2063 6c61 7373 args │ │ │ │ +0000f430: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0000f440: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , kwargs< │ │ │ │ +0000f460: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +0000f480: 3c73 7061 6e20 636c 6173 733d 2262 7022 self._constructor │ │ │ │ +0000f4d0: 5f61 7267 733c 2f73 7061 6e3e 0a20 2020 _args. │ │ │ │ +0000f4e0: 2020 2020 203c 7370 616e 2063 6c61 7373 signature = < │ │ │ │ +0000f520: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0000f530: 6f6e 7374 7275 6374 6f72 5f73 6967 6e61 onstructor_signa │ │ │ │ +0000f540: 7475 7265 3c2f 7370 616e 3e3c 7370 616e ture.bind_partial< │ │ │ │ +0000f580: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(*< │ │ │ │ +0000f5b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>args, **kwargs │ │ │ │ +0000f620: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0000f630: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +0000f640: 203c 7370 616e 2063 6c61 7373 3d22 6e22 signature.apply_d │ │ │ │ +0000f690: 6566 6175 6c74 733c 2f73 7061 6e3e 3c73 efaults() │ │ │ │ +0000f6b0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0000f6c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0000f6d0: 6172 6775 6d65 6e74 733c 2f73 7061 6e3e arguments │ │ │ │ +0000f6e0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = signat │ │ │ │ +0000f710: 7572 653c 2f73 7061 6e3e 3c73 7061 6e20 ure.arguments.items< │ │ │ │ +0000f780: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(). │ │ │ │ +0000f7a0: 2020 2020 2020 2020 3c73 7061 6e20 636c identity │ │ │ │ +0000f7c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +0000f7e0: 203c 7370 616e 2063 6c61 7373 3d22 7022 [self.__ │ │ │ │ +0000f840: 636c 6173 735f 5f3c 2f73 7061 6e3e 3c73 class__]< │ │ │ │ +0000f860: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0000f870: 7370 616e 2063 6c61 7373 3d22 6b22 3e66 span class="k">f │ │ │ │ +0000f880: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or arg, val │ │ │ │ +0000f8d0: 7565 3c2f 7370 616e 3e20 3c73 7061 6e20 ue in arguments:. │ │ │ │ +0000f930: 2020 2020 2020 2020 2020 3c73 7061 6e20 if isinstance< │ │ │ │ +0000f970: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(va │ │ │ │ +0000f9a0: 6c75 653c 2f73 7061 6e3e 3c73 7061 6e20 lue, fields │ │ │ │ +0000f9e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0000f9f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .Field):. │ │ │ │ +0000fa30: 2020 2020 2020 2020 2020 2020 2020 3c73 if │ │ │ │ +0000fa50: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c value.name │ │ │ │ +0000faa0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c and value │ │ │ │ +0000fae0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0000faf0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .model:. │ │ │ │ +0000fb30: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000fb40: 203c 7370 616e 2063 6c61 7373 3d22 6e22 value =< │ │ │ │ +0000fb70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (< │ │ │ │ +0000fb90: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ +0000fba0: 616c 7565 3c2f 7370 616e 3e3c 7370 616e alue.model< │ │ │ │ +0000fbe0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0000fbf0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 _meta.label │ │ │ │ +0000fc40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +0000fc60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0000fc70: 7661 6c75 653c 2f73 7061 6e3e 3c73 7061 value.name< │ │ │ │ +0000fcb0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0000fcc0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0000fcd0: 2020 2020 2020 2020 3c73 7061 6e20 636c else:. │ │ │ │ +0000fd10: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0000fd20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0000fd30: 7661 6c75 653c 2f73 7061 6e3e 203c 7370 value = type(value< │ │ │ │ +0000fda0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ +0000fdc0: 2020 2020 2020 2020 2020 203c 7370 616e else< │ │ │ │ +0000fde0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>:. │ │ │ │ +0000fe00: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +0000fe10: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ +0000fe20: 616c 7565 3c2f 7370 616e 3e20 3c73 7061 alue = make_hashab │ │ │ │ +0000fe60: 6c65 3c2f 7370 616e 3e3c 7370 616e 2063 le(value). │ │ │ │ +0000fec0: 2020 3c73 7061 6e20 636c 6173 733d 226e identity.append< │ │ │ │ +0000ff10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>((< │ │ │ │ +0000ff30: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +0000ff40: 7267 3c2f 7370 616e 3e3c 7370 616e 2063 rg, tuple< │ │ │ │ -0000ff80: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0000ff90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 identity< │ │ │ │ -0000ffb0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).. │ │ │ │ -0000ffd0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -0000fff0: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ -00010000: 5f5f 6571 5f5f 3c2f 7370 616e 3e3c 7370 __eq__(self, other< │ │ │ │ -00010070: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -00010090: 2020 2020 2020 2020 3c73 7061 6e20 636c if not i │ │ │ │ -000100e0: 7369 6e73 7461 6e63 653c 2f73 7061 6e3e sinstance │ │ │ │ -000100f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00010100: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (other, Exp │ │ │ │ -00010150: 7265 7373 696f 6e3c 2f73 7061 6e3e 3c73 ression): │ │ │ │ -00010170: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00010180: 2020 2020 3c73 7061 6e20 636c 6173 733d return NotImplemente │ │ │ │ -000101c0: 643c 2f73 7061 6e3e 0a20 2020 2020 2020 d. │ │ │ │ -000101d0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -000101f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -00010200: 7468 6572 3c2f 7370 616e 3e3c 7370 616e ther.identity == se │ │ │ │ -00010270: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.identity │ │ │ │ -000102b0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -000102d0: 203c 7370 616e 2063 6c61 7373 3d22 666d __hash__(self):. │ │ │ │ -00010340: 2020 2020 2020 203c 7370 616e 2063 6c61 return hashvalue)) │ │ │ │ +0000ff90: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0000ffa0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0000ffb0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return t │ │ │ │ +0000ffd0: 7570 6c65 3c2f 7370 616e 3e3c 7370 616e uple(identity).. │ │ │ │ +00010030: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00010040: 6465 663c 2f73 7061 6e3e 203c 7370 616e def __eq │ │ │ │ +00010060: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __(self, other):. │ │ │ │ +000100f0: 2020 2020 3c73 7061 6e20 636c 6173 733d if n │ │ │ │ +00010120: 6f74 3c2f 7370 616e 3e20 3c73 7061 6e20 ot isins │ │ │ │ +00010140: 7461 6e63 653c 2f73 7061 6e3e 3c73 7061 tance(other │ │ │ │ +00010180: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00010190: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , Express │ │ │ │ +000101b0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion):. │ │ │ │ +000101e0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +000101f0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return N │ │ │ │ +00010210: 6f74 496d 706c 656d 656e 7465 643c 2f73 otImplemented. ret │ │ │ │ +00010240: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn other │ │ │ │ +00010260: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00010280: 7370 616e 2063 6c61 7373 3d22 6e22 3e69 span class="n">i │ │ │ │ +00010290: 6465 6e74 6974 793c 2f73 7061 6e3e 203c dentity < │ │ │ │ +000102a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +000102b0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = self.ide │ │ │ │ +00010300: 6e74 6974 793c 2f73 7061 6e3e 0a0a 2020 ntity.. │ │ │ │ +00010310: 2020 3c73 7061 6e20 636c 6173 733d 226b def __ │ │ │ │ +00010340: 6861 7368 5f5f 3c2f 7370 616e 3e3c 7370 hash__(self(self.ide │ │ │ │ -000103e0: 6e74 6974 793c 2f73 7061 6e3e 3c73 7061 ntity)
....# │ │ │ │ -00010420: 2054 7970 6520 696e 6665 7265 6e63 6520 Type inference │ │ │ │ -00010430: 666f 7220 436f 6d62 696e 6564 4578 7072 for CombinedExpr │ │ │ │ -00010440: 6573 7369 6f6e 2e6f 7574 7075 745f 6669 ession.output_fi │ │ │ │ -00010450: 656c 642e 3c2f 7370 616e 3e0a 3c73 7061 eld..# M │ │ │ │ -00010470: 6973 7369 6e67 2069 7465 6d73 2077 696c issing items wil │ │ │ │ -00010480: 6c20 7265 7375 6c74 2069 6e20 4669 656c l result in Fiel │ │ │ │ -00010490: 6445 7272 6f72 2c20 6279 2064 6573 6967 dError, by desig │ │ │ │ -000104a0: 6e2e 3c2f 7370 616e 3e0a 3c73 7061 6e20 n..#.# The curre │ │ │ │ -000104e0: 6e74 2061 7070 726f 6163 6820 666f 7220 nt approach for │ │ │ │ -000104f0: 4e55 4c4c 2069 7320 6261 7365 6420 6f6e NULL is based on │ │ │ │ -00010500: 206c 6f77 6573 7420 636f 6d6d 6f6e 2064 lowest common d │ │ │ │ -00010510: 656e 6f6d 696e 6174 6f72 2062 6568 6176 enominator behav │ │ │ │ -00010520: 696f 723c 2f73 7061 6e3e 0a3c 7370 616e ior.# i. │ │ │ │ -00010540: 652e 2069 6620 6f6e 6520 6f66 2074 6865 e. if one of the │ │ │ │ -00010550: 2073 7570 706f 7274 6564 2064 6174 6162 supported datab │ │ │ │ -00010560: 6173 6573 2069 7320 7261 6973 696e 6720 ases is raising │ │ │ │ -00010570: 616e 2065 7272 6f72 2028 7261 7468 6572 an error (rather │ │ │ │ -00010580: 2074 6861 6e3c 2f73 7061 6e3e 0a3c 7370 than.# │ │ │ │ -000105a0: 7265 7475 726e 204e 554c 4c29 2066 6f72 return NULL) for │ │ │ │ -000105b0: 2060 7661 6c20 266c 743b 6f70 2667 743b `val <op> │ │ │ │ -000105c0: 204e 554c 4c60 2c20 7468 656e 2044 6a61 NULL`, then Dja │ │ │ │ -000105d0: 6e67 6f20 7261 6973 6573 2046 6965 6c64 ngo raises Field │ │ │ │ -000105e0: 4572 726f 722e 3c2f 7370 616e 3e0a 3c73 Error..No │ │ │ │ -00010600: 6e65 5479 7065 3c2f 7370 616e 3e20 3c73 neType =< │ │ │ │ -00010620: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> type(None │ │ │ │ -00010670: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00010690: 0a3c 7370 616e 2063 6c61 7373 3d22 6e22 ._connector_comb │ │ │ │ -000106b0: 696e 6174 696f 6e73 3c2f 7370 616e 3e20 inations │ │ │ │ -000106c0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000106d0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = [. # Numeric │ │ │ │ -00010710: 206f 7065 7261 7469 6f6e 7320 2d20 6f70 operations - op │ │ │ │ -00010720: 6572 616e 6473 206f 6620 7361 6d65 2074 erands of same t │ │ │ │ -00010730: 7970 652e 3c2f 7370 616e 3e0a 2020 2020 ype.. │ │ │ │ -00010740: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00010750: 7b3c 2f73 7061 6e3e 0a20 2020 2020 2020 {. │ │ │ │ -00010760: 203c 7370 616e 2063 6c61 7373 3d22 6e22 connector: [. < │ │ │ │ -000107c0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -000107d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 fields.Inte │ │ │ │ -00010820: 6765 7246 6965 6c64 3c2f 7370 616e 3e3c gerField< │ │ │ │ -00010830: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00010840: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Int │ │ │ │ -00010890: 6567 6572 4669 656c 643c 2f73 7061 6e3e egerField │ │ │ │ -000108a0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000108b0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , fields< │ │ │ │ -000108d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.In │ │ │ │ -00010900: 7465 6765 7246 6965 6c64 3c2f 7370 616e tegerField),. │ │ │ │ -00010930: 2020 2020 2020 203c 7370 616e 2063 6c61 (< │ │ │ │ -00010950: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00010960: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.FloatField, fi │ │ │ │ -000109d0: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.FloatField, fie │ │ │ │ -00010a40: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.FloatField),. │ │ │ │ -00010aa0: 2020 2020 2020 2020 203c 7370 616e 2063 (fields.< │ │ │ │ -00010af0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DecimalFie │ │ │ │ -00010b10: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld, fields< │ │ │ │ -00010b50: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00010b60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DecimalFi │ │ │ │ -00010b80: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld,
fields │ │ │ │ -00010bc0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00010bd0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .DecimalF │ │ │ │ -00010bf0: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield),. ]. fo │ │ │ │ -00010c50: 723c 2f73 7061 6e3e 203c 7370 616e 2063 r connect │ │ │ │ -00010c70: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or in (. │ │ │ │ -00010cb0: 2020 2020 2020 2020 2020 3c73 7061 6e20 Combin │ │ │ │ -00010cd0: 6162 6c65 3c2f 7370 616e 3e3c 7370 616e able.ADD,. │ │ │ │ -00010d30: 2020 3c73 7061 6e20 636c 6173 733d 226e Combinable.SUB,. │ │ │ │ -00010da0: 2020 2020 2020 2020 2020 3c73 7061 6e20 Combin │ │ │ │ -00010dc0: 6162 6c65 3c2f 7370 616e 3e3c 7370 616e able.MUL,. │ │ │ │ -00010e20: 2020 3c73 7061 6e20 636c 6173 733d 2263 # Behavior fo │ │ │ │ -00010e40: 7220 4449 5620 7769 7468 2069 6e74 6567 r DIV with integ │ │ │ │ -00010e50: 6572 2061 7267 756d 656e 7473 2066 6f6c er arguments fol │ │ │ │ -00010e60: 6c6f 7773 2050 6f73 7467 7265 732f 5351 lows Postgres/SQ │ │ │ │ -00010e70: 4c69 7465 2c3c 2f73 7061 6e3e 0a20 2020 Lite,. │ │ │ │ -00010e80: 2020 2020 2020 2020 203c 7370 616e 2063 # not │ │ │ │ -00010ea0: 4d79 5351 4c2f 4f72 6163 6c65 2e3c 2f73 MySQL/Oracle.. │ │ │ │ -00010ec0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 Combinable.DIV,. │ │ │ │ -00010f30: 2020 2020 2020 2020 203c 7370 616e 2063 Combina │ │ │ │ -00010f50: 626c 653c 2f73 7061 6e3e 3c73 7061 6e20 ble.MOD,. │ │ │ │ -00010fb0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 Combinable.POW,. │ │ │ │ -00011020: 2020 2020 203c 7370 616e 2063 6c61 7373 ). │ │ │ │ -00011040: 2020 3c73 7061 6e20 636c 6173 733d 2270 },. │ │ │ │ -00011060: 3c73 7061 6e20 636c 6173 733d 2263 3122 # Numeric opera │ │ │ │ -00011080: 7469 6f6e 7320 2d20 6f70 6572 616e 6473 tions - operands │ │ │ │ -00011090: 206f 6620 6469 6666 6572 656e 7420 7479 of different ty │ │ │ │ -000110a0: 7065 2e3c 2f73 7061 6e3e 0a20 2020 203c pe.. < │ │ │ │ -000110b0: 7370 616e 2063 6c61 7373 3d22 7022 3e7b span class="p">{ │ │ │ │ -000110c0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000110d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000110e0: 636f 6e6e 6563 746f 723c 2f73 7061 6e3e connector │ │ │ │ -000110f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00011100: 3a3c 2f73 7061 6e3e 203c 7370 616e 2063 : [. (< │ │ │ │ -00011140: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>fields.Integ │ │ │ │ -00011190: 6572 4669 656c 643c 2f73 7061 6e3e 3c73 erField,< │ │ │ │ -000111b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> fields.Deci │ │ │ │ -00011200: 6d61 6c46 6965 6c64 3c2f 7370 616e 3e3c malField< │ │ │ │ -00011210: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00011220: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Dec │ │ │ │ -00011270: 696d 616c 4669 656c 643c 2f73 7061 6e3e imalField │ │ │ │ -00011280: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00011290: 292c 3c2f 7370 616e 3e0a 2020 2020 2020 ),. │ │ │ │ -000112a0: 2020 2020 2020 3c73 7061 6e20 636c 6173 (fi │ │ │ │ -000112d0: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.DecimalField< │ │ │ │ -00011310: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00011330: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00011340: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.IntegerField │ │ │ │ -00011380: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -000113a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000113b0: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.DecimalFiel │ │ │ │ -000113f0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d),. (< │ │ │ │ -00011430: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>fields.Integ │ │ │ │ -00011480: 6572 4669 656c 643c 2f73 7061 6e3e 3c73 erField,< │ │ │ │ -000114a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> fields.Floa │ │ │ │ -000114f0: 7446 6965 6c64 3c2f 7370 616e 3e3c 7370 tField, fields.Float │ │ │ │ -00011560: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field),. │ │ │ │ -00011590: 2020 3c73 7061 6e20 636c 6173 733d 2270 (fields │ │ │ │ -000115c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000115e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e46 span class="n">F │ │ │ │ -000115f0: 6c6f 6174 4669 656c 643c 2f73 7061 6e3e loatField │ │ │ │ -00011600: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00011610: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , fields< │ │ │ │ -00011630: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.In │ │ │ │ -00011660: 7465 6765 7246 6965 6c64 3c2f 7370 616e tegerField, fields │ │ │ │ -000116a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000116c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e46 span class="n">F │ │ │ │ -000116d0: 6c6f 6174 4669 656c 643c 2f73 7061 6e3e loatField │ │ │ │ -000116e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000116f0: 292c 3c2f 7370 616e 3e0a 2020 2020 2020 ),. │ │ │ │ -00011700: 2020 3c73 7061 6e20 636c 6173 733d 2270 ]. │ │ │ │ -00011720: 2020 203c 7370 616e 2063 6c61 7373 3d22 for co │ │ │ │ -00011750: 6e6e 6563 746f 723c 2f73 7061 6e3e 203c nnector < │ │ │ │ -00011760: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -00011770: 696e 3c2f 7370 616e 3e20 3c73 7061 6e20 in (. < │ │ │ │ -000117a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e43 span class="n">C │ │ │ │ -000117b0: 6f6d 6269 6e61 626c 653c 2f73 7061 6e3e ombinable │ │ │ │ -000117c0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000117d0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .ADD,. │ │ │ │ -00011810: 2020 2020 2020 203c 7370 616e 2063 6c61 Combinabl │ │ │ │ -00011830: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e. │ │ │ │ -00011850: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00011860: 5355 423c 2f73 7061 6e3e 3c73 7061 6e20 SUB,. < │ │ │ │ -00011890: 7370 616e 2063 6c61 7373 3d22 6e22 3e43 span class="n">C │ │ │ │ -000118a0: 6f6d 6269 6e61 626c 653c 2f73 7061 6e3e ombinable │ │ │ │ -000118b0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000118c0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .MUL,. │ │ │ │ -00011900: 2020 2020 2020 203c 7370 616e 2063 6c61 Combinabl │ │ │ │ -00011920: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e. │ │ │ │ -00011940: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00011950: 4449 563c 2f73 7061 6e3e 3c73 7061 6e20 DIV,. < │ │ │ │ -00011980: 7370 616e 2063 6c61 7373 3d22 6e22 3e43 span class="n">C │ │ │ │ -00011990: 6f6d 6269 6e61 626c 653c 2f73 7061 6e3e ombinable │ │ │ │ -000119a0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000119b0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .MOD,. │ │ │ │ -000119f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 ). │ │ │ │ -00011a10: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00011a20: 7d2c 3c2f 7370 616e 3e0a 2020 2020 3c73 },. # │ │ │ │ -00011a40: 2042 6974 7769 7365 206f 7065 7261 746f Bitwise operato │ │ │ │ -00011a50: 7273 2e3c 2f73 7061 6e3e 0a20 2020 203c rs.. < │ │ │ │ -00011a60: 7370 616e 2063 6c61 7373 3d22 7022 3e7b span class="p">{ │ │ │ │ -00011a70: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00011a80: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00011a90: 636f 6e6e 6563 746f 723c 2f73 7061 6e3e connector │ │ │ │ -00011aa0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00011ab0: 3a3c 2f73 7061 6e3e 203c 7370 616e 2063 : [. (< │ │ │ │ -00011af0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>fields.Integ │ │ │ │ -00011b40: 6572 4669 656c 643c 2f73 7061 6e3e 3c73 erField,< │ │ │ │ -00011b60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> fields.Inte │ │ │ │ -00011bb0: 6765 7246 6965 6c64 3c2f 7370 616e 3e3c gerField< │ │ │ │ -00011bc0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00011bd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Int │ │ │ │ -00011c20: 6567 6572 4669 656c 643c 2f73 7061 6e3e egerField │ │ │ │ -00011c30: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00011c40: 292c 3c2f 7370 616e 3e0a 2020 2020 2020 ),. │ │ │ │ -00011c50: 2020 3c73 7061 6e20 636c 6173 733d 2270 ]. │ │ │ │ -00011c70: 2020 203c 7370 616e 2063 6c61 7373 3d22 for co │ │ │ │ -00011ca0: 6e6e 6563 746f 723c 2f73 7061 6e3e 203c nnector < │ │ │ │ -00011cb0: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -00011cc0: 696e 3c2f 7370 616e 3e20 3c73 7061 6e20 in (. < │ │ │ │ -00011cf0: 7370 616e 2063 6c61 7373 3d22 6e22 3e43 span class="n">C │ │ │ │ -00011d00: 6f6d 6269 6e61 626c 653c 2f73 7061 6e3e ombinable │ │ │ │ -00011d10: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00011d20: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .BITAND,. │ │ │ │ -00011d60: 2020 2020 2020 2020 2020 3c73 7061 6e20 Combin │ │ │ │ -00011d80: 6162 6c65 3c2f 7370 616e 3e3c 7370 616e able.BITOR< │ │ │ │ -00011dc0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00011dd0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00011de0: 2020 2020 3c73 7061 6e20 636c 6173 733d Combinable.BIT │ │ │ │ -00011e30: 4c45 4654 5348 4946 543c 2f73 7061 6e3e LEFTSHIFT │ │ │ │ -00011e40: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00011e50: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ -00011e60: 2020 2020 203c 7370 616e 2063 6c61 7373 Combinable< │ │ │ │ -00011e80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.BI │ │ │ │ -00011eb0: 5452 4947 4854 5348 4946 543c 2f73 7061 TRIGHTSHIFT,. │ │ │ │ -00011ee0: 2020 2020 2020 203c 7370 616e 2063 6c61 Combinabl │ │ │ │ -00011f00: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e. │ │ │ │ -00011f20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00011f30: 4249 5458 4f52 3c2f 7370 616e 3e3c 7370 BITXOR,. )< │ │ │ │ -00011f70: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. },. # Nume │ │ │ │ -00011fb0: 7269 6320 7769 7468 204e 554c 4c2e 3c2f ric with NULL.. {. conne │ │ │ │ -00012000: 6374 6f72 3c2f 7370 616e 3e3c 7370 616e ctor: [. │ │ │ │ -00012040: 2020 2020 2020 2020 203c 7370 616e 2063 (field_type, NoneT │ │ │ │ -000120b0: 7970 653c 2f73 7061 6e3e 3c73 7061 6e20 ype, field_type),. │ │ │ │ -00012110: 2020 2020 2020 2020 2020 3c73 7061 6e20 (NoneType, field_ │ │ │ │ -00012180: 7479 7065 3c2f 7370 616e 3e3c 7370 616e type, field_type),. │ │ │ │ -000121e0: 2020 2020 2020 203c 7370 616e 2063 6c61 ]. │ │ │ │ -00012200: 2020 2020 2020 2020 3c73 7061 6e20 636c for connector in < │ │ │ │ -00012260: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00012270: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00012280: 2020 2020 3c73 7061 6e20 636c 6173 733d Combinable.ADD │ │ │ │ -000122d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ,. │ │ │ │ -000122f0: 2020 2020 2020 2020 2020 2020 3c73 7061 Comb │ │ │ │ -00012310: 696e 6162 6c65 3c2f 7370 616e 3e3c 7370 inable.SUB< │ │ │ │ -00012350: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00012360: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00012370: 2020 2020 3c73 7061 6e20 636c 6173 733d Combinable.MUL │ │ │ │ -000123c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ,. │ │ │ │ -000123e0: 2020 2020 2020 2020 2020 2020 3c73 7061 Comb │ │ │ │ -00012400: 696e 6162 6c65 3c2f 7370 616e 3e3c 7370 inable.DIV< │ │ │ │ -00012440: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00012450: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00012460: 2020 2020 3c73 7061 6e20 636c 6173 733d Combinable.MOD │ │ │ │ -000124b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ,. │ │ │ │ -000124d0: 2020 2020 2020 2020 2020 2020 3c73 7061 Comb │ │ │ │ -000124f0: 696e 6162 6c65 3c2f 7370 616e 3e3c 7370 inable.POW< │ │ │ │ -00012530: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00012540: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00012550: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00012560: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -00012570: 203c 7370 616e 2063 6c61 7373 3d22 6b22 for fiel │ │ │ │ -000125a0: 645f 7479 7065 3c2f 7370 616e 3e20 3c73 d_type i │ │ │ │ -000125c0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n (fields.< │ │ │ │ -00012610: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>IntegerFie │ │ │ │ -00012630: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld, fields< │ │ │ │ -00012670: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00012680: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DecimalFi │ │ │ │ -000126a0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld, fields │ │ │ │ -000126e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000126f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .FloatFie │ │ │ │ -00012710: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld). },. │ │ │ │ -00012750: 2020 2020 3c73 7061 6e20 636c 6173 733d # Date/Date │ │ │ │ -00012770: 5469 6d65 4669 656c 642f 4475 7261 7469 TimeField/Durati │ │ │ │ -00012780: 6f6e 4669 656c 642f 5469 6d65 4669 656c onField/TimeFiel │ │ │ │ -00012790: 642e 3c2f 7370 616e 3e0a 2020 2020 3c73 d.. {< │ │ │ │ -000127b0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -000127c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e43 span class="n">C │ │ │ │ -000127d0: 6f6d 6269 6e61 626c 653c 2f73 7061 6e3e ombinable │ │ │ │ -000127e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000127f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .ADD: [. │ │ │ │ -00012850: 3c73 7061 6e20 636c 6173 733d 2263 3122 # Date/DateTime │ │ │ │ -00012870: 4669 656c 642e 3c2f 7370 616e 3e0a 2020 Field.. │ │ │ │ -00012880: 2020 2020 2020 2020 2020 3c73 7061 6e20 (fields< │ │ │ │ -000128c0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000128d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DateField │ │ │ │ -000128f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00012910: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00012920: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.DurationFie │ │ │ │ -00012960: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld, fields< │ │ │ │ -000129a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000129b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DateTimeF │ │ │ │ -000129d0: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield),. │ │ │ │ -00012a00: 203c 7370 616e 2063 6c61 7373 3d22 7022 (fields< │ │ │ │ -00012a30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Da │ │ │ │ -00012a60: 7465 5469 6d65 4669 656c 643c 2f73 7061 teTimeField, field │ │ │ │ -00012aa0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ -00012ac0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00012ad0: 4475 7261 7469 6f6e 4669 656c 643c 2f73 DurationField, fie │ │ │ │ -00012b10: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DateTimeField< │ │ │ │ -00012b50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>),. │ │ │ │ -00012b70: 2020 2020 2020 2020 2020 2020 3c73 7061 (fields.Duratio │ │ │ │ -00012be0: 6e46 6965 6c64 3c2f 7370 616e 3e3c 7370 nField, fields.DateF │ │ │ │ -00012c50: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield, fields.DateTim │ │ │ │ -00012cc0: 6546 6965 6c64 3c2f 7370 616e 3e3c 7370 eField),< │ │ │ │ -00012ce0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -00012cf0: 2020 203c 7370 616e 2063 6c61 7373 3d22 (field │ │ │ │ -00012d20: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ -00012d40: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00012d50: 4475 7261 7469 6f6e 4669 656c 643c 2f73 DurationField, fie │ │ │ │ -00012d90: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DateTimeField< │ │ │ │ -00012dd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00012df0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00012e00: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.DateTimeFiel │ │ │ │ -00012e40: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d),. # │ │ │ │ -00012e80: 2044 7572 6174 696f 6e46 6965 6c64 2e3c DurationField.< │ │ │ │ -00012e90: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -00012ea0: 2020 203c 7370 616e 2063 6c61 7373 3d22 (field │ │ │ │ -00012ed0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ -00012ef0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00012f00: 4475 7261 7469 6f6e 4669 656c 643c 2f73 DurationField, fie │ │ │ │ -00012f40: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DurationField< │ │ │ │ -00012f80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00012fa0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00012fb0: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.DurationFiel │ │ │ │ -00012ff0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d),. # │ │ │ │ -00013030: 2054 696d 6546 6965 6c64 2e3c 2f73 7061 TimeField.. < │ │ │ │ -00013050: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00013060: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 fields.Time │ │ │ │ -000130b0: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field, fields.Durati │ │ │ │ -00013120: 6f6e 4669 656c 643c 2f73 7061 6e3e 3c73 onField,< │ │ │ │ -00013140: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> fields.Time │ │ │ │ -00013190: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field),. │ │ │ │ -000131c0: 2020 3c73 7061 6e20 636c 6173 733d 2270 (fields │ │ │ │ -000131f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00013210: 7370 616e 2063 6c61 7373 3d22 6e22 3e44 span class="n">D │ │ │ │ -00013220: 7572 6174 696f 6e46 6965 6c64 3c2f 7370 urationField, fiel │ │ │ │ -00013260: 6473 3c2f 7370 616e 3e3c 7370 616e 2063 ds.TimeField, fields │ │ │ │ -000132d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000132f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e54 span class="n">T │ │ │ │ -00013300: 696d 6546 6965 6c64 3c2f 7370 616e 3e3c imeField< │ │ │ │ -00013310: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00013320: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ -00013330: 203c 7370 616e 2063 6c61 7373 3d22 7022 ],. < │ │ │ │ -00013350: 7370 616e 2063 6c61 7373 3d22 7022 3e7d span class="p">} │ │ │ │ -00013360: 2c3c 2f73 7061 6e3e 0a20 2020 203c 7370 ,. {. Co │ │ │ │ -000133a0: 6d62 696e 6162 6c65 3c2f 7370 616e 3e3c mbinable< │ │ │ │ -000133b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000133c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 SUB: [. < │ │ │ │ -00013420: 7370 616e 2063 6c61 7373 3d22 6331 223e span class="c1"> │ │ │ │ -00013430: 2320 4461 7465 2f44 6174 6554 696d 6546 # Date/DateTimeF │ │ │ │ -00013440: 6965 6c64 2e3c 2f73 7061 6e3e 0a20 2020 ield.. │ │ │ │ -00013450: 2020 2020 2020 2020 203c 7370 616e 2063 (fields.< │ │ │ │ -000134a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DateField< │ │ │ │ -000134c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -000134e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -000134f0: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.DurationFiel │ │ │ │ -00013530: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d, │ │ │ │ -00013550: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ -00013580: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DateTimeFi │ │ │ │ -000135a0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld),. │ │ │ │ -000135d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000135e0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (fields.Dat │ │ │ │ -00013630: 6554 696d 6546 6965 6c64 3c2f 7370 616e eTimeField, fields │ │ │ │ -00013670: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00013690: 7370 616e 2063 6c61 7373 3d22 6e22 3e44 span class="n">D │ │ │ │ -000136a0: 7572 6174 696f 6e46 6965 6c64 3c2f 7370 urationField, fiel │ │ │ │ -000136e0: 6473 3c2f 7370 616e 3e3c 7370 616e 2063 ds.DateTimeField),. │ │ │ │ -00013740: 2020 2020 2020 2020 2020 203c 7370 616e (fields │ │ │ │ -00013780: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00013790: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .DateFiel │ │ │ │ -000137b0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d, │ │ │ │ -000137d0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ -00013800: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DateField< │ │ │ │ -00013820: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00013840: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00013850: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.DurationFiel │ │ │ │ -00013890: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d),. (< │ │ │ │ -000138d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>fields.DateF │ │ │ │ -00013920: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield, fields.DateTim │ │ │ │ -00013990: 6546 6965 6c64 3c2f 7370 616e 3e3c 7370 eField, fields.Durat │ │ │ │ -00013a00: 696f 6e46 6965 6c64 3c2f 7370 616e 3e3c ionField< │ │ │ │ -00013a10: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00013a20: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ -00013a30: 2020 2020 203c 7370 616e 2063 6c61 7373 (fie │ │ │ │ -00013a60: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DateTimeField< │ │ │ │ -00013aa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00013ac0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00013ad0: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.DateField, fie │ │ │ │ -00013b40: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DurationField< │ │ │ │ -00013b80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>),. │ │ │ │ -00013ba0: 2020 2020 2020 2020 2020 2020 3c73 7061 (fields.DateTim │ │ │ │ -00013c10: 6546 6965 6c64 3c2f 7370 616e 3e3c 7370 eField, fields.DateT │ │ │ │ -00013c80: 696d 6546 6965 6c64 3c2f 7370 616e 3e3c imeField< │ │ │ │ -00013c90: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00013ca0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Dur │ │ │ │ -00013cf0: 6174 696f 6e46 6965 6c64 3c2f 7370 616e ationField),. │ │ │ │ -00013d20: 2020 2020 2020 203c 7370 616e 2063 6c61 # Durati │ │ │ │ -00013d40: 6f6e 4669 656c 642e 3c2f 7370 616e 3e0a onField.. │ │ │ │ -00013d50: 2020 2020 2020 2020 2020 2020 3c73 7061 (fields.Duratio │ │ │ │ -00013dc0: 6e46 6965 6c64 3c2f 7370 616e 3e3c 7370 nField, fields.Durat │ │ │ │ -00013e30: 696f 6e46 6965 6c64 3c2f 7370 616e 3e3c ionField< │ │ │ │ -00013e40: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00013e50: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Dur │ │ │ │ -00013ea0: 6174 696f 6e46 6965 6c64 3c2f 7370 616e ationField),. │ │ │ │ -00013ed0: 2020 2020 2020 203c 7370 616e 2063 6c61 # TimeFi │ │ │ │ -00013ef0: 656c 642e 3c2f 7370 616e 3e0a 2020 2020 eld.. │ │ │ │ -00013f00: 2020 2020 2020 2020 3c73 7061 6e20 636c ( │ │ │ │ -00013f20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00013f30: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.TimeField, fi │ │ │ │ -00013fa0: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.DurationField │ │ │ │ -00013fe0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00014000: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00014010: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.TimeField),. │ │ │ │ -00014070: 2020 2020 2020 2020 2020 203c 7370 616e (fields │ │ │ │ -000140b0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000140c0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .TimeFiel │ │ │ │ -000140e0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d, │ │ │ │ -00014100: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ -00014130: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>TimeField< │ │ │ │ -00014150: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00014170: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00014180: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.DurationFiel │ │ │ │ -000141c0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d),. ],. },.].._con │ │ │ │ -00014250: 6e65 6374 6f72 5f63 6f6d 6269 6e61 746f nector_combinato │ │ │ │ -00014260: 7273 3c2f 7370 616e 3e20 3c73 7061 6e20 rs = defaultdict(li │ │ │ │ -000142d0: 7374 3c2f 7370 616e 3e3c 7370 616e 2063 st)...def < │ │ │ │ -00014310: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ -00014320: 7265 6769 7374 6572 5f63 6f6d 6269 6e61 register_combina │ │ │ │ -00014330: 626c 655f 6669 656c 6473 3c2f 7370 616e ble_fields(lhs, conn │ │ │ │ -000143a0: 6563 746f 723c 2f73 7061 6e3e 3c73 7061 ector, rhs< │ │ │ │ -000143e0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -000143f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c result):.< │ │ │ │ -00014430: 7370 616e 2063 6c61 7373 3d22 7722 3e20 span class="w"> │ │ │ │ -00014440: 2020 203c 2f73 7061 6e3e 3c73 7061 6e20 " │ │ │ │ -00014460: 3b26 7175 6f74 3b26 7175 6f74 3b3c 2f73 ;"". Regist │ │ │ │ -00014490: 6572 2063 6f6d 6269 6e61 626c 6520 7479 er combinable ty │ │ │ │ -000144a0: 7065 733a 3c2f 7370 616e 3e0a 3c73 7061 pes:. │ │ │ │ -000144c0: 2020 2020 206c 6873 2026 6c74 3b63 6f6e lhs <con │ │ │ │ -000144d0: 6e65 6374 6f72 2667 743b 2072 6873 202d nector> rhs - │ │ │ │ -000144e0: 2667 743b 2072 6573 756c 743c 2f73 7061 > result. e.g.. reg │ │ │ │ -00014530: 6973 7465 725f 636f 6d62 696e 6162 6c65 ister_combinable │ │ │ │ -00014540: 5f66 6965 6c64 7328 3c2f 7370 616e 3e0a _fields(. │ │ │ │ -00014550: 3c73 7061 6e20 636c 6173 733d 2273 6422 Int │ │ │ │ -00014570: 6567 6572 4669 656c 642c 2043 6f6d 6269 egerField, Combi │ │ │ │ -00014580: 6e61 626c 652e 4144 442c 2046 6c6f 6174 nable.ADD, Float │ │ │ │ -00014590: 4669 656c 642c 2046 6c6f 6174 4669 656c Field, FloatFiel │ │ │ │ -000145a0: 643c 2f73 7061 6e3e 0a3c 7370 616e 2063 d. │ │ │ │ -000145c0: 2020 293c 2f73 7061 6e3e 0a3c 7370 616e ). │ │ │ │ -000145e0: 2671 756f 743b 2671 756f 743b 2671 756f ""&quo │ │ │ │ -000145f0: 743b 3c2f 7370 616e 3e0a 2020 2020 3c73 t;. _c │ │ │ │ -00014610: 6f6e 6e65 6374 6f72 5f63 6f6d 6269 6e61 onnector_combina │ │ │ │ -00014620: 746f 7273 3c2f 7370 616e 3e3c 7370 616e tors[connector].append │ │ │ │ -000146b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000146c0: 2828 3c2f 7370 616e 3e3c 7370 616e 2063 ((lhs, rhs< │ │ │ │ -00014710: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00014730: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ -00014740: 6573 756c 743c 2f73 7061 6e3e 3c73 7061 esult))...for d in< │ │ │ │ -000147b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> _connecto │ │ │ │ -000147d0: 725f 636f 6d62 696e 6174 696f 6e73 3c2f r_combinations:. │ │ │ │ -00014800: 2020 3c73 7061 6e20 636c 6173 733d 226b for con │ │ │ │ -00014830: 6e65 6374 6f72 3c2f 7370 616e 3e3c 7370 nector, field_type │ │ │ │ -00014870: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s in d.items │ │ │ │ -000148e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000148f0: 2829 3a3c 2f73 7061 6e3e 0a20 2020 2020 ():. │ │ │ │ -00014900: 2020 203c 7370 616e 2063 6c61 7373 3d22 for lh │ │ │ │ -00014930: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s, │ │ │ │ -00014950: 203c 7370 616e 2063 6c61 7373 3d22 6e22 rhs, result in fie │ │ │ │ -000149d0: 6c64 5f74 7970 6573 3c2f 7370 616e 3e3c ld_types< │ │ │ │ -000149e0: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ -000149f0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00014a00: 2020 2020 3c73 7061 6e20 636c 6173 733d register_com │ │ │ │ -00014a20: 6269 6e61 626c 655f 6669 656c 6473 3c2f binable_fields(lhs │ │ │ │ -00014a60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00014a80: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00014a90: 636f 6e6e 6563 746f 723c 2f73 7061 6e3e connector │ │ │ │ -00014aa0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00014ab0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , rhs, resu │ │ │ │ -00014b00: 6c74 3c2f 7370 616e 3e3c 7370 616e 2063 lt)...@functools< │ │ │ │ -00014b40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.lr │ │ │ │ -00014b70: 755f 6361 6368 653c 2f73 7061 6e3e 3c73 u_cache(< │ │ │ │ -00014b90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>maxsize=128 │ │ │ │ -00014be0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00014c00: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00014c10: 6465 663c 2f73 7061 6e3e 203c 7370 616e def _res │ │ │ │ -00014c30: 6f6c 7665 5f63 6f6d 6269 6e65 645f 7479 olve_combined_ty │ │ │ │ -00014c40: 7065 3c2f 7370 616e 3e3c 7370 616e 2063 pe(connector, lhs_ty │ │ │ │ -00014cb0: 7065 3c2f 7370 616e 3e3c 7370 616e 2063 pe, rhs_type):. < │ │ │ │ -00014d10: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00014d20: 6f6d 6269 6e61 746f 7273 3c2f 7370 616e ombinators = _conn │ │ │ │ -00014d60: 6563 746f 725f 636f 6d62 696e 6174 6f72 ector_combinator │ │ │ │ -00014d70: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ -00014d90: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00014da0: 6765 743c 2f73 7061 6e3e 3c73 7061 6e20 get(connector, ()). for combinator_ │ │ │ │ -00014e50: 6c68 735f 7479 7065 3c2f 7370 616e 3e3c lhs_type< │ │ │ │ -00014e60: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00014e70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c combinat │ │ │ │ -00014e90: 6f72 5f72 6873 5f74 7970 653c 2f73 7061 or_rhs_type, combi │ │ │ │ -00014ed0: 6e65 645f 7479 7065 3c2f 7370 616e 3e20 ned_type │ │ │ │ -00014ee0: 3c73 7061 6e20 636c 6173 733d 226f 7722 in combi │ │ │ │ -00014f10: 6e61 746f 7273 3c2f 7370 616e 3e3c 7370 nators:. if │ │ │ │ -00014f50: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c issubcl │ │ │ │ -00014f70: 6173 733c 2f73 7061 6e3e 3c73 7061 6e20 ass(lhs_type, combin │ │ │ │ -00014fe0: 6174 6f72 5f6c 6873 5f74 7970 653c 2f73 ator_lhs_type) an │ │ │ │ -00015020: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d issubc │ │ │ │ -00015040: 6c61 7373 3c2f 7370 616e 3e3c 7370 616e lass(. │ │ │ │ -00015070: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00015080: 7268 735f 7479 7065 3c2f 7370 616e 3e3c rhs_type< │ │ │ │ -00015090: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -000150a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c combinat │ │ │ │ -000150c0: 6f72 5f72 6873 5f74 7970 653c 2f73 7061 or_rhs_type. ):. │ │ │ │ -00015100: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -00015120: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00015130: 6f6d 6269 6e65 645f 7479 7065 3c2f 7370 ombined_type...class CombinedExpr │ │ │ │ -00015180: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession(SQLiteNumer │ │ │ │ -000151c0: 6963 4d69 7869 6e3c 2f73 7061 6e3e 3c73 icMixin,< │ │ │ │ -000151e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> Expressio │ │ │ │ -00015200: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n):. def │ │ │ │ -00015240: 203c 7370 616e 2063 6c61 7373 3d22 666d __init__(self, lh │ │ │ │ -000152c0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s, │ │ │ │ -000152e0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 connector, rhs, out │ │ │ │ -00015360: 7075 745f 6669 656c 643c 2f73 7061 6e3e put_field │ │ │ │ -00015370: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00015380: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =None):. │ │ │ │ -000153c0: 2020 2020 2020 3c73 7061 6e20 636c 6173 super().__init__(outp │ │ │ │ -00015460: 7574 5f66 6965 6c64 3c2f 7370 616e 3e3c ut_field< │ │ │ │ -00015470: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00015480: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 output_fi │ │ │ │ -000154a0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld). self │ │ │ │ -000154e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00015500: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00015510: 6f6e 6e65 6374 6f72 3c2f 7370 616e 3e20 onnector │ │ │ │ -00015520: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00015530: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = connect │ │ │ │ -00015550: 6f72 3c2f 7370 616e 3e0a 2020 2020 2020 or. │ │ │ │ -00015560: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ -00015590: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>lhs │ │ │ │ -000155b0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = lhs. se │ │ │ │ -00015600: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.rhs = rhs. │ │ │ │ -00015670: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ -00015690: 3c73 7061 6e20 636c 6173 733d 2266 6d22 __repr__ │ │ │ │ -000156b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000156c0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ -00015700: 2020 2020 2020 3c73 7061 6e20 636c 6173 return "<< │ │ │ │ -00015740: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>{} │ │ │ │ -00015760: 3c73 7061 6e20 636c 6173 733d 2273 3222 : {}>"< │ │ │ │ -000157b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.fo │ │ │ │ -000157e0: 726d 6174 3c2f 7370 616e 3e3c 7370 616e rmat(self< │ │ │ │ -00015820: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00015830: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __class_ │ │ │ │ -00015850: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c _. │ │ │ │ -00015870: 3c73 7061 6e20 636c 6173 733d 2276 6d22 __name__ │ │ │ │ -00015890: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000158a0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , self).. │ │ │ │ -000158e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 def _ │ │ │ │ -00015910: 5f73 7472 5f5f 3c2f 7370 616e 3e3c 7370 _str__(self):. │ │ │ │ -00015970: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ -00015990: 203c 7370 616e 2063 6c61 7373 3d22 7332 "< │ │ │ │ -000159b0: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -000159c0: 7b7d 3c2f 7370 616e 3e3c 7370 616e 2063 {} {} {}< │ │ │ │ -00015a30: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -00015a40: 2671 756f 743b 3c2f 7370 616e 3e3c 7370 ".format(self< │ │ │ │ -00015ab0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.lh │ │ │ │ -00015ae0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s, │ │ │ │ -00015b00: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.connector, s │ │ │ │ -00015b80: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.rhs).. def get_source │ │ │ │ -00015c10: 5f65 7870 7265 7373 696f 6e73 3c2f 7370 _expressions(self │ │ │ │ -00015c50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -00015c70: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -00015c90: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> [< │ │ │ │ -00015cb0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00015cc0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.lhs, self.rhs].. │ │ │ │ -00015d80: 2020 3c73 7061 6e20 636c 6173 733d 226b def se │ │ │ │ -00015db0: 745f 736f 7572 6365 5f65 7870 7265 7373 t_source_express │ │ │ │ -00015dc0: 696f 6e73 3c2f 7370 616e 3e3c 7370 616e ions(self< │ │ │ │ -00015e00: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00015e10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c exprs):. │ │ │ │ -00015e50: 2020 2020 2020 3c73 7061 6e20 636c 6173 self.lhs, se │ │ │ │ -00015ed0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.rhs =
exprs.. def _resolve_outp │ │ │ │ -00015f80: 7574 5f66 6965 6c64 3c2f 7370 616e 3e3c ut_field< │ │ │ │ -00015f90: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00015fa0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self):. │ │ │ │ -00015fe0: 2020 2020 203c 7370 616e 2063 6c61 7373 # We avoid │ │ │ │ -00016000: 2075 7369 6e67 2073 7570 6572 2829 2068 using super() h │ │ │ │ -00016010: 6572 6520 666f 7220 7265 6173 6f6e 7320 ere for reasons │ │ │ │ -00016020: 6769 7665 6e20 696e 3c2f 7370 616e 3e0a given in. │ │ │ │ -00016030: 2020 2020 2020 2020 3c73 7061 6e20 636c # Expre │ │ │ │ -00016050: 7373 696f 6e2e 5f72 6573 6f6c 7665 5f6f ssion._resolve_o │ │ │ │ -00016060: 7574 7075 745f 6669 656c 6428 293c 2f73 utput_field()
. com │ │ │ │ -00016090: 6269 6e65 645f 7479 7065 3c2f 7370 616e bined_type = _reso │ │ │ │ -000160d0: 6c76 655f 636f 6d62 696e 6564 5f74 7970 lve_combined_typ │ │ │ │ -000160e0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -00016100: 0a20 2020 2020 2020 2020 2020 203c 7370 . se │ │ │ │ -00016120: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.connector,. │ │ │ │ -00016180: 2020 2020 2020 3c73 7061 6e20 636c 6173 type(self< │ │ │ │ -000161d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.lh │ │ │ │ -00016200: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ -00016220: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00016230: 5f6f 7574 7075 745f 6669 656c 645f 6f72 _output_field_or │ │ │ │ -00016240: 5f6e 6f6e 653c 2f73 7061 6e3e 3c73 7061 _none),. │ │ │ │ -00016270: 2020 3c73 7061 6e20 636c 6173 733d 226e type(< │ │ │ │ -000162a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.rhs._out │ │ │ │ -00016320: 7075 745f 6669 656c 645f 6f72 5f6e 6f6e put_field_or_non │ │ │ │ -00016330: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e),. ). if combined_ty │ │ │ │ -000163b0: 7065 3c2f 7370 616e 3e20 3c73 7061 6e20 pe is None:. │ │ │ │ -00016410: 2020 2020 2020 3c73 7061 6e20 636c 6173 raise FieldError(. │ │ │ │ -00016470: 2020 2020 2020 2020 2020 2020 203c 7370 f< │ │ │ │ -00016490: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"Can │ │ │ │ -000164b0: 6e6f 7420 696e 6665 7220 7479 7065 206f not infer type o │ │ │ │ -000164c0: 6620 3c2f 7370 616e 3e3c 7370 616e 2063 f {self.< │ │ │ │ -00016510: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>connector< │ │ │ │ -00016530: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>!r} expression in │ │ │ │ -00016570: 766f 6c76 696e 6720 7468 6573 6520 2671 volving these &q │ │ │ │ -00016580: 756f 743b 3c2f 7370 616e 3e0a 2020 2020 uot;. │ │ │ │ -00016590: 2020 2020 2020 2020 2020 2020 3c73 7061 f"type │ │ │ │ -000165d0: 733a 203c 2f73 7061 6e3e 3c73 7061 6e20 s: {self< │ │ │ │ -00016610: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00016620: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 lhs.output_ │ │ │ │ -00016670: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field.__class__):. │ │ │ │ +000103a0: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ +000103c0: 203c 7370 616e 2063 6c61 7373 3d22 6e62 hash(self.identit │ │ │ │ +00010440: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y) │ │ │ │ +00010460: 3c2f 6469 763e 0a0a 0a0a 3c73 7061 6e20
....# Typ │ │ │ │ +00010480: 6520 696e 6665 7265 6e63 6520 666f 7220 e inference for │ │ │ │ +00010490: 436f 6d62 696e 6564 4578 7072 6573 7369 CombinedExpressi │ │ │ │ +000104a0: 6f6e 2e6f 7574 7075 745f 6669 656c 642e on.output_field. │ │ │ │ +000104b0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c .# Missi │ │ │ │ +000104d0: 6e67 2069 7465 6d73 2077 696c 6c20 7265 ng items will re │ │ │ │ +000104e0: 7375 6c74 2069 6e20 4669 656c 6445 7272 sult in FieldErr │ │ │ │ +000104f0: 6f72 2c20 6279 2064 6573 6967 6e2e 3c2f or, by design..#. │ │ │ │ +00010520: 3c73 7061 6e20 636c 6173 733d 2263 3122 # The current a │ │ │ │ +00010540: 7070 726f 6163 6820 666f 7220 4e55 4c4c pproach for NULL │ │ │ │ +00010550: 2069 7320 6261 7365 6420 6f6e 206c 6f77 is based on low │ │ │ │ +00010560: 6573 7420 636f 6d6d 6f6e 2064 656e 6f6d est common denom │ │ │ │ +00010570: 696e 6174 6f72 2062 6568 6176 696f 723c inator behavior< │ │ │ │ +00010580: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61 /span>.# i.e. i │ │ │ │ +000105a0: 6620 6f6e 6520 6f66 2074 6865 2073 7570 f one of the sup │ │ │ │ +000105b0: 706f 7274 6564 2064 6174 6162 6173 6573 ported databases │ │ │ │ +000105c0: 2069 7320 7261 6973 696e 6720 616e 2065 is raising an e │ │ │ │ +000105d0: 7272 6f72 2028 7261 7468 6572 2074 6861 rror (rather tha │ │ │ │ +000105e0: 6e3c 2f73 7061 6e3e 0a3c 7370 616e 2063 n.# retu │ │ │ │ +00010600: 726e 204e 554c 4c29 2066 6f72 2060 7661 rn NULL) for `va │ │ │ │ +00010610: 6c20 266c 743b 6f70 2667 743b 204e 554c l <op> NUL │ │ │ │ +00010620: 4c60 2c20 7468 656e 2044 6a61 6e67 6f20 L`, then Django │ │ │ │ +00010630: 7261 6973 6573 2046 6965 6c64 4572 726f raises FieldErro │ │ │ │ +00010640: 722e 3c2f 7370 616e 3e0a 3c73 7061 6e20 r..NoneTy │ │ │ │ +00010660: 7065 3c2f 7370 616e 3e20 3c73 7061 6e20 pe = type< │ │ │ │ +000106a0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +000106b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 None).._co │ │ │ │ +00010700: 6e6e 6563 746f 725f 636f 6d62 696e 6174 nnector_combinat │ │ │ │ +00010710: 696f 6e73 3c2f 7370 616e 3e20 3c73 7061 ions = [. │ │ │ │ +00010750: 2020 3c73 7061 6e20 636c 6173 733d 2263 # Numeric ope │ │ │ │ +00010770: 7261 7469 6f6e 7320 2d20 6f70 6572 616e rations - operan │ │ │ │ +00010780: 6473 206f 6620 7361 6d65 2074 7970 652e ds of same type. │ │ │ │ +00010790: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . {. con │ │ │ │ +000107d0: 6e65 6374 6f72 3c2f 7370 616e 3e3c 7370 nector: [. │ │ │ │ +00010810: 2020 2020 2020 2020 2020 203c 7370 616e (fields │ │ │ │ +00010850: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00010860: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .IntegerF │ │ │ │ +00010880: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield, fields.Integer │ │ │ │ +000108f0: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field, fields.Intege │ │ │ │ +00010960: 7246 6965 6c64 3c2f 7370 616e 3e3c 7370 rField),< │ │ │ │ +00010980: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00010990: 2020 203c 7370 616e 2063 6c61 7373 3d22 (field │ │ │ │ +000109c0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +000109e0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000109f0: 466c 6f61 7446 6965 6c64 3c2f 7370 616e FloatField, fields │ │ │ │ +00010a30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00010a50: 7370 616e 2063 6c61 7373 3d22 6e22 3e46 span class="n">F │ │ │ │ +00010a60: 6c6f 6174 4669 656c 643c 2f73 7061 6e3e loatField │ │ │ │ +00010a70: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00010a80: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , fields< │ │ │ │ +00010aa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Fl │ │ │ │ +00010ad0: 6f61 7446 6965 6c64 3c2f 7370 616e 3e3c oatField< │ │ │ │ +00010ae0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00010af0: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ +00010b00: 2020 2020 203c 7370 616e 2063 6c61 7373 (fie │ │ │ │ +00010b30: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DecimalField, fi │ │ │ │ +00010ba0: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.DecimalField< │ │ │ │ +00010be0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00010c00: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +00010c10: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.DecimalField │ │ │ │ +00010c50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ), │ │ │ │ +00010c70: 0a20 2020 2020 2020 203c 7370 616e 2063 . ]. for connector in │ │ │ │ +00010cf0: 203c 7370 616e 2063 6c61 7373 3d22 7022 (. │ │ │ │ +00010d10: 2020 2020 2020 3c73 7061 6e20 636c 6173 Combinable │ │ │ │ +00010d30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00010d50: 7370 616e 2063 6c61 7373 3d22 6e22 3e41 span class="n">A │ │ │ │ +00010d60: 4444 3c2f 7370 616e 3e3c 7370 616e 2063 DD,. Co │ │ │ │ +00010da0: 6d62 696e 6162 6c65 3c2f 7370 616e 3e3c mbinable< │ │ │ │ +00010db0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00010dc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 SUB,. │ │ │ │ +00010e00: 2020 2020 2020 3c73 7061 6e20 636c 6173 Combinable │ │ │ │ +00010e20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00010e40: 7370 616e 2063 6c61 7373 3d22 6e22 3e4d span class="n">M │ │ │ │ +00010e50: 554c 3c2f 7370 616e 3e3c 7370 616e 2063 UL,. # │ │ │ │ +00010e90: 2042 6568 6176 696f 7220 666f 7220 4449 Behavior for DI │ │ │ │ +00010ea0: 5620 7769 7468 2069 6e74 6567 6572 2061 V with integer a │ │ │ │ +00010eb0: 7267 756d 656e 7473 2066 6f6c 6c6f 7773 rguments follows │ │ │ │ +00010ec0: 2050 6f73 7467 7265 732f 5351 4c69 7465 Postgres/SQLite │ │ │ │ +00010ed0: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ +00010ee0: 2020 2020 203c 7370 616e 2063 6c61 7373 # not MySQ │ │ │ │ +00010f00: 4c2f 4f72 6163 6c65 2e3c 2f73 7061 6e3e L/Oracle. │ │ │ │ +00010f10: 0a20 2020 2020 2020 2020 2020 203c 7370 . Com │ │ │ │ +00010f30: 6269 6e61 626c 653c 2f73 7061 6e3e 3c73 binable.< │ │ │ │ +00010f50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DIV │ │ │ │ +00010f70: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00010f80: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ +00010f90: 2020 2020 203c 7370 616e 2063 6c61 7373 Combinable< │ │ │ │ +00010fb0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.MO │ │ │ │ +00010fe0: 443c 2f73 7061 6e3e 3c73 7061 6e20 636c D, │ │ │ │ +00011000: 0a20 2020 2020 2020 2020 2020 203c 7370 . Com │ │ │ │ +00011020: 6269 6e61 626c 653c 2f73 7061 6e3e 3c73 binable.< │ │ │ │ +00011040: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>POW │ │ │ │ +00011060: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00011070: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ +00011080: 203c 7370 616e 2063 6c61 7373 3d22 7022 ). }, │ │ │ │ +000110b0: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . # N │ │ │ │ +000110d0: 756d 6572 6963 206f 7065 7261 7469 6f6e umeric operation │ │ │ │ +000110e0: 7320 2d20 6f70 6572 616e 6473 206f 6620 s - operands of │ │ │ │ +000110f0: 6469 6666 6572 656e 7420 7479 7065 2e3c different type.< │ │ │ │ +00011100: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. {. conn │ │ │ │ +00011140: 6563 746f 723c 2f73 7061 6e3e 3c73 7061 ector: [. │ │ │ │ +00011180: 2020 2020 2020 2020 2020 3c73 7061 6e20 (fields< │ │ │ │ +000111c0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +000111d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 IntegerFi │ │ │ │ +000111f0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld, fields │ │ │ │ +00011230: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00011240: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .DecimalF │ │ │ │ +00011260: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield, fields.Decimal │ │ │ │ +000112d0: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field),. │ │ │ │ +00011300: 2020 3c73 7061 6e20 636c 6173 733d 2270 (fields │ │ │ │ +00011330: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00011350: 7370 616e 2063 6c61 7373 3d22 6e22 3e44 span class="n">D │ │ │ │ +00011360: 6563 696d 616c 4669 656c 643c 2f73 7061 ecimalField, field │ │ │ │ +000113a0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +000113c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000113d0: 496e 7465 6765 7246 6965 6c64 3c2f 7370 IntegerField, fiel │ │ │ │ +00011410: 6473 3c2f 7370 616e 3e3c 7370 616e 2063 ds.DecimalField),. │ │ │ │ +00011470: 2020 2020 2020 2020 2020 3c73 7061 6e20 (fields< │ │ │ │ +000114b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +000114c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 IntegerFi │ │ │ │ +000114e0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld, fields │ │ │ │ +00011520: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00011530: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .FloatFie │ │ │ │ +00011550: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld, fields< │ │ │ │ +00011590: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +000115a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 FloatFiel │ │ │ │ +000115c0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d),. (< │ │ │ │ +00011600: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>fields.Float │ │ │ │ +00011650: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field, fields.Intege │ │ │ │ +000116c0: 7246 6965 6c64 3c2f 7370 616e 3e3c 7370 rField, fields.Float │ │ │ │ +00011730: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field),. ]< │ │ │ │ +00011770: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00011780: 7370 616e 2063 6c61 7373 3d22 6b22 3e66 span class="k">f │ │ │ │ +00011790: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or connec │ │ │ │ +000117b0: 746f 723c 2f73 7061 6e3e 203c 7370 616e tor in (. │ │ │ │ +000117f0: 2020 2020 2020 2020 2020 203c 7370 616e Combi │ │ │ │ +00011810: 6e61 626c 653c 2f73 7061 6e3e 3c73 7061 nable.ADD,< │ │ │ │ +00011860: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00011870: 2020 203c 7370 616e 2063 6c61 7373 3d22 Combinable.SUB< │ │ │ │ +000118c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ +000118e0: 2020 2020 2020 2020 2020 203c 7370 616e Combi │ │ │ │ +00011900: 6e61 626c 653c 2f73 7061 6e3e 3c73 7061 nable.MUL,< │ │ │ │ +00011950: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00011960: 2020 203c 7370 616e 2063 6c61 7373 3d22 Combinable.DIV< │ │ │ │ +000119b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ +000119d0: 2020 2020 2020 2020 2020 203c 7370 616e Combi │ │ │ │ +000119f0: 6e61 626c 653c 2f73 7061 6e3e 3c73 7061 nable.MOD,< │ │ │ │ +00011a40: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00011a50: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00011a60: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . },. # Bit │ │ │ │ +00011aa0: 7769 7365 206f 7065 7261 746f 7273 2e3c wise operators.< │ │ │ │ +00011ab0: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. {. conn │ │ │ │ +00011af0: 6563 746f 723c 2f73 7061 6e3e 3c73 7061 ector: [. │ │ │ │ +00011b30: 2020 2020 2020 2020 2020 3c73 7061 6e20 (fields< │ │ │ │ +00011b70: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00011b80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 IntegerFi │ │ │ │ +00011ba0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld, fields │ │ │ │ +00011be0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00011bf0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .IntegerF │ │ │ │ +00011c10: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield, fields.Integer │ │ │ │ +00011c80: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field),. ]< │ │ │ │ +00011cc0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00011cd0: 7370 616e 2063 6c61 7373 3d22 6b22 3e66 span class="k">f │ │ │ │ +00011ce0: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or connec │ │ │ │ +00011d00: 746f 723c 2f73 7061 6e3e 203c 7370 616e tor in (. │ │ │ │ +00011d40: 2020 2020 2020 2020 2020 203c 7370 616e Combi │ │ │ │ +00011d60: 6e61 626c 653c 2f73 7061 6e3e 3c73 7061 nable.BITAND,. │ │ │ │ +00011dc0: 2020 2020 2020 3c73 7061 6e20 636c 6173 Combinable │ │ │ │ +00011de0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00011e00: 7370 616e 2063 6c61 7373 3d22 6e22 3e42 span class="n">B │ │ │ │ +00011e10: 4954 4f52 3c2f 7370 616e 3e3c 7370 616e ITOR,. │ │ │ │ +00011e40: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00011e50: 436f 6d62 696e 6162 6c65 3c2f 7370 616e Combinable.BITLEFT │ │ │ │ +00011e90: 5348 4946 543c 2f73 7061 6e3e 3c73 7061 SHIFT,. │ │ │ │ +00011ec0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 Combinable.BITRIG │ │ │ │ +00011f10: 4854 5348 4946 543c 2f73 7061 6e3e 3c73 HTSHIFT,< │ │ │ │ +00011f30: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00011f40: 2020 203c 7370 616e 2063 6c61 7373 3d22 Combinable.BITX │ │ │ │ +00011f90: 4f52 3c2f 7370 616e 3e3c 7370 616e 2063 OR,. ). }, │ │ │ │ +00011ff0: 0a20 2020 203c 7370 616e 2063 6c61 7373 . # Numeric │ │ │ │ +00012010: 7769 7468 204e 554c 4c2e 3c2f 7370 616e with NULL.. {. │ │ │ │ +00012040: 2020 2020 2020 203c 7370 616e 2063 6c61 connector │ │ │ │ +00012060: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 : │ │ │ │ +00012080: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00012090: 5b3c 2f73 7061 6e3e 0a20 2020 2020 2020 [. │ │ │ │ +000120a0: 2020 2020 203c 7370 616e 2063 6c61 7373 (fie │ │ │ │ +000120d0: 6c64 5f74 7970 653c 2f73 7061 6e3e 3c73 ld_type,< │ │ │ │ +000120f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> NoneType< │ │ │ │ +00012110: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00012130: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +00012140: 6965 6c64 5f74 7970 653c 2f73 7061 6e3e ield_type │ │ │ │ +00012150: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00012160: 292c 3c2f 7370 616e 3e0a 2020 2020 2020 ),. │ │ │ │ +00012170: 2020 2020 2020 3c73 7061 6e20 636c 6173 (No │ │ │ │ +000121a0: 6e65 5479 7065 3c2f 7370 616e 3e3c 7370 neType, field_type │ │ │ │ +000121e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00012200: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00012210: 6669 656c 645f 7479 7065 3c2f 7370 616e field_type),. │ │ │ │ +00012240: 2020 203c 7370 616e 2063 6c61 7373 3d22 ]. │ │ │ │ +00012260: 2020 2020 3c73 7061 6e20 636c 6173 733d for < │ │ │ │ +00012280: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00012290: 6f6e 6e65 6374 6f72 3c2f 7370 616e 3e20 onnector │ │ │ │ +000122a0: 3c73 7061 6e20 636c 6173 733d 226f 7722 in (. │ │ │ │ +000122e0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000122f0: 436f 6d62 696e 6162 6c65 3c2f 7370 616e Combinable.ADD,. │ │ │ │ +00012350: 2020 2020 2020 2020 3c73 7061 6e20 636c Combinab │ │ │ │ +00012370: 6c65 3c2f 7370 616e 3e3c 7370 616e 2063 le.SUB,. │ │ │ │ +000123d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000123e0: 436f 6d62 696e 6162 6c65 3c2f 7370 616e Combinable.MUL,. │ │ │ │ +00012440: 2020 2020 2020 2020 3c73 7061 6e20 636c Combinab │ │ │ │ +00012460: 6c65 3c2f 7370 616e 3e3c 7370 616e 2063 le.DIV,. │ │ │ │ +000124c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000124d0: 436f 6d62 696e 6162 6c65 3c2f 7370 616e Combinable.MOD,. │ │ │ │ +00012530: 2020 2020 2020 2020 3c73 7061 6e20 636c Combinab │ │ │ │ +00012550: 6c65 3c2f 7370 616e 3e3c 7370 616e 2063 le.POW,. ). for │ │ │ │ +000125e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c field_ty │ │ │ │ +00012600: 7065 3c2f 7370 616e 3e20 3c73 7061 6e20 pe in (fie │ │ │ │ +00012650: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.IntegerField, fi │ │ │ │ +000126c0: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.DecimalField< │ │ │ │ +00012700: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00012720: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +00012730: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.FloatField). │ │ │ │ +00012790: 2020 3c73 7061 6e20 636c 6173 733d 2270 },. │ │ │ │ +000127b0: 3c73 7061 6e20 636c 6173 733d 2263 3122 # Date/DateTime │ │ │ │ +000127d0: 4669 656c 642f 4475 7261 7469 6f6e 4669 Field/DurationFi │ │ │ │ +000127e0: 656c 642f 5469 6d65 4669 656c 642e 3c2f eld/TimeField.. {. Combi │ │ │ │ +00012830: 6e61 626c 653c 2f73 7061 6e3e 3c73 7061 nable.ADD:< │ │ │ │ +00012880: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> [. │ │ │ │ +000128a0: 2020 2020 2020 2020 2020 2020 3c73 7061 # D │ │ │ │ +000128c0: 6174 652f 4461 7465 5469 6d65 4669 656c ate/DateTimeFiel │ │ │ │ +000128d0: 642e 3c2f 7370 616e 3e0a 2020 2020 2020 d.. │ │ │ │ +000128e0: 2020 2020 2020 3c73 7061 6e20 636c 6173 (fi │ │ │ │ +00012910: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.DateField, fiel │ │ │ │ +00012980: 6473 3c2f 7370 616e 3e3c 7370 616e 2063 ds.DurationField, fi │ │ │ │ +000129f0: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.DateTimeField │ │ │ │ +00012a30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ), │ │ │ │ +00012a50: 0a20 2020 2020 2020 2020 2020 203c 7370 . (fields.DateTi │ │ │ │ +00012ac0: 6d65 4669 656c 643c 2f73 7061 6e3e 3c73 meField,< │ │ │ │ +00012ae0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> fields.Dura │ │ │ │ +00012b30: 7469 6f6e 4669 656c 643c 2f73 7061 6e3e tionField │ │ │ │ +00012b40: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00012b50: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , fields< │ │ │ │ +00012b70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Da │ │ │ │ +00012ba0: 7465 5469 6d65 4669 656c 643c 2f73 7061 teTimeField),. │ │ │ │ +00012bd0: 2020 2020 2020 2020 3c73 7061 6e20 636c ( │ │ │ │ +00012bf0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00012c00: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.DurationFie │ │ │ │ +00012c40: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld, fields< │ │ │ │ +00012c80: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00012c90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DateField │ │ │ │ +00012cb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00012cd0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00012ce0: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.DateTimeFie │ │ │ │ +00012d20: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld),. < │ │ │ │ +00012d50: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00012d60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 fields.Dura │ │ │ │ +00012db0: 7469 6f6e 4669 656c 643c 2f73 7061 6e3e tionField │ │ │ │ +00012dc0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00012dd0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , fields< │ │ │ │ +00012df0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Da │ │ │ │ +00012e20: 7465 5469 6d65 4669 656c 643c 2f73 7061 teTimeField, field │ │ │ │ +00012e60: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00012e80: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00012e90: 4461 7465 5469 6d65 4669 656c 643c 2f73 DateTimeField),. │ │ │ │ +00012ec0: 2020 2020 2020 2020 2020 3c73 7061 6e20 # Dur │ │ │ │ +00012ee0: 6174 696f 6e46 6965 6c64 2e3c 2f73 7061 ationField.. < │ │ │ │ +00012f00: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00012f10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 fields.Dura │ │ │ │ +00012f60: 7469 6f6e 4669 656c 643c 2f73 7061 6e3e tionField │ │ │ │ +00012f70: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00012f80: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , fields< │ │ │ │ +00012fa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Du │ │ │ │ +00012fd0: 7261 7469 6f6e 4669 656c 643c 2f73 7061 rationField, field │ │ │ │ +00013010: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00013030: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00013040: 4475 7261 7469 6f6e 4669 656c 643c 2f73 DurationField),. │ │ │ │ +00013070: 2020 2020 2020 2020 2020 3c73 7061 6e20 # Tim │ │ │ │ +00013090: 6546 6965 6c64 2e3c 2f73 7061 6e3e 0a20 eField.. │ │ │ │ +000130a0: 2020 2020 2020 2020 2020 203c 7370 616e (fields │ │ │ │ +000130e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000130f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .TimeFiel │ │ │ │ +00013110: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d, │ │ │ │ +00013130: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ +00013160: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DurationFi │ │ │ │ +00013180: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld, fields │ │ │ │ +000131c0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000131d0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .TimeFiel │ │ │ │ +000131f0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d),. (< │ │ │ │ +00013230: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>fields.Durat │ │ │ │ +00013280: 696f 6e46 6965 6c64 3c2f 7370 616e 3e3c ionField< │ │ │ │ +00013290: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +000132a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Tim │ │ │ │ +000132f0: 6546 6965 6c64 3c2f 7370 616e 3e3c 7370 eField, fields.TimeF │ │ │ │ +00013360: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield),. ],< │ │ │ │ +000133a0: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. },. {. Combin │ │ │ │ +00013400: 6162 6c65 3c2f 7370 616e 3e3c 7370 616e able.SUB: [. │ │ │ │ +00013470: 2020 2020 2020 2020 2020 203c 7370 616e # Da │ │ │ │ +00013490: 7465 2f44 6174 6554 696d 6546 6965 6c64 te/DateTimeField │ │ │ │ +000134a0: 2e3c 2f73 7061 6e3e 0a20 2020 2020 2020 .. │ │ │ │ +000134b0: 2020 2020 203c 7370 616e 2063 6c61 7373 (fie │ │ │ │ +000134e0: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DateField, field │ │ │ │ +00013550: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00013570: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00013580: 4475 7261 7469 6f6e 4669 656c 643c 2f73 DurationField, fie │ │ │ │ +000135c0: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DateTimeField< │ │ │ │ +00013600: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>),. │ │ │ │ +00013620: 2020 2020 2020 2020 2020 2020 3c73 7061 (fields.DateTim │ │ │ │ +00013690: 6546 6965 6c64 3c2f 7370 616e 3e3c 7370 eField, fields.Durat │ │ │ │ +00013700: 696f 6e46 6965 6c64 3c2f 7370 616e 3e3c ionField< │ │ │ │ +00013710: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00013720: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Dat │ │ │ │ +00013770: 6554 696d 6546 6965 6c64 3c2f 7370 616e eTimeField),. │ │ │ │ +000137a0: 2020 2020 2020 203c 7370 616e 2063 6c61 (< │ │ │ │ +000137c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +000137d0: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.DateField, fie │ │ │ │ +00013840: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.DateField, field │ │ │ │ +000138b0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +000138d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000138e0: 4475 7261 7469 6f6e 4669 656c 643c 2f73 DurationField),. │ │ │ │ +00013910: 2020 2020 2020 2020 2020 3c73 7061 6e20 (fields< │ │ │ │ +00013950: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00013960: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DateField │ │ │ │ +00013980: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +000139a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000139b0: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.DateTimeFie │ │ │ │ +000139f0: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld, fields< │ │ │ │ +00013a30: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00013a40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DurationF │ │ │ │ +00013a60: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield),. │ │ │ │ +00013a90: 203c 7370 616e 2063 6c61 7373 3d22 7022 (fields< │ │ │ │ +00013ac0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Da │ │ │ │ +00013af0: 7465 5469 6d65 4669 656c 643c 2f73 7061 teTimeField, field │ │ │ │ +00013b30: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00013b50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00013b60: 4461 7465 4669 656c 643c 2f73 7061 6e3e DateField │ │ │ │ +00013b70: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00013b80: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , fields< │ │ │ │ +00013ba0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Du │ │ │ │ +00013bd0: 7261 7469 6f6e 4669 656c 643c 2f73 7061 rationField),. │ │ │ │ +00013c00: 2020 2020 2020 2020 3c73 7061 6e20 636c ( │ │ │ │ +00013c20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00013c30: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.DateTimeFie │ │ │ │ +00013c70: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld, fields< │ │ │ │ +00013cb0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00013cc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DateTimeF │ │ │ │ +00013ce0: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield, fields.Duratio │ │ │ │ +00013d50: 6e46 6965 6c64 3c2f 7370 616e 3e3c 7370 nField),< │ │ │ │ +00013d70: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00013d80: 2020 203c 7370 616e 2063 6c61 7373 3d22 # DurationFi │ │ │ │ +00013da0: 656c 642e 3c2f 7370 616e 3e0a 2020 2020 eld.. │ │ │ │ +00013db0: 2020 2020 2020 2020 3c73 7061 6e20 636c ( │ │ │ │ +00013dd0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00013de0: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields.DurationFie │ │ │ │ +00013e20: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld, fields< │ │ │ │ +00013e60: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00013e70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DurationF │ │ │ │ +00013e90: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield, fields.Duratio │ │ │ │ +00013f00: 6e46 6965 6c64 3c2f 7370 616e 3e3c 7370 nField),< │ │ │ │ +00013f20: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00013f30: 2020 203c 7370 616e 2063 6c61 7373 3d22 # TimeField. │ │ │ │ +00013f50: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00013f60: 2020 2020 3c73 7061 6e20 636c 6173 733d (fiel │ │ │ │ +00013f90: 6473 3c2f 7370 616e 3e3c 7370 616e 2063 ds.TimeField, fields │ │ │ │ +00014000: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00014020: 7370 616e 2063 6c61 7373 3d22 6e22 3e44 span class="n">D │ │ │ │ +00014030: 7572 6174 696f 6e46 6965 6c64 3c2f 7370 urationField, fiel │ │ │ │ +00014070: 6473 3c2f 7370 616e 3e3c 7370 616e 2063 ds.TimeField),. │ │ │ │ +000140d0: 2020 2020 2020 203c 7370 616e 2063 6c61 (< │ │ │ │ +000140f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +00014100: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields.TimeField, fie │ │ │ │ +00014170: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.TimeField, field │ │ │ │ +000141e0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00014200: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00014210: 4475 7261 7469 6f6e 4669 656c 643c 2f73 DurationField),. │ │ │ │ +00014240: 2020 2020 2020 3c73 7061 6e20 636c 6173 ],. │ │ │ │ +00014260: 2020 2020 3c73 7061 6e20 636c 6173 733d },.]< │ │ │ │ +00014290: 2f73 7061 6e3e 0a0a 3c73 7061 6e20 636c /span>.._connect │ │ │ │ +000142b0: 6f72 5f63 6f6d 6269 6e61 746f 7273 3c2f or_combinators = < │ │ │ │ +000142e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ +000142f0: 6566 6175 6c74 6469 6374 3c2f 7370 616e efaultdict(list)... │ │ │ │ +00014350: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00014360: 6465 663c 2f73 7061 6e3e 203c 7370 616e def regi │ │ │ │ +00014380: 7374 6572 5f63 6f6d 6269 6e61 626c 655f ster_combinable_ │ │ │ │ +00014390: 6669 656c 6473 3c2f 7370 616e 3e3c 7370 fields(lhs< │ │ │ │ +000143d0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +000143e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecto │ │ │ │ +00014400: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r, │ │ │ │ +00014420: 203c 7370 616e 2063 6c61 7373 3d22 6e22 rhs, result):. < │ │ │ │ +000144a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"&qu │ │ │ │ +000144c0: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e ot;" │ │ │ │ +000144d0: 0a3c 7370 616e 2063 6c61 7373 3d22 7364 . Register c │ │ │ │ +000144f0: 6f6d 6269 6e61 626c 6520 7479 7065 733a ombinable types: │ │ │ │ +00014500: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c . │ │ │ │ +00014520: 206c 6873 2026 6c74 3b63 6f6e 6e65 6374 lhs <connect │ │ │ │ +00014530: 6f72 2667 743b 2072 6873 202d 2667 743b or> rhs -> │ │ │ │ +00014540: 2072 6573 756c 743c 2f73 7061 6e3e 0a3c result.< │ │ │ │ +00014550: 7370 616e 2063 6c61 7373 3d22 7364 223e span class="sd"> │ │ │ │ +00014560: 2020 2020 652e 672e 3c2f 7370 616e 3e0a e.g.. │ │ │ │ +00014570: 3c73 7061 6e20 636c 6173 733d 2273 6422 registe │ │ │ │ +00014590: 725f 636f 6d62 696e 6162 6c65 5f66 6965 r_combinable_fie │ │ │ │ +000145a0: 6c64 7328 3c2f 7370 616e 3e0a 3c73 7061 lds(. │ │ │ │ +000145c0: 2020 2020 2020 2020 2049 6e74 6567 6572 Integer │ │ │ │ +000145d0: 4669 656c 642c 2043 6f6d 6269 6e61 626c Field, Combinabl │ │ │ │ +000145e0: 652e 4144 442c 2046 6c6f 6174 4669 656c e.ADD, FloatFiel │ │ │ │ +000145f0: 642c 2046 6c6f 6174 4669 656c 643c 2f73 d, FloatField. )< │ │ │ │ +00014620: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61 /span>. &quo │ │ │ │ +00014640: 743b 2671 756f 743b 2671 756f 743b 3c2f t;"". _conne │ │ │ │ +00014670: 6374 6f72 5f63 6f6d 6269 6e61 746f 7273 ctor_combinators │ │ │ │ +00014680: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 [< │ │ │ │ +000146a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +000146b0: 6f6e 6e65 6374 6f72 3c2f 7370 616e 3e3c onnector< │ │ │ │ +000146c0: 7370 616e 2063 6c61 7373 3d22 7022 3e5d span class="p">] │ │ │ │ +000146d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000146f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +00014700: 7070 656e 643c 2f73 7061 6e3e 3c73 7061 ppend((lhs< │ │ │ │ +00014740: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00014750: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c rhs, resul │ │ │ │ +000147a0: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t))...for < │ │ │ │ +000147e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ +000147f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c in _connector_co │ │ │ │ +00014830: 6d62 696e 6174 696f 6e73 3c2f 7370 616e mbinations:. fo │ │ │ │ +00014870: 723c 2f73 7061 6e3e 203c 7370 616e 2063 r connect │ │ │ │ +00014890: 6f72 3c2f 7370 616e 3e3c 7370 616e 2063 or, field_types in │ │ │ │ +000148f0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00014900: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d. │ │ │ │ +00014920: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00014930: 6974 656d 733c 2f73 7061 6e3e 3c73 7061 items():< │ │ │ │ +00014950: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00014960: 7370 616e 2063 6c61 7373 3d22 6b22 3e66 span class="k">f │ │ │ │ +00014970: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or lhs, rhs │ │ │ │ +000149c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +000149e0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000149f0: 7265 7375 6c74 3c2f 7370 616e 3e20 3c73 result i │ │ │ │ +00014a10: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n field_t │ │ │ │ +00014a30: 7970 6573 3c2f 7370 616e 3e3c 7370 616e ypes:. │ │ │ │ +00014a60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00014a70: 7265 6769 7374 6572 5f63 6f6d 6269 6e61 register_combina │ │ │ │ +00014a80: 626c 655f 6669 656c 6473 3c2f 7370 616e ble_fields(lhs, conn │ │ │ │ +00014af0: 6563 746f 723c 2f73 7061 6e3e 3c73 7061 ector, rhs< │ │ │ │ +00014b30: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00014b40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c result)... │ │ │ │ +00014b80: 3c73 7061 6e20 636c 6173 733d 226e 6422 @functools.lru_ca │ │ │ │ +00014bd0: 6368 653c 2f73 7061 6e3e 3c73 7061 6e20 che(maxsize │ │ │ │ +00014c10: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00014c20: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =128).def< │ │ │ │ +00014c70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> _resolve │ │ │ │ +00014c90: 5f63 6f6d 6269 6e65 645f 7479 7065 3c2f _combined_type(con │ │ │ │ +00014cd0: 6e65 6374 6f72 3c2f 7370 616e 3e3c 7370 nector, lhs_type, rh │ │ │ │ +00014d40: 735f 7479 7065 3c2f 7370 616e 3e3c 7370 s_type):< │ │ │ │ +00014d60: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. combi │ │ │ │ +00014d80: 6e61 746f 7273 3c2f 7370 616e 3e20 3c73 nators =< │ │ │ │ +00014da0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> _connecto │ │ │ │ +00014dc0: 725f 636f 6d62 696e 6174 6f72 733c 2f73 r_combinators.get< │ │ │ │ +00014e00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(co │ │ │ │ +00014e30: 6e6e 6563 746f 723c 2f73 7061 6e3e 3c73 nnector,< │ │ │ │ +00014e50: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ()). for │ │ │ │ +00014e90: 203c 7370 616e 2063 6c61 7373 3d22 6e22 combinator_lhs_ │ │ │ │ +00014eb0: 7479 7065 3c2f 7370 616e 3e3c 7370 616e type, combinator_r │ │ │ │ +00014ef0: 6873 5f74 7970 653c 2f73 7061 6e3e 3c73 hs_type,< │ │ │ │ +00014f10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> combined_ │ │ │ │ +00014f30: 7479 7065 3c2f 7370 616e 3e20 3c73 7061 type in< │ │ │ │ +00014f50: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> combinato │ │ │ │ +00014f70: 7273 3c2f 7370 616e 3e3c 7370 616e 2063 rs:. if issubclass< │ │ │ │ +00014fd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(lh │ │ │ │ +00015000: 735f 7479 7065 3c2f 7370 616e 3e3c 7370 s_type, combinator │ │ │ │ +00015040: 5f6c 6873 5f74 7970 653c 2f73 7061 6e3e _lhs_type │ │ │ │ +00015050: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00015060: 293c 2f73 7061 6e3e 203c 7370 616e 2063 ) and issubclass │ │ │ │ +000150a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (. │ │ │ │ +000150c0: 2020 2020 2020 2020 2020 2020 3c73 7061 rhs_ │ │ │ │ +000150e0: 7479 7065 3c2f 7370 616e 3e3c 7370 616e type, combinator_r │ │ │ │ +00015120: 6873 5f74 7970 653c 2f73 7061 6e3e 0a20 hs_type. │ │ │ │ +00015130: 2020 2020 2020 203c 7370 616e 2063 6c61 ): │ │ │ │ +00015150: 0a20 2020 2020 2020 2020 2020 203c 7370 . ret │ │ │ │ +00015170: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn combi │ │ │ │ +00015190: 6e65 645f 7479 7065 3c2f 7370 616e 3e0a ned_type. │ │ │ │ +000151a0: 0a0a 3c73 7061 6e20 636c 6173 733d 226b ..class < │ │ │ │ +000151c0: 7370 616e 2063 6c61 7373 3d22 6e63 223e span class="nc"> │ │ │ │ +000151d0: 436f 6d62 696e 6564 4578 7072 6573 7369 CombinedExpressi │ │ │ │ +000151e0: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(SQLiteNumericMi │ │ │ │ +00015220: 7869 6e3c 2f73 7061 6e3e 3c73 7061 6e20 xin, Expression):. │ │ │ │ +00015280: 2020 3c73 7061 6e20 636c 6173 733d 226b def __ │ │ │ │ +000152b0: 696e 6974 5f5f 3c2f 7370 616e 3e3c 7370 init__(self, lhs, con │ │ │ │ +00015350: 6e65 6374 6f72 3c2f 7370 616e 3e3c 7370 nector, rhs │ │ │ │ +00015390: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000153a0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , output_ │ │ │ │ +000153c0: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field=None │ │ │ │ +00015400: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00015410: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +00015420: 2020 3c73 7061 6e20 636c 6173 733d 226e super< │ │ │ │ +00015440: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00015450: 293c 2f73 7061 6e3e 3c73 7061 6e20 636c ). │ │ │ │ +00015470: 3c73 7061 6e20 636c 6173 733d 2266 6d22 __init__ │ │ │ │ +00015490: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000154a0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (output_f │ │ │ │ +000154c0: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield=output_field< │ │ │ │ +00015500: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ +00015520: 2020 2020 2020 203c 7370 616e 2063 6c61 self.conne │ │ │ │ +00015570: 6374 6f72 3c2f 7370 616e 3e20 3c73 7061 ctor = connector. s │ │ │ │ +000155d0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.lhs = lhs │ │ │ │ +00015640: 0a20 2020 2020 2020 203c 7370 616e 2063 . self.rhs │ │ │ │ +00015690: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +000156b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 rhs.. │ │ │ │ +000156d0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def __r │ │ │ │ +00015700: 6570 725f 5f3c 2f73 7061 6e3e 3c73 7061 epr__(self │ │ │ │ +00015740: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00015750: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +00015760: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ +00015780: 3c73 7061 6e20 636c 6173 733d 2273 3222 "<{}: < │ │ │ │ +000157d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>{} │ │ │ │ +000157f0: 3c73 7061 6e20 636c 6173 733d 2273 3222 >".format │ │ │ │ +00015840: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00015860: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00015870: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.__class__.__n │ │ │ │ +000158e0: 616d 655f 5f3c 2f73 7061 6e3e 3c73 7061 ame__, self).. < │ │ │ │ +00015940: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +00015950: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef __str │ │ │ │ +00015970: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __(self):< │ │ │ │ +000159c0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +000159d0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +000159e0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn &q │ │ │ │ +00015a00: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;{} { │ │ │ │ +00015a50: 7d3c 2f73 7061 6e3e 3c73 7061 6e20 636c } {}&quo │ │ │ │ +00015aa0: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;.format(< │ │ │ │ +00015af0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.lhs, se │ │ │ │ +00015b70: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.connector, self< │ │ │ │ +00015be0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.rh │ │ │ │ +00015c10: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s) │ │ │ │ +00015c30: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ +00015c50: 203c 7370 616e 2063 6c61 7373 3d22 6e66 get_source_exp │ │ │ │ +00015c70: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c ressions< │ │ │ │ +00015c80: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00015c90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self):. │ │ │ │ +00015cd0: 2020 2020 203c 7370 616e 2063 6c61 7373 return [self │ │ │ │ +00015d20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00015d40: 7370 616e 2063 6c61 7373 3d22 6e22 3e6c span class="n">l │ │ │ │ +00015d50: 6873 3c2f 7370 616e 3e3c 7370 616e 2063 hs, self.< │ │ │ │ +00015da0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>rhs │ │ │ │ +00015dc0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00015dd0: 5d3c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ].. de │ │ │ │ +00015df0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f set_so │ │ │ │ +00015e10: 7572 6365 5f65 7870 7265 7373 696f 6e73 urce_expressions │ │ │ │ +00015e20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00015e40: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00015e50: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self, exprs │ │ │ │ +00015e90: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00015ea0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +00015eb0: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ +00015ee0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>lhs │ │ │ │ +00015f00: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00015f10: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , self.rhs │ │ │ │ +00015f60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +00015f80: 203c 7370 616e 2063 6c61 7373 3d22 6e22 exprs.. │ │ │ │ +00015fa0: 2020 203c 7370 616e 2063 6c61 7373 3d22 def _ │ │ │ │ +00015fd0: 7265 736f 6c76 655f 6f75 7470 7574 5f66 resolve_output_f │ │ │ │ +00015fe0: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield(self< │ │ │ │ +00016020: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00016030: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +00016040: 203c 7370 616e 2063 6c61 7373 3d22 6331 # We avoid usi │ │ │ │ +00016060: 6e67 2073 7570 6572 2829 2068 6572 6520 ng super() here │ │ │ │ +00016070: 666f 7220 7265 6173 6f6e 7320 6769 7665 for reasons give │ │ │ │ +00016080: 6e20 696e 3c2f 7370 616e 3e0a 2020 2020 n in. │ │ │ │ +00016090: 2020 2020 3c73 7061 6e20 636c 6173 733d # Expressio │ │ │ │ +000160b0: 6e2e 5f72 6573 6f6c 7665 5f6f 7574 7075 n._resolve_outpu │ │ │ │ +000160c0: 745f 6669 656c 6428 293c 2f73 7061 6e3e t_field() │ │ │ │ +000160d0: 0a20 2020 2020 2020 203c 7370 616e 2063 . combine │ │ │ │ +000160f0: 645f 7479 7065 3c2f 7370 616e 3e20 3c73 d_type =< │ │ │ │ +00016110: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> _resolve_ │ │ │ │ +00016130: 636f 6d62 696e 6564 5f74 7970 653c 2f73 combined_type(. │ │ │ │ +00016160: 2020 2020 2020 2020 203c 7370 616e 2063 self.con │ │ │ │ +000161b0: 6e65 6374 6f72 3c2f 7370 616e 3e3c 7370 nector,. │ │ │ │ +000161e0: 2020 3c73 7061 6e20 636c 6173 733d 226e type(< │ │ │ │ +00016210: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.lhs._out │ │ │ │ +00016290: 7075 745f 6669 656c 645f 6f72 5f6e 6f6e put_field_or_non │ │ │ │ +000162a0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e),. t │ │ │ │ +000162e0: 7970 653c 2f73 7061 6e3e 3c73 7061 6e20 ype(self.< │ │ │ │ +00016330: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>rhs │ │ │ │ +00016350: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00016360: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c ._output_ │ │ │ │ +00016380: 6669 656c 645f 6f72 5f6e 6f6e 653c 2f73 field_or_none),. │ │ │ │ +000163b0: 2020 2020 2020 3c73 7061 6e20 636c 6173 ). │ │ │ │ +000163d0: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ +000163f0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 combined_type is │ │ │ │ +00016430: 203c 7370 616e 2063 6c61 7373 3d22 6b63 None:. │ │ │ │ +00016470: 2020 3c73 7061 6e20 636c 6173 733d 226b raise < │ │ │ │ +00016490: 7370 616e 2063 6c61 7373 3d22 6e22 3e46 span class="n">F │ │ │ │ +000164a0: 6965 6c64 4572 726f 723c 2f73 7061 6e3e ieldError │ │ │ │ +000164b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000164c0: 283c 2f73 7061 6e3e 0a20 2020 2020 2020 (. │ │ │ │ +000164d0: 2020 2020 2020 2020 203c 7370 616e 2063 f"Cannot │ │ │ │ +00016510: 696e 6665 7220 7479 7065 206f 6620 3c2f infer type of {s │ │ │ │ +00016550: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.connector!r} e │ │ │ │ +000165c0: 7870 7265 7373 696f 6e20 696e 766f 6c76 xpression involv │ │ │ │ +000165d0: 696e 6720 7468 6573 6520 2671 756f 743b ing these " │ │ │ │ +000165e0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +000165f0: 2020 2020 2020 2020 3c73 7061 6e20 636c f"types: < │ │ │ │ +00016630: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>{< │ │ │ │ +00016650: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00016660: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.lhs..__ │ │ │ │ -000166e0: 6e61 6d65 5f5f 3c2f 7370 616e 3e3c 7370 name__}< │ │ │ │ -00016700: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, "< │ │ │ │ -00016720: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -00016730: 2020 2020 2020 203c 7370 616e 2063 6c61 f │ │ │ │ -00016750: 3c73 7061 6e20 636c 6173 733d 2273 3222 "{ │ │ │ │ -00016780: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.rhs.out │ │ │ │ -00016800: 7075 745f 6669 656c 643c 2f73 7061 6e3e put_field │ │ │ │ -00016810: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00016820: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .__class │ │ │ │ -00016840: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __.__name__}. You │ │ │ │ -000168b0: 206d 7573 7420 7365 7420 2671 756f 743b must set " │ │ │ │ -000168c0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000168d0: 2020 2020 2020 2020 3c73 7061 6e20 636c f"output_f │ │ │ │ -00016910: 6965 6c64 2e26 7175 6f74 3b3c 2f73 7061 ield.". < │ │ │ │ -00016930: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00016940: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00016950: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00016960: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return co │ │ │ │ -00016980: 6d62 696e 6564 5f74 7970 653c 2f73 7061 mbined_type().. │ │ │ │ -000169b0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def as_ │ │ │ │ -000169e0: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql(self,< │ │ │ │ -00016a30: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> compiler< │ │ │ │ -00016a50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00016a70: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00016a80: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ -00016a90: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00016aa0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -00016ab0: 2020 3c73 7061 6e20 636c 6173 733d 226e expressions = [] │ │ │ │ -00016b00: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00016b10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00016b20: 6578 7072 6573 7369 6f6e 5f70 6172 616d expression_param │ │ │ │ -00016b30: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = []. │ │ │ │ -00016b70: 2020 2020 3c73 7061 6e20 636c 6173 733d sql,< │ │ │ │ -00016ba0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> params = co │ │ │ │ -00016bf0: 6d70 696c 6572 3c2f 7370 616e 3e3c 7370 mpiler.compile(self │ │ │ │ -00016c60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00016c80: 7370 616e 2063 6c61 7373 3d22 6e22 3e6c span class="n">l │ │ │ │ -00016c90: 6873 3c2f 7370 616e 3e3c 7370 616e 2063 hs). expres │ │ │ │ -00016cd0: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061 sions.append(sql). │ │ │ │ -00016d60: 2020 2020 3c73 7061 6e20 636c 6173 733d expression_p │ │ │ │ -00016d80: 6172 616d 733c 2f73 7061 6e3e 3c73 7061 arams.extend(params< │ │ │ │ -00016df0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ -00016e10: 2020 2020 2020 203c 7370 616e 2063 6c61 sql, params │ │ │ │ -00016e60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -00016e80: 203c 7370 616e 2063 6c61 7373 3d22 6e22 compiler │ │ │ │ -00016ea0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00016eb0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .compile< │ │ │ │ -00016ed0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -00016f00: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.rhs). exp │ │ │ │ -00016f70: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c ressions< │ │ │ │ -00016f80: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00016f90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 append(sql< │ │ │ │ -00016fe0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ -00017000: 2020 2020 2020 203c 7370 616e 2063 6c61 expressio │ │ │ │ -00017020: 6e5f 7061 7261 6d73 3c2f 7370 616e 3e3c n_params< │ │ │ │ -00017030: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00017040: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 extend(para │ │ │ │ -00017090: 6d73 3c2f 7370 616e 3e3c 7370 616e 2063 ms). # ord │ │ │ │ -000170d0: 6572 206f 6620 7072 6563 6564 656e 6365 er of precedence │ │ │ │ -000170e0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000170f0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00017100: 6578 7072 6573 7369 6f6e 5f77 7261 7070 expression_wrapp │ │ │ │ -00017110: 6572 3c2f 7370 616e 3e20 3c73 7061 6e20 er = "(%s)&q │ │ │ │ -00017180: 756f 743b 3c2f 7370 616e 3e0a 2020 2020 uot;. │ │ │ │ -00017190: 2020 2020 3c73 7061 6e20 636c 6173 733d sql < │ │ │ │ -000171b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -000171c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ -000171e0: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on.ops.combine_expre │ │ │ │ -00017250: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion(self │ │ │ │ -00017290: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000172a0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .connecto │ │ │ │ -000172c0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r, │ │ │ │ -000172e0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 expressions). │ │ │ │ -00017320: 2020 2020 3c73 7061 6e20 636c 6173 733d return expression_wra │ │ │ │ -00017360: 7070 6572 3c2f 7370 616e 3e20 3c73 7061 pper % sql< │ │ │ │ -000173a0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -000173b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c expressi │ │ │ │ -000173d0: 6f6e 5f70 6172 616d 733c 2f73 7061 6e3e on_params │ │ │ │ -000173e0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -00017400: 203c 7370 616e 2063 6c61 7373 3d22 6e66 resolve_expres │ │ │ │ -00017420: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion(. sel │ │ │ │ -00017460: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ -00017480: 203c 7370 616e 2063 6c61 7373 3d22 6e22 query=None, allow_ │ │ │ │ -00017500: 6a6f 696e 733c 2f73 7061 6e3e 3c73 7061 joins=True │ │ │ │ -00017540: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00017550: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , reuse=No │ │ │ │ -000175a0: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne, summarize=False │ │ │ │ -00017610: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00017630: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00017640: 666f 725f 7361 7665 3c2f 7370 616e 3e3c for_save< │ │ │ │ -00017650: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00017660: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 False. ):. lhs = < │ │ │ │ -000176e0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -000176f0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.lhs.resolve_exp │ │ │ │ -00017760: 7265 7373 696f 6e3c 2f73 7061 6e3e 3c73 ression(< │ │ │ │ -00017780: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -00017790: 2020 203c 7370 616e 2063 6c61 7373 3d22 query< │ │ │ │ -000177b0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -000177c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c allow_jo │ │ │ │ -000177e0: 696e 733c 2f73 7061 6e3e 3c73 7061 6e20 ins, reuse< │ │ │ │ -00017820: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00017830: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c summariz │ │ │ │ -00017850: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ -00017870: 203c 7370 616e 2063 6c61 7373 3d22 6e22 for_save │ │ │ │ -00017890: 0a20 2020 2020 2020 203c 7370 616e 2063 . ). rhs = s │ │ │ │ -00017900: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.rhs.resolve_expr │ │ │ │ -00017970: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession(. │ │ │ │ -000179a0: 2020 3c73 7061 6e20 636c 6173 733d 226e query,< │ │ │ │ -000179d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> allow_joi │ │ │ │ -000179f0: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063 ns, reuse,< │ │ │ │ -00017a40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> summarize │ │ │ │ -00017a60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00017a80: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00017a90: 666f 725f 7361 7665 3c2f 7370 616e 3e0a for_save. │ │ │ │ -00017aa0: 2020 2020 2020 2020 3c73 7061 6e20 636c ) │ │ │ │ -00017ac0: 0a20 2020 2020 2020 203c 7370 616e 2063 . if not < │ │ │ │ -00017b00: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -00017b10: 6973 696e 7374 616e 6365 3c2f 7370 616e isinstance(self, (< │ │ │ │ -00017b80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DurationEx │ │ │ │ -00017ba0: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ -00017bb0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00017bc0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c Temporal │ │ │ │ -00017be0: 5375 6274 7261 6374 696f 6e3c 2f73 7061 Subtraction)):. │ │ │ │ -00017c10: 2020 2020 2020 2020 203c 7370 616e 2063 try:. │ │ │ │ -00017c50: 2020 2020 2020 2020 2020 2020 3c73 7061 lhs_ │ │ │ │ -00017c70: 7479 7065 3c2f 7370 616e 3e20 3c73 7061 type = lhs< │ │ │ │ -00017cb0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00017cc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 output_fi │ │ │ │ -00017ce0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld.get_internal_t │ │ │ │ -00017d20: 7970 653c 2f73 7061 6e3e 3c73 7061 6e20 ype(). │ │ │ │ -00017d50: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00017d60: 6578 6365 7074 3c2f 7370 616e 3e20 3c73 except (< │ │ │ │ +000166c0: 3d22 6e22 3e6f 7574 7075 745f 6669 656c ="n">output_fiel │ │ │ │ +000166d0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d. │ │ │ │ +000166f0: 3c73 7061 6e20 636c 6173 733d 2276 6d22 __class__.__name │ │ │ │ +00016740: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __}, ". │ │ │ │ +00016790: 2020 203c 7370 616e 2063 6c61 7373 3d22 f&qu │ │ │ │ +000167c0: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;{self< │ │ │ │ +00016800: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00016810: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 rhs.output_ │ │ │ │ +00016860: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field.__class__.__ │ │ │ │ +000168d0: 6e61 6d65 5f5f 3c2f 7370 616e 3e3c 7370 name__}< │ │ │ │ +000168f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>. You mus │ │ │ │ +00016910: 7420 7365 7420 2671 756f 743b 3c2f 7370 t set ". │ │ │ │ +00016930: 2020 2020 3c73 7061 6e20 636c 6173 733d f&q │ │ │ │ +00016960: 756f 743b 6f75 7470 7574 5f66 6965 6c64 uot;output_field │ │ │ │ +00016970: 2e26 7175 6f74 3b3c 2f73 7061 6e3e 0a20 .". │ │ │ │ +00016980: 2020 2020 2020 2020 2020 203c 7370 616e ). retu │ │ │ │ +000169c0: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn combin │ │ │ │ +000169e0: 6564 5f74 7970 653c 2f73 7061 6e3e 3c73 ed_type() │ │ │ │ +00016a00: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +00016a20: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c as_sql< │ │ │ │ +00016a40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +00016a70: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, compiler, conne │ │ │ │ +00016ae0: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction):. ex │ │ │ │ +00016b20: 7072 6573 7369 6f6e 733c 2f73 7061 6e3e pressions │ │ │ │ +00016b30: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = []. expr │ │ │ │ +00016b80: 6573 7369 6f6e 5f70 6172 616d 733c 2f73 ession_params = [] │ │ │ │ +00016bc0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00016bd0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00016be0: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql, params │ │ │ │ +00016c20: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = compil │ │ │ │ +00016c50: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er.compile< │ │ │ │ +00016c90: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00016ca0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.lhs). │ │ │ │ +00016d10: 2020 2020 2020 3c73 7061 6e20 636c 6173 expression │ │ │ │ +00016d30: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00016d50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00016d60: 6170 7065 6e64 3c2f 7370 616e 3e3c 7370 append(sql< │ │ │ │ +00016da0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00016db0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00016dc0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00016dd0: 6578 7072 6573 7369 6f6e 5f70 6172 616d expression_param │ │ │ │ +00016de0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00016e00: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00016e10: 6578 7465 6e64 3c2f 7370 616e 3e3c 7370 extend(params). │ │ │ │ +00016e70: 2020 203c 7370 616e 2063 6c61 7373 3d22 sql, params = com │ │ │ │ +00016ef0: 7069 6c65 723c 2f73 7061 6e3e 3c73 7061 piler.compile(self< │ │ │ │ +00016f60: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.rh │ │ │ │ +00016f90: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s) │ │ │ │ +00016fb0: 0a20 2020 2020 2020 203c 7370 616e 2063 . express │ │ │ │ +00016fd0: 696f 6e73 3c2f 7370 616e 3e3c 7370 616e ions.append │ │ │ │ +00017010: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00017020: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (sql). │ │ │ │ +00017060: 2020 203c 7370 616e 2063 6c61 7373 3d22 expression_pa │ │ │ │ +00017080: 7261 6d73 3c2f 7370 616e 3e3c 7370 616e rams.extend │ │ │ │ +000170c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000170d0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (params). │ │ │ │ +00017110: 2020 2020 2020 3c73 7061 6e20 636c 6173 # order o │ │ │ │ +00017130: 6620 7072 6563 6564 656e 6365 3c2f 7370 f precedence. expr │ │ │ │ +00017160: 6573 7369 6f6e 5f77 7261 7070 6572 3c2f ession_wrapper = < │ │ │ │ +00017190: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +000171a0: 2671 756f 743b 283c 2f73 7061 6e3e 3c73 "(% │ │ │ │ +000171c0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s)" │ │ │ │ +000171e0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +000171f0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00017200: 7371 6c3c 2f73 7061 6e3e 203c 7370 616e sql = connection.ops │ │ │ │ +00017270: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00017290: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +000172a0: 6f6d 6269 6e65 5f65 7870 7265 7373 696f ombine_expressio │ │ │ │ +000172b0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n( │ │ │ │ +000172d0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.connector, exp │ │ │ │ +00017350: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c ressions< │ │ │ │ +00017360: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00017370: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00017380: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00017390: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return ex │ │ │ │ +000173b0: 7072 6573 7369 6f6e 5f77 7261 7070 6572 pression_wrapper │ │ │ │ +000173c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c % │ │ │ │ +000173e0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 sql, expression_p │ │ │ │ +00017430: 6172 616d 733c 2f73 7061 6e3e 0a0a 2020 arams.. │ │ │ │ +00017440: 2020 3c73 7061 6e20 636c 6173 733d 226b def re │ │ │ │ +00017470: 736f 6c76 655f 6578 7072 6573 7369 6f6e solve_expression │ │ │ │ +00017480: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (. │ │ │ │ +000174a0: 2020 2020 2020 2020 3c73 7061 6e20 636c self, que │ │ │ │ +000174f0: 7279 3c2f 7370 616e 3e3c 7370 616e 2063 ry=None, allow_join │ │ │ │ +00017560: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s= │ │ │ │ +00017580: 3c73 7061 6e20 636c 6173 733d 226b 6322 True, reuse=None, su │ │ │ │ +00017630: 6d6d 6172 697a 653c 2f73 7061 6e3e 3c73 mmarize=< │ │ │ │ +00017650: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>False, for_ │ │ │ │ +000176a0: 7361 7665 3c2f 7370 616e 3e3c 7370 616e save=False │ │ │ │ +000176e0: 0a20 2020 203c 7370 616e 2063 6c61 7373 . ):. │ │ │ │ +00017700: 2020 2020 2020 203c 7370 616e 2063 6c61 lhs = self │ │ │ │ +00017750: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00017770: 7370 616e 2063 6c61 7373 3d22 6e22 3e6c span class="n">l │ │ │ │ +00017780: 6873 3c2f 7370 616e 3e3c 7370 616e 2063 hs.resolve_express │ │ │ │ +000177c0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion(. < │ │ │ │ +000177f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ +00017800: 7565 7279 3c2f 7370 616e 3e3c 7370 616e uery, allow_joins< │ │ │ │ +00017840: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00017860: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ +00017870: 6575 7365 3c2f 7370 616e 3e3c 7370 616e euse, summarize, for │ │ │ │ +000178e0: 5f73 6176 653c 2f73 7061 6e3e 0a20 2020 _save. │ │ │ │ +000178f0: 2020 2020 203c 7370 616e 2063 6c61 7373 ). │ │ │ │ +00017910: 2020 2020 2020 3c73 7061 6e20 636c 6173 rhs │ │ │ │ +00017930: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = self< │ │ │ │ +00017960: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.rh │ │ │ │ +00017990: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +000179b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000179c0: 7265 736f 6c76 655f 6578 7072 6573 7369 resolve_expressi │ │ │ │ +000179d0: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(. qu │ │ │ │ +00017a10: 6572 793c 2f73 7061 6e3e 3c73 7061 6e20 ery, allow_joins, re │ │ │ │ +00017a80: 7573 653c 2f73 7061 6e3e 3c73 7061 6e20 use, summarize, for_ │ │ │ │ +00017af0: 7361 7665 3c2f 7370 616e 3e0a 2020 2020 save. │ │ │ │ +00017b00: 2020 2020 3c73 7061 6e20 636c 6173 733d ). │ │ │ │ +00017b20: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +00017b40: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ +00017b50: 6e6f 743c 2f73 7061 6e3e 203c 7370 616e not isin │ │ │ │ +00017b70: 7374 616e 6365 3c2f 7370 616e 3e3c 7370 stance(self, (DurationExpres │ │ │ │ +00017c00: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion, TemporalSubt │ │ │ │ +00017c40: 7261 6374 696f 6e3c 2f73 7061 6e3e 3c73 raction)) │ │ │ │ +00017c60: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +00017c70: 2020 2020 203c 7370 616e 2063 6c61 7373 try< │ │ │ │ +00017c90: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ +00017ca0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00017cb0: 2020 2020 2020 2020 3c73 7061 6e20 636c lhs_type │ │ │ │ +00017cd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +00017cf0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 lhs.output_field< │ │ │ │ +00017d40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ge │ │ │ │ +00017d70: 745f 696e 7465 726e 616c 5f74 7970 653c t_internal_type< │ │ │ │ 00017d80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>Attribute │ │ │ │ -00017da0: 4572 726f 723c 2f73 7061 6e3e 3c73 7061 Error, FieldError< │ │ │ │ -00017de0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -00017e00: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00017e10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00017e20: 6c68 735f 7479 7065 3c2f 7370 616e 3e20 lhs_type │ │ │ │ -00017e30: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00017e40: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = None. │ │ │ │ -00017e70: 2020 3c73 7061 6e20 636c 6173 733d 226b try:. │ │ │ │ -00017eb0: 2020 2020 203c 7370 616e 2063 6c61 7373 rhs_type = rh │ │ │ │ -00017f00: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ -00017f20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00017f30: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field.get_i │ │ │ │ -00017f70: 6e74 6572 6e61 6c5f 7479 7065 3c2f 7370 nternal_type(). │ │ │ │ -00017fa0: 2020 2020 2020 2020 203c 7370 616e 2063 except< │ │ │ │ -00017fc0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (< │ │ │ │ -00017fe0: 7370 616e 2063 6c61 7373 3d22 6e65 223e span class="ne"> │ │ │ │ -00017ff0: 4174 7472 6962 7574 6545 7272 6f72 3c2f AttributeError, Fi │ │ │ │ -00018030: 656c 6445 7272 6f72 3c2f 7370 616e 3e3c eldError< │ │ │ │ -00018040: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00018050: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00018060: 2020 2020 2020 2020 203c 7370 616e 2063 rhs_typ │ │ │ │ -00018080: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = None. │ │ │ │ -000180c0: 2020 2020 2020 2020 2020 203c 7370 616e if(). │ │ │ │ +00017da0: 2020 2020 2020 2020 2020 2020 3c73 7061 exce │ │ │ │ +00017dc0: 7074 3c2f 7370 616e 3e20 3c73 7061 6e20 pt (AttributeErro │ │ │ │ +00017e00: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r, │ │ │ │ +00017e20: 203c 7370 616e 2063 6c61 7373 3d22 6e22 FieldError):. │ │ │ │ +00017e60: 2020 2020 2020 2020 2020 2020 3c73 7061 lhs_ │ │ │ │ +00017e80: 7479 7065 3c2f 7370 616e 3e20 3c73 7061 type = None. tr │ │ │ │ +00017ee0: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y: │ │ │ │ +00017f00: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ +00017f10: 203c 7370 616e 2063 6c61 7373 3d22 6e22 rhs_type │ │ │ │ +00017f30: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = rhs.outp │ │ │ │ +00017f90: 7574 5f66 6965 6c64 3c2f 7370 616e 3e3c ut_field< │ │ │ │ +00017fa0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00017fb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 get_inter │ │ │ │ +00017fd0: 6e61 6c5f 7479 7065 3c2f 7370 616e 3e3c nal_type< │ │ │ │ +00017fe0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00017ff0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +00018000: 2020 2020 203c 7370 616e 2063 6c61 7373 except (Attr │ │ │ │ +00018050: 6962 7574 6545 7272 6f72 3c2f 7370 616e ibuteError, FieldE │ │ │ │ +00018090: 7272 6f72 3c2f 7370 616e 3e3c 7370 616e rror):. │ │ │ │ +000180c0: 2020 2020 203c 7370 616e 2063 6c61 7373 rhs_type "Dura │ │ │ │ -00018100: 7469 6f6e 4669 656c 6426 7175 6f74 3b3c tionField"< │ │ │ │ -00018110: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> in {lhs_ty │ │ │ │ -00018160: 7065 3c2f 7370 616e 3e3c 7370 616e 2063 pe, rhs_type} and lhs_type != │ │ │ │ -00018210: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00018220: 7268 735f 7479 7065 3c2f 7370 616e 3e3c rhs_type< │ │ │ │ -00018230: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ -00018240: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00018250: 2020 2020 2020 2020 3c73 7061 6e20 636c return DurationEx │ │ │ │ -00018290: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ -000182a0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -000182b0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000182c0: 2020 2020 2020 2020 2020 2020 3c73 7061 sel │ │ │ │ -000182e0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00018300: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00018310: 6c68 733c 2f73 7061 6e3e 3c73 7061 6e20 lhs, self< │ │ │ │ -00018350: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00018360: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 connector │ │ │ │ -00018380: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -000183a0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.rhs. │ │ │ │ -000183f0: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ -00018400: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00018410: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00018430: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ -00018440: 6573 6f6c 7665 5f65 7870 7265 7373 696f esolve_expressio │ │ │ │ -00018450: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n( │ │ │ │ -00018470: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -00018480: 2020 2020 203c 7370 616e 2063 6c61 7373 query,. │ │ │ │ -000184c0: 2020 2020 2020 2020 2020 2020 2020 3c73 al │ │ │ │ -000184e0: 6c6f 775f 6a6f 696e 733c 2f73 7061 6e3e low_joins │ │ │ │ -000184f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00018500: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ -00018510: 2020 2020 2020 2020 2020 2020 203c 7370 reu │ │ │ │ -00018530: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se,. │ │ │ │ -00018560: 2020 2020 2020 3c73 7061 6e20 636c 6173 summarize< │ │ │ │ -00018580: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ -000185a0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000185b0: 2020 203c 7370 616e 2063 6c61 7373 3d22 for_save,. │ │ │ │ -000185f0: 2020 2020 2020 2020 2020 203c 7370 616e ). │ │ │ │ -00018620: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00018630: 6461 7465 7469 6d65 5f66 6965 6c64 733c datetime_fields< │ │ │ │ -00018640: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -00018660: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00018670: 7b3c 2f73 7061 6e3e 3c73 7061 6e20 636c {"D │ │ │ │ -00018690: 6174 6546 6965 6c64 2671 756f 743b 3c2f ateField", & │ │ │ │ -000186d0: 7175 6f74 3b44 6174 6554 696d 6546 6965 quot;DateTimeFie │ │ │ │ -000186e0: 6c64 2671 756f 743b 3c2f 7370 616e 3e3c ld"< │ │ │ │ -000186f0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00018700: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c "T │ │ │ │ -00018720: 696d 6546 6965 6c64 2671 756f 743b 3c2f imeField"}. │ │ │ │ -00018750: 2020 2020 2020 2020 2020 3c73 7061 6e20 if (. │ │ │ │ -00018790: 2020 2020 2020 2020 2020 2020 203c 7370 se │ │ │ │ -000187b0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.connector == sel │ │ │ │ -00018820: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00018840: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00018850: 5355 423c 2f73 7061 6e3e 0a20 2020 2020 SUB. │ │ │ │ -00018860: 2020 2020 2020 2020 2020 203c 7370 616e and< │ │ │ │ -00018880: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> lhs_type< │ │ │ │ -000188a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> in datetime_field │ │ │ │ -000188e0: 733c 2f73 7061 6e3e 0a20 2020 2020 2020 s. │ │ │ │ -000188f0: 2020 2020 2020 2020 203c 7370 616e 2063 and lhs_type == < │ │ │ │ -00018950: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ -00018960: 6873 5f74 7970 653c 2f73 7061 6e3e 0a20 hs_type. │ │ │ │ -00018970: 2020 2020 2020 2020 2020 203c 7370 616e ):. │ │ │ │ -000189a0: 2020 2020 203c 7370 616e 2063 6c61 7373 return TemporalSubtr │ │ │ │ -000189e0: 6163 7469 6f6e 3c2f 7370 616e 3e3c 7370 action(self.lhs, sel │ │ │ │ -00018a80: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00018aa0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00018ab0: 7268 733c 2f73 7061 6e3e 3c73 7061 6e20 rhs).resolv │ │ │ │ -00018b00: 655f 6578 7072 6573 7369 6f6e 3c2f 7370 e_expression(. │ │ │ │ -00018b30: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00018b40: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00018b50: 7175 6572 793c 2f73 7061 6e3e 3c73 7061 query,. │ │ │ │ -00018b80: 2020 2020 2020 2020 203c 7370 616e 2063 allow_j │ │ │ │ -00018ba0: 6f69 6e73 3c2f 7370 616e 3e3c 7370 616e oins,. │ │ │ │ -00018bd0: 2020 2020 2020 2020 3c73 7061 6e20 636c reuse,. │ │ │ │ -00018c10: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00018c20: 203c 7370 616e 2063 6c61 7373 3d22 6e22 summarize,. │ │ │ │ -00018c60: 2020 2020 2020 2020 2020 2020 2020 3c73 fo │ │ │ │ -00018c80: 725f 7361 7665 3c2f 7370 616e 3e3c 7370 r_save,. │ │ │ │ -00018cb0: 2020 2020 2020 3c73 7061 6e20 636c 6173 ). │ │ │ │ -00018cd0: 2020 2020 2020 203c 7370 616e 2063 6c61 c │ │ │ │ -00018cf0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00018d00: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = self.cop │ │ │ │ -00018d50: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y(). c.is_sum │ │ │ │ -00018dc0: 6d61 7279 3c2f 7370 616e 3e20 3c73 7061 mary = summarize. c< │ │ │ │ -00018e20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.lh │ │ │ │ -00018e50: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = lhs. │ │ │ │ -00018e90: 2020 2020 203c 7370 616e 2063 6c61 7373 c.rhs │ │ │ │ -00018ee0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00018ef0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = rhs. retu │ │ │ │ -00018f30: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn c...class DurationExpre │ │ │ │ -00018f90: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion(CombinedExpr │ │ │ │ -00018fd0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession):< │ │ │ │ -00018ff0: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. def compile(se │ │ │ │ -00019060: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, side, compiler, co │ │ │ │ -00019100: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ -00019110: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00019120: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00019130: 203c 7370 616e 2063 6c61 7373 3d22 6b22 try:. │ │ │ │ -00019170: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00019180: 6f75 7470 7574 3c2f 7370 616e 3e20 3c73 output =< │ │ │ │ -000191a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> side.output │ │ │ │ -000191f0: 5f66 6965 6c64 3c2f 7370 616e 3e0a 2020 _field. │ │ │ │ -00019200: 2020 2020 2020 3c73 7061 6e20 636c 6173 except FieldError:. │ │ │ │ -00019260: 2020 2020 2020 2020 2020 3c73 7061 6e20 pass. el │ │ │ │ -000192a0: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se:. if │ │ │ │ -000192e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c output= N │ │ │ │ +00018110: 6f6e 653c 2f73 7061 6e3e 0a20 2020 2020 one. │ │ │ │ +00018120: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ +00018140: 203c 7370 616e 2063 6c61 7373 3d22 7332 "Duration │ │ │ │ +00018160: 4669 656c 6426 7175 6f74 3b3c 2f73 7061 Field" in {< │ │ │ │ +000181a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>lhs_type, rh │ │ │ │ +000181f0: 735f 7479 7065 3c2f 7370 616e 3e3c 7370 s_type} and lhs_type != rhs_ │ │ │ │ +00018280: 7479 7065 3c2f 7370 616e 3e3c 7370 616e type:. │ │ │ │ +000182b0: 2020 2020 3c73 7061 6e20 636c 6173 733d return DurationExpres │ │ │ │ +000182f0: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion(. │ │ │ │ +00018320: 2020 2020 2020 2020 3c73 7061 6e20 636c self.lhs< │ │ │ │ +00018370: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00018390: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +000183a0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.connector, sel │ │ │ │ +00018410: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +00018430: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00018440: 7268 733c 2f73 7061 6e3e 0a20 2020 2020 rhs. │ │ │ │ +00018450: 2020 2020 2020 2020 2020 203c 7370 616e ).resol │ │ │ │ +000184a0: 7665 5f65 7870 7265 7373 696f 6e3c 2f73 ve_expression(. │ │ │ │ +000184d0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000184e0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 query,. │ │ │ │ +00018520: 2020 2020 2020 2020 2020 3c73 7061 6e20 allow_ │ │ │ │ +00018540: 6a6f 696e 733c 2f73 7061 6e3e 3c73 7061 joins,. │ │ │ │ +00018570: 2020 2020 2020 2020 203c 7370 616e 2063 reuse,. │ │ │ │ +000185b0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000185c0: 2020 3c73 7061 6e20 636c 6173 733d 226e summarize,. │ │ │ │ +00018600: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +00018610: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +00018620: 6f72 5f73 6176 653c 2f73 7061 6e3e 3c73 or_save,< │ │ │ │ +00018640: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00018650: 2020 2020 2020 203c 7370 616e 2063 6c61 ). │ │ │ │ +00018670: 2020 2020 2020 2020 2020 2020 3c73 7061 date │ │ │ │ +00018690: 7469 6d65 5f66 6965 6c64 733c 2f73 7061 time_fields = {"DateF │ │ │ │ +000186f0: 6965 6c64 2671 756f 743b 3c2f 7370 616e ield", " │ │ │ │ +00018730: 3b44 6174 6554 696d 6546 6965 6c64 2671 ;DateTimeField&q │ │ │ │ +00018740: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;, "TimeF │ │ │ │ +00018780: 6965 6c64 2671 756f 743b 3c2f 7370 616e ield"}. │ │ │ │ +000187b0: 2020 2020 2020 3c73 7061 6e20 636c 6173 if │ │ │ │ +000187d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000187e0: 283c 2f73 7061 6e3e 0a20 2020 2020 2020 (. │ │ │ │ +000187f0: 2020 2020 2020 2020 203c 7370 616e 2063 self.con │ │ │ │ +00018840: 6e65 6374 6f72 3c2f 7370 616e 3e20 3c73 nector == │ │ │ │ +00018860: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.SUB< │ │ │ │ +000188b0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +000188c0: 2020 2020 2020 203c 7370 616e 2063 6c61 and lhs_type in da │ │ │ │ +00018930: 7465 7469 6d65 5f66 6965 6c64 733c 2f73 tetime_fields. │ │ │ │ +00018950: 2020 2020 203c 7370 616e 2063 6c61 7373 and │ │ │ │ +00018970: 203c 7370 616e 2063 6c61 7373 3d22 6e22 lhs_type │ │ │ │ +00018990: 203c 7370 616e 2063 6c61 7373 3d22 6f22 == rhs_t │ │ │ │ +000189c0: 7970 653c 2f73 7061 6e3e 0a20 2020 2020 ype. │ │ │ │ +000189d0: 2020 2020 2020 203c 7370 616e 2063 6c61 ): │ │ │ │ +000189f0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ +00018a00: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +00018a20: 7370 616e 2063 6c61 7373 3d22 6e22 3e54 span class="n">T │ │ │ │ +00018a30: 656d 706f 7261 6c53 7562 7472 6163 7469 emporalSubtracti │ │ │ │ +00018a40: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(self.lhs< │ │ │ │ +00018ab0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00018ac0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.rhs< │ │ │ │ +00018b10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).< │ │ │ │ +00018b40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>resolve_ex │ │ │ │ +00018b60: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ +00018b70: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00018b80: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00018b90: 2020 2020 2020 2020 2020 2020 3c73 7061 quer │ │ │ │ +00018bb0: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y, │ │ │ │ +00018bd0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ +00018be0: 2020 2020 203c 7370 616e 2063 6c61 7373 allow_joins │ │ │ │ +00018c00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ,. │ │ │ │ +00018c20: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00018c30: 2020 2020 3c73 7061 6e20 636c 6173 733d reuse │ │ │ │ +00018c50: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00018c60: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ +00018c70: 2020 2020 2020 2020 2020 2020 203c 7370 sum │ │ │ │ +00018c90: 6d61 7269 7a65 3c2f 7370 616e 3e3c 7370 marize,. │ │ │ │ +00018cc0: 2020 2020 2020 2020 2020 3c73 7061 6e20 for_sa │ │ │ │ +00018ce0: 7665 3c2f 7370 616e 3e3c 7370 616e 2063 ve,. │ │ │ │ +00018d10: 2020 3c73 7061 6e20 636c 6173 733d 2270 ). │ │ │ │ +00018d30: 2020 203c 7370 616e 2063 6c61 7373 3d22 c = self.copy(). │ │ │ │ +00018dd0: 2020 2020 2020 3c73 7061 6e20 636c 6173 c.< │ │ │ │ +00018e00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>is_summary │ │ │ │ +00018e20: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +00018e40: 203c 7370 616e 2063 6c61 7373 3d22 6e22 summarize. c.lhs = lh │ │ │ │ +00018ee0: 733c 2f73 7061 6e3e 0a20 2020 2020 2020 s. │ │ │ │ +00018ef0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 c.rhs = rhs. │ │ │ │ +00018f70: 2020 2020 2020 2020 3c73 7061 6e20 636c return c.. │ │ │ │ +00018fb0: 0a3c 7370 616e 2063 6c61 7373 3d22 6b22 .class D │ │ │ │ +00018fe0: 7572 6174 696f 6e45 7870 7265 7373 696f urationExpressio │ │ │ │ +00018ff0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n( │ │ │ │ +00019010: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00019020: 436f 6d62 696e 6564 4578 7072 6573 7369 CombinedExpressi │ │ │ │ +00019030: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on):. def compile(self, si │ │ │ │ +000190f0: 6465 3c2f 7370 616e 3e3c 7370 616e 2063 de, compiler, connec │ │ │ │ +00019160: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion):. try │ │ │ │ +000191a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +000191c0: 2020 2020 2020 2020 2020 2020 3c73 7061 outp │ │ │ │ +000191e0: 7574 3c2f 7370 616e 3e20 3c73 7061 6e20 ut = side.< │ │ │ │ +00019230: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>output_fie │ │ │ │ +00019250: 6c64 3c2f 7370 616e 3e0a 2020 2020 2020 ld. │ │ │ │ +00019260: 2020 3c73 7061 6e20 636c 6173 733d 226b except │ │ │ │ +00019280: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00019290: 4669 656c 6445 7272 6f72 3c2f 7370 616e FieldError:. │ │ │ │ +000192c0: 2020 2020 2020 3c73 7061 6e20 636c 6173 pass. else.get │ │ │ │ -00019330: 5f69 6e74 6572 6e61 6c5f 7479 7065 3c2f _internal_type() < │ │ │ │ -00019360: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00019370: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = " │ │ │ │ -00019390: 4475 7261 7469 6f6e 4669 656c 6426 7175 DurationField&qu │ │ │ │ -000193a0: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;:. │ │ │ │ -000193d0: 2020 203c 7370 616e 2063 6c61 7373 3d22 sql, params = com │ │ │ │ -00019450: 7069 6c65 723c 2f73 7061 6e3e 3c73 7061 piler.compile(side). │ │ │ │ -000194e0: 2020 2020 2020 2020 2020 2020 2020 3c73 re │ │ │ │ -00019500: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn conn │ │ │ │ -00019520: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection.ops< │ │ │ │ -00019560: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00019570: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 format_fo │ │ │ │ -00019590: 725f 6475 7261 7469 6f6e 5f61 7269 7468 r_duration_arith │ │ │ │ -000195a0: 6d65 7469 633c 2f73 7061 6e3e 3c73 7061 metic(sql), │ │ │ │ -000195f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c params. re │ │ │ │ -00019630: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn comp │ │ │ │ -00019650: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler.compile(side).. │ │ │ │ -000196e0: 2020 3c73 7061 6e20 636c 6173 733d 226b def as │ │ │ │ -00019710: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e _sql(self< │ │ │ │ -00019750: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00019760: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c compiler │ │ │ │ -00019780: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -000197a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000197b0: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection):. │ │ │ │ -000197e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 if con │ │ │ │ -00019810: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection.< │ │ │ │ -00019830: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>features.has │ │ │ │ -00019880: 5f6e 6174 6976 655f 6475 7261 7469 6f6e _native_duration │ │ │ │ -00019890: 5f66 6965 6c64 3c2f 7370 616e 3e3c 7370 _field:. │ │ │ │ -000198c0: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ -000198e0: 3c73 7061 6e20 636c 6173 733d 226e 6222 super()< │ │ │ │ -00019910: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.as │ │ │ │ -00019940: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e _sql(compiler, conne │ │ │ │ -000199b0: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction). con │ │ │ │ -000199f0: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection.< │ │ │ │ -00019a10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>ops │ │ │ │ -00019a30: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00019a40: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .check_ex │ │ │ │ -00019a60: 7072 6573 7369 6f6e 5f73 7570 706f 7274 pression_support │ │ │ │ -00019a70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00019a90: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00019aa0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self). expr │ │ │ │ -00019ae0: 6573 7369 6f6e 733c 2f73 7061 6e3e 203c essions < │ │ │ │ -00019af0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00019b00: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c []. expres │ │ │ │ -00019b40: 7369 6f6e 5f70 6172 616d 733c 2f73 7061 sion_params = []. sq │ │ │ │ -00019ba0: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l, │ │ │ │ -00019bc0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 params < │ │ │ │ -00019be0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00019bf0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.comp │ │ │ │ -00019c40: 696c 653c 2f73 7061 6e3e 3c73 7061 6e20 ile(self.< │ │ │ │ -00019c90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>lhs │ │ │ │ -00019cb0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00019cc0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , compile │ │ │ │ -00019ce0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r, │ │ │ │ -00019d00: 203c 7370 616e 2063 6c61 7373 3d22 6e22 connection). │ │ │ │ -00019d40: 2020 203c 7370 616e 2063 6c61 7373 3d22 expressions.app │ │ │ │ -00019d90: 656e 643c 2f73 7061 6e3e 3c73 7061 6e20 end(sql). exp │ │ │ │ -00019e00: 7265 7373 696f 6e5f 7061 7261 6d73 3c2f ression_params.ext │ │ │ │ -00019e40: 656e 643c 2f73 7061 6e3e 3c73 7061 6e20 end(params< │ │ │ │ -00019e80: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00019e90: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00019ea0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00019eb0: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql, params │ │ │ │ -00019ef0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = self< │ │ │ │ -00019f20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ -00019f50: 6d70 696c 653c 2f73 7061 6e3e 3c73 7061 mpile(self │ │ │ │ -00019f90: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00019fa0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .rhs, compi │ │ │ │ -00019ff0: 6c65 723c 2f73 7061 6e3e 3c73 7061 6e20 ler, connection). │ │ │ │ -0001a050: 2020 2020 203c 7370 616e 2063 6c61 7373 expressions │ │ │ │ -0001a070: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0001a090: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -0001a0a0: 7070 656e 643c 2f73 7061 6e3e 3c73 7061 ppend(sql)< │ │ │ │ -0001a0f0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -0001a100: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -0001a110: 7870 7265 7373 696f 6e5f 7061 7261 6d73 xpression_params │ │ │ │ -0001a120: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0001a140: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -0001a150: 7874 656e 643c 2f73 7061 6e3e 3c73 7061 xtend(params). │ │ │ │ -0001a1b0: 2020 3c73 7061 6e20 636c 6173 733d 2263 # order of pr │ │ │ │ -0001a1d0: 6563 6564 656e 6365 3c2f 7370 616e 3e0a ecedence. │ │ │ │ -0001a1e0: 2020 2020 2020 2020 3c73 7061 6e20 636c expressi │ │ │ │ -0001a200: 6f6e 5f77 7261 7070 6572 3c2f 7370 616e on_wrapper = &quo │ │ │ │ -0001a240: 743b 283c 2f73 7061 6e3e 3c73 7061 6e20 t;(%s)". sql< │ │ │ │ -0001a2a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -0001a2c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001a2d0: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection.ops.combi │ │ │ │ -0001a340: 6e65 5f64 7572 6174 696f 6e5f 6578 7072 ne_duration_expr │ │ │ │ -0001a350: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession(self.connect │ │ │ │ -0001a3c0: 6f72 3c2f 7370 616e 3e3c 7370 616e 2063 or, expressions). │ │ │ │ -0001a420: 2020 2020 203c 7370 616e 2063 6c61 7373 return expression_wr │ │ │ │ -0001a460: 6170 7065 723c 2f73 7061 6e3e 203c 7370 apper % sql │ │ │ │ -0001a4a0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001a4b0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , express │ │ │ │ -0001a4d0: 696f 6e5f 7061 7261 6d73 3c2f 7370 616e ion_params.. def as_sqlite(self │ │ │ │ -0001a550: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0001a570: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001a580: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ -0001a590: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0001a5a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ -0001a5c0: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on, **extra │ │ │ │ -0001a610: 5f63 6f6e 7465 7874 3c2f 7370 616e 3e3c _context< │ │ │ │ -0001a620: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0001a630: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -0001a640: 203c 7370 616e 2063 6c61 7373 3d22 6e22 sql, params = self │ │ │ │ -0001a6c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0001a6e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -0001a6f0: 735f 7371 6c3c 2f73 7061 6e3e 3c73 7061 s_sql(compiler, conn │ │ │ │ -0001a760: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection, **< │ │ │ │ -0001a7a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -0001a7b0: 7874 7261 5f63 6f6e 7465 7874 3c2f 7370 xtra_context). │ │ │ │ -0001a7e0: 2020 2020 3c73 7061 6e20 636c 6173 733d if s │ │ │ │ -0001a810: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.connector in {< │ │ │ │ -0001a880: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>Combinable │ │ │ │ -0001a8a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0001a8c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e4d span class="n">M │ │ │ │ -0001a8d0: 554c 3c2f 7370 616e 3e3c 7370 616e 2063 UL, Combinable.DIV}:. │ │ │ │ -0001a960: 2020 2020 2020 2020 2020 203c 7370 616e try:. │ │ │ │ -0001a9a0: 2020 2020 2020 2020 2020 2020 2020 3c73 lh │ │ │ │ -0001a9c0: 735f 7479 7065 3c2f 7370 616e 3e20 3c73 s_type =< │ │ │ │ -0001a9e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.lhs.out │ │ │ │ -0001aa60: 7075 745f 6669 656c 643c 2f73 7061 6e3e put_field │ │ │ │ -0001aa70: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001aa80: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .get_inte │ │ │ │ -0001aaa0: 726e 616c 5f74 7970 653c 2f73 7061 6e3e rnal_type │ │ │ │ -0001aab0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001aac0: 2829 3c2f 7370 616e 3e0a 2020 2020 2020 (). │ │ │ │ -0001aad0: 2020 2020 2020 2020 2020 3c73 7061 6e20 rhs_ty │ │ │ │ -0001aaf0: 7065 3c2f 7370 616e 3e20 3c73 7061 6e20 pe = self< │ │ │ │ -0001ab30: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0001ab40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 rhs.output_ │ │ │ │ -0001ab90: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field.get_internal │ │ │ │ -0001abd0: 5f74 7970 653c 2f73 7061 6e3e 3c73 7061 _type(). │ │ │ │ -0001ac00: 2020 3c73 7061 6e20 636c 6173 733d 226b except │ │ │ │ -0001ac20: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001ac30: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (Attribu │ │ │ │ -0001ac50: 7465 4572 726f 723c 2f73 7061 6e3e 3c73 teError,< │ │ │ │ -0001ac70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> FieldErro │ │ │ │ -0001ac90: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r):. │ │ │ │ -0001acc0: 2020 3c73 7061 6e20 636c 6173 733d 226b pass. │ │ │ │ -0001ace0: 2020 2020 2020 2020 2020 3c73 7061 6e20 else:. │ │ │ │ -0001ad20: 2020 2020 2020 2020 2020 2020 2020 3c73 al │ │ │ │ -0001ad40: 6c6f 7765 645f 6669 656c 6473 3c2f 7370 lowed_fields = {. │ │ │ │ -0001ad90: 2020 2020 2020 2020 2020 3c73 7061 6e20 " │ │ │ │ -0001adb0: 3b44 6563 696d 616c 4669 656c 6426 7175 ;DecimalField&qu │ │ │ │ -0001adc0: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;,. │ │ │ │ -0001adf0: 2020 2020 2020 203c 7370 616e 2063 6c61 "Du │ │ │ │ -0001ae10: 7261 7469 6f6e 4669 656c 6426 7175 6f74 rationField" │ │ │ │ -0001ae20: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;, │ │ │ │ -0001ae40: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0001ae50: 2020 2020 203c 7370 616e 2063 6c61 7373 "Floa │ │ │ │ -0001ae70: 7446 6965 6c64 2671 756f 743b 3c2f 7370 tField",. │ │ │ │ +00019310: 3d22 7022 3e3a 3c2f 7370 616e 3e0a 2020 ="p">:. │ │ │ │ +00019320: 2020 2020 2020 2020 2020 3c73 7061 6e20 if output.get_int │ │ │ │ +00019390: 6572 6e61 6c5f 7479 7065 3c2f 7370 616e ernal_type() == "Dura │ │ │ │ +000193f0: 7469 6f6e 4669 656c 6426 7175 6f74 3b3c tionField"< │ │ │ │ +00019400: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>:. │ │ │ │ +00019420: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +00019430: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ +00019440: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql, params │ │ │ │ +00019480: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00019490: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = compile │ │ │ │ +000194b0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r. │ │ │ │ +000194d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000194e0: 636f 6d70 696c 653c 2f73 7061 6e3e 3c73 compile(< │ │ │ │ +00019500: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>side). │ │ │ │ +00019540: 2020 2020 2020 2020 2020 3c73 7061 6e20 return │ │ │ │ +00019560: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ +00019580: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on.ops.format_for_du │ │ │ │ +000195f0: 7261 7469 6f6e 5f61 7269 7468 6d65 7469 ration_arithmeti │ │ │ │ +00019600: 633c 2f73 7061 6e3e 3c73 7061 6e20 636c c( │ │ │ │ +00019620: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00019630: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql), params. return │ │ │ │ +00019690: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c compiler │ │ │ │ +000196b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000196d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +000196e0: 6f6d 7069 6c65 3c2f 7370 616e 3e3c 7370 ompile(side │ │ │ │ +00019720: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00019730: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ).. de │ │ │ │ +00019750: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f as_sql │ │ │ │ +00019770: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00019790: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +000197a0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self, compiler, conn │ │ │ │ +00019810: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection):< │ │ │ │ +00019830: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00019840: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ +00019850: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f connect │ │ │ │ +00019870: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion.features.has_nat │ │ │ │ +000198e0: 6976 655f 6475 7261 7469 6f6e 5f66 6965 ive_duration_fie │ │ │ │ +000198f0: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld:. re │ │ │ │ +00019930: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn sup │ │ │ │ +00019950: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er().as_sql │ │ │ │ +000199a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +000199c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +000199d0: 6f6d 7069 6c65 723c 2f73 7061 6e3e 3c73 ompiler,< │ │ │ │ +000199f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> connectio │ │ │ │ +00019a10: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n) │ │ │ │ +00019a30: 0a20 2020 2020 2020 203c 7370 616e 2063 . connect │ │ │ │ +00019a50: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion.ops.check_expres │ │ │ │ +00019ac0: 7369 6f6e 5f73 7570 706f 7274 3c2f 7370 sion_support(self │ │ │ │ +00019b00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +00019b20: 2020 2020 2020 2020 3c73 7061 6e20 636c expressi │ │ │ │ +00019b40: 6f6e 733c 2f73 7061 6e3e 203c 7370 616e ons = []. │ │ │ │ +00019b80: 2020 2020 2020 3c73 7061 6e20 636c 6173 expression │ │ │ │ +00019ba0: 5f70 6172 616d 733c 2f73 7061 6e3e 203c _params < │ │ │ │ +00019bb0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00019bc0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c []. sql, par │ │ │ │ +00019c30: 616d 733c 2f73 7061 6e3e 203c 7370 616e ams = self │ │ │ │ +00019c70: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00019c80: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .compile< │ │ │ │ +00019ca0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +00019cd0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.lhs, compiler, con │ │ │ │ +00019d70: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection)< │ │ │ │ +00019d90: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00019da0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ +00019db0: 7870 7265 7373 696f 6e73 3c2f 7370 616e xpressions.append< │ │ │ │ +00019df0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(sq │ │ │ │ +00019e20: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l) │ │ │ │ +00019e40: 0a20 2020 2020 2020 203c 7370 616e 2063 . express │ │ │ │ +00019e60: 696f 6e5f 7061 7261 6d73 3c2f 7370 616e ion_params.extend< │ │ │ │ +00019ea0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(pa │ │ │ │ +00019ed0: 7261 6d73 3c2f 7370 616e 3e3c 7370 616e rams). sql< │ │ │ │ +00019f10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00019f30: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ +00019f40: 6172 616d 733c 2f73 7061 6e3e 203c 7370 arams = self.compil │ │ │ │ +00019fb0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ +00019fd0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.rhs,< │ │ │ │ +0001a030: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> compiler< │ │ │ │ +0001a050: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0001a070: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0001a080: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ +0001a090: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001a0a0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +0001a0b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 expressions.appen │ │ │ │ +0001a100: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d( │ │ │ │ +0001a120: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001a130: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql). expre │ │ │ │ +0001a170: 7373 696f 6e5f 7061 7261 6d73 3c2f 7370 ssion_params.exten │ │ │ │ +0001a1b0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d( │ │ │ │ +0001a1d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001a1e0: 7061 7261 6d73 3c2f 7370 616e 3e3c 7370 params). # │ │ │ │ +0001a220: 206f 7264 6572 206f 6620 7072 6563 6564 order of preced │ │ │ │ +0001a230: 656e 6365 3c2f 7370 616e 3e0a 2020 2020 ence. │ │ │ │ +0001a240: 2020 2020 3c73 7061 6e20 636c 6173 733d expression_w │ │ │ │ +0001a260: 7261 7070 6572 3c2f 7370 616e 3e20 3c73 rapper =< │ │ │ │ +0001a280: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "(< │ │ │ │ +0001a2a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>%s │ │ │ │ +0001a2c0: 3c73 7061 6e20 636c 6173 733d 2273 3222 )". │ │ │ │ +0001a2e0: 2020 2020 2020 2020 3c73 7061 6e20 636c sql = conn │ │ │ │ +0001a330: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection.ops< │ │ │ │ +0001a370: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0001a380: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 combine_d │ │ │ │ +0001a3a0: 7572 6174 696f 6e5f 6578 7072 6573 7369 uration_expressi │ │ │ │ +0001a3b0: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(self.connector, ex │ │ │ │ +0001a450: 7072 6573 7369 6f6e 733c 2f73 7061 6e3e pressions │ │ │ │ +0001a460: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001a470: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +0001a480: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +0001a4a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ +0001a4b0: 7870 7265 7373 696f 6e5f 7772 6170 7065 xpression_wrappe │ │ │ │ +0001a4c0: 723c 2f73 7061 6e3e 203c 7370 616e 2063 r % sql, expression_ │ │ │ │ +0001a530: 7061 7261 6d73 3c2f 7370 616e 3e0a 0a20 params.. │ │ │ │ +0001a540: 2020 203c 7370 616e 2063 6c61 7373 3d22 def a │ │ │ │ +0001a570: 735f 7371 6c69 7465 3c2f 7370 616e 3e3c s_sqlite< │ │ │ │ +0001a580: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0001a590: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, comp │ │ │ │ +0001a5e0: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler, connection, ** │ │ │ │ +0001a650: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 extra_con │ │ │ │ +0001a670: 7465 7874 3c2f 7370 616e 3e3c 7370 616e text):. sql │ │ │ │ +0001a6b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +0001a6d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001a6e0: 7061 7261 6d73 3c2f 7370 616e 3e20 3c73 params =< │ │ │ │ +0001a700: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.as_sq │ │ │ │ +0001a750: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l( │ │ │ │ +0001a770: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001a780: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ +0001a790: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0001a7a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ +0001a7c0: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on, **extra │ │ │ │ +0001a810: 5f63 6f6e 7465 7874 3c2f 7370 616e 3e3c _context< │ │ │ │ +0001a820: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0001a830: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0001a840: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0001a850: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if self< │ │ │ │ +0001a870: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ +0001a8a0: 6e6e 6563 746f 723c 2f73 7061 6e3e 203c nnector < │ │ │ │ +0001a8b0: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ +0001a8c0: 696e 3c2f 7370 616e 3e20 3c73 7061 6e20 in {Combinable.MUL, Co │ │ │ │ +0001a960: 6d62 696e 6162 6c65 3c2f 7370 616e 3e3c mbinable< │ │ │ │ +0001a970: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0001a980: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 DIV}:. │ │ │ │ +0001a9c0: 2020 2020 2020 203c 7370 616e 2063 6c61 try:. │ │ │ │ +0001aa00: 2020 2020 2020 2020 2020 3c73 7061 6e20 lhs_ty │ │ │ │ +0001aa20: 7065 3c2f 7370 616e 3e20 3c73 7061 6e20 pe = self< │ │ │ │ +0001aa60: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0001aa70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 lhs.output_ │ │ │ │ +0001aac0: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field.get_internal │ │ │ │ +0001ab00: 5f74 7970 653c 2f73 7061 6e3e 3c73 7061 _type(). │ │ │ │ +0001ab30: 2020 2020 2020 3c73 7061 6e20 636c 6173 rhs_type = < │ │ │ │ +0001ab70: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0001ab80: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.rhs.output_fiel │ │ │ │ +0001abf0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d. │ │ │ │ +0001ac10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001ac20: 6765 745f 696e 7465 726e 616c 5f74 7970 get_internal_typ │ │ │ │ +0001ac30: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e(). ex │ │ │ │ +0001ac70: 6365 7074 3c2f 7370 616e 3e20 3c73 7061 cept (AttributeEr │ │ │ │ +0001acb0: 726f 723c 2f73 7061 6e3e 3c73 7061 6e20 ror, FieldError):. │ │ │ │ +0001ad10: 2020 2020 2020 2020 2020 2020 2020 3c73 pa │ │ │ │ +0001ad30: 7373 3c2f 7370 616e 3e0a 2020 2020 2020 ss. │ │ │ │ +0001ad40: 2020 2020 2020 3c73 7061 6e20 636c 6173 else:. │ │ │ │ +0001ad80: 2020 2020 2020 2020 2020 3c73 7061 6e20 allowe │ │ │ │ +0001ada0: 645f 6669 656c 6473 3c2f 7370 616e 3e20 d_fields │ │ │ │ +0001adb0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0001adc0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = {. │ │ │ │ +0001adf0: 2020 2020 2020 3c73 7061 6e20 636c 6173 "Dec │ │ │ │ +0001ae10: 696d 616c 4669 656c 6426 7175 6f74 3b3c imalField"< │ │ │ │ +0001ae20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ +0001ae40: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0001ae50: 2020 203c 7370 616e 2063 6c61 7373 3d22 "Durati │ │ │ │ +0001ae70: 6f6e 4669 656c 6426 7175 6f74 3b3c 2f73 onField",. │ │ │ │ 0001aea0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0001aeb0: 3c73 7061 6e20 636c 6173 733d 2273 3222 "IntegerFi │ │ │ │ -0001aed0: 656c 6426 7175 6f74 3b3c 2f73 7061 6e3e eld" │ │ │ │ -0001aee0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001aef0: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ -0001af00: 2020 2020 2020 2020 203c 7370 616e 2063 }. │ │ │ │ -0001af30: 2020 3c73 7061 6e20 636c 6173 733d 226b if lhs_ │ │ │ │ -0001af60: 7479 7065 3c2f 7370 616e 3e20 3c73 7061 type not │ │ │ │ -0001af80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c in allowed_field │ │ │ │ -0001afc0: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s or"FloatFie │ │ │ │ +0001aed0: 6c64 2671 756f 743b 3c2f 7370 616e 3e3c ld"< │ │ │ │ +0001aee0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0001aef0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0001af00: 2020 2020 2020 2020 2020 2020 3c73 7061 &qu │ │ │ │ +0001af20: 6f74 3b49 6e74 6567 6572 4669 656c 6426 ot;IntegerField& │ │ │ │ +0001af30: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;,. │ │ │ │ +0001af60: 2020 2020 203c 7370 616e 2063 6c61 7373 }. │ │ │ │ +0001af80: 2020 2020 2020 2020 2020 2020 2020 3c73 if │ │ │ │ +0001afa0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c lhs_type │ │ │ │ +0001afc0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c not rhs_type not │ │ │ │ -0001b020: 3c73 7061 6e20 636c 6173 733d 226f 7722 in allow │ │ │ │ -0001b050: 6564 5f66 6965 6c64 733c 2f73 7061 6e3e ed_fields │ │ │ │ -0001b060: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001b070: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -0001b080: 2020 2020 2020 2020 2020 2020 203c 7370 rai │ │ │ │ -0001b0a0: 7365 3c2f 7370 616e 3e20 3c73 7061 6e20 se Databa │ │ │ │ -0001b0c0: 7365 4572 726f 723c 2f73 7061 6e3e 3c73 seError(< │ │ │ │ -0001b0e0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0001b0f0: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ -0001b100: 7370 616e 2063 6c61 7373 3d22 7361 223e span class="sa"> │ │ │ │ -0001b110: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f"I │ │ │ │ -0001b130: 6e76 616c 6964 2061 7267 756d 656e 7473 nvalid arguments │ │ │ │ -0001b140: 2066 6f72 206f 7065 7261 746f 7220 3c2f for operator {s │ │ │ │ -0001b180: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.connector}.&qu │ │ │ │ -0001b1f0: 6f74 3b3c 2f73 7061 6e3e 0a20 2020 2020 ot;. │ │ │ │ -0001b200: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ -0001b210: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0001b220: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0001b230: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0001b240: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return sq │ │ │ │ -0001b260: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l, │ │ │ │ -0001b280: 203c 7370 616e 2063 6c61 7373 3d22 6e22 params.. │ │ │ │ -0001b2a0: 0a3c 7370 616e 2063 6c61 7373 3d22 6b22 .class T │ │ │ │ -0001b2d0: 656d 706f 7261 6c53 7562 7472 6163 7469 emporalSubtracti │ │ │ │ -0001b2e0: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(CombinedExpress │ │ │ │ -0001b320: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion):. output_f │ │ │ │ -0001b360: 6965 6c64 3c2f 7370 616e 3e20 3c73 7061 ield = fields.Durati │ │ │ │ -0001b3d0: 6f6e 4669 656c 643c 2f73 7061 6e3e 3c73 onField() │ │ │ │ -0001b3f0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -0001b410: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c __init_ │ │ │ │ -0001b430: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c _( │ │ │ │ -0001b450: 3c73 7061 6e20 636c 6173 733d 2262 7022 self, lhs< │ │ │ │ -0001b4a0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0001b4b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c rhs):. │ │ │ │ -0001b4f0: 2020 2020 3c73 7061 6e20 636c 6173 733d super().__init__(lhs, se │ │ │ │ -0001b5c0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.SUB, rhs)< │ │ │ │ -0001b640: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ -0001b660: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> as_sql(se │ │ │ │ -0001b6b0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, compiler, connec │ │ │ │ -0001b720: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion):. con │ │ │ │ -0001b760: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection.< │ │ │ │ -0001b780: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>ops │ │ │ │ -0001b7a0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001b7b0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .check_ex │ │ │ │ -0001b7d0: 7072 6573 7369 6f6e 5f73 7570 706f 7274 pression_support │ │ │ │ -0001b7e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -0001b800: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -0001b810: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self). lhs< │ │ │ │ -0001b850: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -0001b870: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001b880: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ -0001b890: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0001b8a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 compile(se │ │ │ │ -0001b8f0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.lhs). rhs< │ │ │ │ -0001b960: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -0001b980: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001b990: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ -0001b9a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0001b9b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 compile(se │ │ │ │ -0001ba00: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.rhs). retu │ │ │ │ -0001ba70: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn connec │ │ │ │ -0001ba90: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion.ops.subtract_te │ │ │ │ -0001bb00: 6d70 6f72 616c 733c 2f73 7061 6e3e 3c73 mporals(< │ │ │ │ -0001bb20: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0001bb30: 2020 203c 7370 616e 2063 6c61 7373 3d22 self< │ │ │ │ -0001bb50: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0001bb60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 lhs.output_ │ │ │ │ -0001bbb0: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field.get_internal │ │ │ │ -0001bbf0: 5f74 7970 653c 2f73 7061 6e3e 3c73 7061 _type(),< │ │ │ │ -0001bc10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> lhs, rhs. )...
.[docs].@ │ │ │ │ -0001bd30: 6465 636f 6e73 7472 7563 7469 626c 653c deconstructible< │ │ │ │ -0001bd40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(pa │ │ │ │ -0001bd70: 7468 3c2f 7370 616e 3e3c 7370 616e 2063 th="django.d │ │ │ │ -0001bdb0: 622e 6d6f 6465 6c73 2e46 2671 756f 743b b.models.F" │ │ │ │ -0001bdc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -0001bde0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0001bdf0: 636c 6173 733c 2f73 7061 6e3e 203c 7370 class F< │ │ │ │ -0001be10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(Co │ │ │ │ -0001be40: 6d62 696e 6162 6c65 3c2f 7370 616e 3e3c mbinable< │ │ │ │ -0001be50: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0001be60: 3a3c 2f73 7061 6e3e 0a3c 7370 616e 2063 :. "" │ │ │ │ -0001bea0: 3b26 7175 6f74 3b41 6e20 6f62 6a65 6374 ;"An object │ │ │ │ -0001beb0: 2063 6170 6162 6c65 206f 6620 7265 736f capable of reso │ │ │ │ -0001bec0: 6c76 696e 6720 7265 6665 7265 6e63 6573 lving references │ │ │ │ -0001bed0: 2074 6f20 6578 6973 7469 6e67 2071 7565 to existing que │ │ │ │ -0001bee0: 7279 206f 626a 6563 7473 2e26 7175 6f74 ry objects." │ │ │ │ -0001bef0: 3b26 7175 6f74 3b26 7175 6f74 3b3c 2f73 ;"".. def __init__(se │ │ │ │ -0001bf70: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, name):< │ │ │ │ -0001bfc0: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61 /span>. < │ │ │ │ -0001bfe0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"&qu │ │ │ │ -0001c000: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e ot;" │ │ │ │ -0001c010: 0a3c 7370 616e 2063 6c61 7373 3d22 7364 . Argume │ │ │ │ -0001c030: 6e74 733a 3c2f 7370 616e 3e0a 3c73 7061 nts:. │ │ │ │ -0001c050: 2020 2020 2020 2a20 6e61 6d65 3a20 7468 * name: th │ │ │ │ -0001c060: 6520 6e61 6d65 206f 6620 7468 6520 6669 e name of the fi │ │ │ │ -0001c070: 656c 6420 7468 6973 2065 7870 7265 7373 eld this express │ │ │ │ -0001c080: 696f 6e20 7265 6665 7265 6e63 6573 3c2f ion references. & │ │ │ │ -0001c0b0: 7175 6f74 3b26 7175 6f74 3b26 7175 6f74 quot;"" │ │ │ │ -0001c0c0: 3b3c 2f73 7061 6e3e 0a20 2020 2020 2020 ;. │ │ │ │ -0001c0d0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.name │ │ │ │ -0001c120: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = name.. def __repr__< │ │ │ │ -0001c190: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -0001c1c0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. retu │ │ │ │ -0001c200: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn " │ │ │ │ -0001c220: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;{}({})".form │ │ │ │ -0001c2c0: 6174 3c2f 7370 616e 3e3c 7370 616e 2063 at(self.__class__< │ │ │ │ -0001c330: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ -0001c360: 5f6e 616d 655f 5f3c 2f73 7061 6e3e 3c73 _name__,< │ │ │ │ -0001c380: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.name< │ │ │ │ -0001c3d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).. │ │ │ │ -0001c3f0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -0001c410: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ -0001c420: 7265 736f 6c76 655f 6578 7072 6573 7369 resolve_expressi │ │ │ │ -0001c430: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(. self< │ │ │ │ -0001c470: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0001c490: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ -0001c4a0: 7565 7279 3c2f 7370 616e 3e3c 7370 616e uery=None< │ │ │ │ -0001c4e0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0001c4f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c allow_jo │ │ │ │ -0001c510: 696e 733c 2f73 7061 6e3e 3c73 7061 6e20 ins=True,< │ │ │ │ -0001c560: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> reuse=None │ │ │ │ -0001c5b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0001c5d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001c5e0: 7375 6d6d 6172 697a 653c 2f73 7061 6e3e summarize │ │ │ │ -0001c5f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001c600: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =False, fo │ │ │ │ -0001c650: 725f 7361 7665 3c2f 7370 616e 3e3c 7370 r_save=False. ): │ │ │ │ -0001c6b0: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -0001c6d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> query.resol │ │ │ │ -0001c720: 7665 5f72 6566 3c2f 7370 616e 3e3c 7370 ve_ref(self.name, all │ │ │ │ -0001c7c0: 6f77 5f6a 6f69 6e73 3c2f 7370 616e 3e3c ow_joins< │ │ │ │ -0001c7d0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0001c7e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c reuse, sum │ │ │ │ -0001c830: 6d61 7269 7a65 3c2f 7370 616e 3e3c 7370 marize).. def replace_e │ │ │ │ -0001c890: 7870 7265 7373 696f 6e73 3c2f 7370 616e xpressions(self, re │ │ │ │ -0001c900: 706c 6163 656d 656e 7473 3c2f 7370 616e placements):. │ │ │ │ -0001c930: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ -0001c950: 203c 7370 616e 2063 6c61 7373 3d22 6e22 replacements.get< │ │ │ │ -0001c9a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -0001c9d0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, self< │ │ │ │ -0001ca10: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0001ca20: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -0001ca40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c asc(self │ │ │ │ -0001ca90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0001cab0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001cac0: 2a2a 3c2f 7370 616e 3e3c 7370 616e 2063 **kwargs< │ │ │ │ -0001cae0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -0001cb00: 2020 2020 2020 2020 3c73 7061 6e20 636c return OrderBy(sel │ │ │ │ -0001cb70: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ -0001cb90: 203c 7370 616e 2063 6c61 7373 3d22 6f22 **kwargs │ │ │ │ -0001cbc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -0001cbe0: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ -0001cc00: 3c73 7061 6e20 636c 6173 733d 226e 6622 desc(self │ │ │ │ -0001cc50: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001cc60: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , **kwargs< │ │ │ │ -0001cca0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0001ccb0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -0001ccc0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -0001cce0: 7370 616e 2063 6c61 7373 3d22 6e22 3e4f span class="n">O │ │ │ │ -0001ccf0: 7264 6572 4279 3c2f 7370 616e 3e3c 7370 rderBy(self, descen │ │ │ │ -0001cd60: 6469 6e67 3c2f 7370 616e 3e3c 7370 616e ding=True< │ │ │ │ -0001cda0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0001cdb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c **kwargs)< │ │ │ │ -0001ce00: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ -0001ce20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> __eq__(se │ │ │ │ -0001ce70: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, other): │ │ │ │ -0001cec0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0001ced0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0001cee0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return s │ │ │ │ -0001cf00: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.__class__ == ot │ │ │ │ -0001cf70: 6865 723c 2f73 7061 6e3e 3c73 7061 6e20 her.__class__ and │ │ │ │ -0001cfd0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.name │ │ │ │ -0001d020: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001d030: 3d3d 3c2f 7370 616e 3e20 3c73 7061 6e20 == other< │ │ │ │ -0001d050: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.na │ │ │ │ -0001d080: 6d65 3c2f 7370 616e 3e0a 0a20 2020 203c me.. < │ │ │ │ -0001d090: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -0001d0a0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef __has │ │ │ │ -0001d0c0: 685f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 h__(self): │ │ │ │ -0001d110: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0001d120: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0001d130: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return h │ │ │ │ -0001d150: 6173 683c 2f73 7061 6e3e 3c73 7061 6e20 ash(self.< │ │ │ │ -0001d1a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>name).. < │ │ │ │ -0001d1e0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -0001d1f0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef copy< │ │ │ │ -0001d210: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -0001d240: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. retu │ │ │ │ -0001d280: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn copy.cop │ │ │ │ -0001d2d0: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y( │ │ │ │ -0001d2f0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self)
....cl │ │ │ │ -0001d340: 6173 733c 2f73 7061 6e3e 203c 7370 616e ass Reso │ │ │ │ -0001d360: 6c76 6564 4f75 7465 7252 6566 3c2f 7370 lvedOuterRef
(F):. │ │ │ │ -0001d3d0: 203c 2f73 7061 6e3e 3c73 7061 6e20 636c "& │ │ │ │ -0001d3f0: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;". An objec │ │ │ │ -0001d420: 7420 7468 6174 2063 6f6e 7461 696e 7320 t that contains │ │ │ │ -0001d430: 6120 7265 6665 7265 6e63 6520 746f 2061 a reference to a │ │ │ │ -0001d440: 6e20 6f75 7465 7220 7175 6572 792e 3c2f n outer query... In t │ │ │ │ -0001d470: 6869 7320 6361 7365 2c20 7468 6520 7265 his case, the re │ │ │ │ -0001d480: 6665 7265 6e63 6520 746f 2074 6865 206f ference to the o │ │ │ │ -0001d490: 7574 6572 2071 7565 7279 2068 6173 2062 uter query has b │ │ │ │ -0001d4a0: 6565 6e20 7265 736f 6c76 6564 2062 6563 een resolved bec │ │ │ │ -0001d4b0: 6175 7365 3c2f 7370 616e 3e0a 3c73 7061 ause. │ │ │ │ -0001d4d0: 2074 6865 2069 6e6e 6572 2071 7565 7279 the inner query │ │ │ │ -0001d4e0: 2068 6173 2062 6565 6e20 7573 6564 2061 has been used a │ │ │ │ -0001d4f0: 7320 6120 7375 6271 7565 7279 2e3c 2f73 s a subquery.. " │ │ │ │ -0001d520: 2671 756f 743b 2671 756f 743b 3c2f 7370 "".. contain │ │ │ │ -0001d550: 735f 6167 6772 6567 6174 653c 2f73 7061 s_aggregate = Fal │ │ │ │ -0001d590: 7365 3c2f 7370 616e 3e0a 2020 2020 3c73 se. co │ │ │ │ -0001d5b0: 6e74 6169 6e73 5f6f 7665 725f 636c 6175 ntains_over_clau │ │ │ │ -0001d5c0: 7365 3c2f 7370 616e 3e20 3c73 7061 6e20 se = False │ │ │ │ -0001d600: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -0001d620: 203c 7370 616e 2063 6c61 7373 3d22 6e66 as_sql< │ │ │ │ -0001d640: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0001d650: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, *args< │ │ │ │ -0001d6c0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0001d6d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c **kwargs): │ │ │ │ -0001d720: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0001d730: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0001d740: 7261 6973 653c 2f73 7061 6e3e 203c 7370 raise Va │ │ │ │ -0001d760: 6c75 6545 7272 6f72 3c2f 7370 616e 3e3c lueError< │ │ │ │ -0001d770: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0001d780: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0001d790: 2020 2020 3c73 7061 6e20 636c 6173 733d "This │ │ │ │ -0001d7b0: 7175 6572 7973 6574 2063 6f6e 7461 696e queryset contain │ │ │ │ -0001d7c0: 7320 6120 7265 6665 7265 6e63 6520 746f s a reference to │ │ │ │ -0001d7d0: 2061 6e20 6f75 7465 7220 7175 6572 7920 an outer query │ │ │ │ -0001d7e0: 616e 6420 6d61 7920 2671 756f 743b 3c2f and may ". │ │ │ │ -0001d800: 2020 3c73 7061 6e20 636c 6173 733d 2273 "only be │ │ │ │ -0001d820: 2075 7365 6420 696e 2061 2073 7562 7175 used in a subqu │ │ │ │ -0001d830: 6572 792e 2671 756f 743b 3c2f 7370 616e ery.". ).. def resolve_expr │ │ │ │ -0001d8a0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession(self, *args, **< │ │ │ │ -0001d960: 7370 616e 2063 6c61 7373 3d22 6e22 3e6b span class="n">k │ │ │ │ -0001d970: 7761 7267 733c 2f73 7061 6e3e 3c73 7061 wargs):. co │ │ │ │ -0001d9b0: 6c3c 2f73 7061 6e3e 203c 7370 616e 2063 l = super< │ │ │ │ -0001d9f0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0001da00: 293c 2f73 7061 6e3e 3c73 7061 6e20 636c ). │ │ │ │ -0001da20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001da30: 7265 736f 6c76 655f 6578 7072 6573 7369 resolve_expressi │ │ │ │ -0001da40: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(*args, **< │ │ │ │ -0001dac0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>kwargs). │ │ │ │ -0001db00: 2020 2020 3c73 7061 6e20 636c 6173 733d if co │ │ │ │ -0001db30: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l. │ │ │ │ -0001db50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001db60: 636f 6e74 6169 6e73 5f6f 7665 725f 636c contains_over_cl │ │ │ │ -0001db70: 6175 7365 3c2f 7370 616e 3e3c 7370 616e ause:. │ │ │ │ -0001dba0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0001dbb0: 7261 6973 653c 2f73 7061 6e3e 203c 7370 raise Not │ │ │ │ -0001dbd0: 5375 7070 6f72 7465 6445 7272 6f72 3c2f SupportedError(. │ │ │ │ -0001dc00: 2020 2020 2020 2020 2020 2020 2020 3c73 f │ │ │ │ -0001dc20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 "Re │ │ │ │ -0001dc40: 6665 7265 6e63 696e 6720 6f75 7465 7220 ferencing outer │ │ │ │ -0001dc50: 7175 6572 7920 7769 6e64 6f77 2065 7870 query window exp │ │ │ │ -0001dc60: 7265 7373 696f 6e20 6973 206e 6f74 2073 ression is not s │ │ │ │ -0001dc70: 7570 706f 7274 6564 3a20 2671 756f 743b upported: " │ │ │ │ -0001dc80: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0001dc90: 2020 2020 2020 2020 3c73 7061 6e20 636c f"< │ │ │ │ -0001dcd0: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -0001dce0: 7b3c 2f73 7061 6e3e 3c73 7061 6e20 636c {self.name │ │ │ │ -0001dd30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 } │ │ │ │ -0001dd50: 3c73 7061 6e20 636c 6173 733d 2273 3222 .". │ │ │ │ -0001dd70: 2020 2020 2020 2020 2020 2020 3c73 7061 ). # │ │ │ │ -0001ddb0: 4649 584d 453a 2052 656e 616d 6520 706f FIXME: Rename po │ │ │ │ -0001ddc0: 7373 6962 6c79 5f6d 756c 7469 7661 6c75 ssibly_multivalu │ │ │ │ -0001ddd0: 6564 2074 6f20 6d75 6c74 6976 616c 7565 ed to multivalue │ │ │ │ -0001dde0: 6420 616e 6420 6669 7820 6465 7465 6374 d and fix detect │ │ │ │ -0001ddf0: 696f 6e3c 2f73 7061 6e3e 0a20 2020 2020 ion. │ │ │ │ -0001de00: 2020 203c 7370 616e 2063 6c61 7373 3d22 # for non-mu │ │ │ │ -0001de20: 6c74 6976 616c 7565 6420 4a4f 494e 7320 ltivalued JOINs │ │ │ │ -0001de30: 2865 2e67 2e20 666f 7265 6967 6e20 6b65 (e.g. foreign ke │ │ │ │ -0001de40: 7920 6669 656c 6473 292e 2054 6869 7320 y fields). This │ │ │ │ -0001de50: 7368 6f75 6c64 2074 616b 653c 2f73 7061 should take. # in │ │ │ │ -0001de80: 746f 2061 6363 6f75 6e74 c2a0 6f6e 6c79 to account..only │ │ │ │ -0001de90: 206d 616e 792d 746f 2d6d 616e 7920 616e many-to-many an │ │ │ │ -0001dea0: 6420 6f6e 652d 746f 2d6d 616e 7920 7265 d one-to-many re │ │ │ │ -0001deb0: 6c61 7469 6f6e 7368 6970 732e 3c2f 7370 lationships.in < │ │ │ │ +0001b000: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +0001b010: 6c6c 6f77 6564 5f66 6965 6c64 733c 2f73 llowed_fields or │ │ │ │ +0001b040: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001b050: 7268 735f 7479 7065 3c2f 7370 616e 3e20 rhs_type │ │ │ │ +0001b060: 3c73 7061 6e20 636c 6173 733d 226f 7722 not in< │ │ │ │ +0001b090: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> allowed_f │ │ │ │ +0001b0b0: 6965 6c64 733c 2f73 7061 6e3e 3c73 7061 ields:. │ │ │ │ +0001b0e0: 2020 2020 2020 2020 203c 7370 616e 2063 raise DatabaseEr │ │ │ │ +0001b120: 726f 723c 2f73 7061 6e3e 3c73 7061 6e20 ror(. │ │ │ │ +0001b150: 2020 2020 2020 2020 2020 203c 7370 616e f"Inval │ │ │ │ +0001b190: 6964 2061 7267 756d 656e 7473 2066 6f72 id arguments for │ │ │ │ +0001b1a0: 206f 7065 7261 746f 7220 3c2f 7370 616e operator {self< │ │ │ │ +0001b1e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ +0001b210: 6e6e 6563 746f 723c 2f73 7061 6e3e 3c73 nnector} │ │ │ │ +0001b230: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ."< │ │ │ │ +0001b250: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0001b260: 2020 2020 2020 2020 2020 203c 7370 616e ). retu │ │ │ │ +0001b2a0: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn sql, par │ │ │ │ +0001b2f0: 616d 733c 2f73 7061 6e3e 0a0a 0a3c 7370 ams...cla │ │ │ │ +0001b310: 7373 3c2f 7370 616e 3e20 3c73 7061 6e20 ss Tempo │ │ │ │ +0001b330: 7261 6c53 7562 7472 6163 7469 6f6e 3c2f ralSubtraction(Com │ │ │ │ +0001b370: 6269 6e65 6445 7870 7265 7373 696f 6e3c binedExpression< │ │ │ │ +0001b380: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ +0001b3a0: 2020 2020 3c73 7061 6e20 636c 6173 733d output_field │ │ │ │ +0001b3c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +0001b3e0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ +0001b410: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DurationFi │ │ │ │ +0001b430: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld().. def __init__(sel │ │ │ │ +0001b4c0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ +0001b4e0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 lhs, rhs): │ │ │ │ +0001b540: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0001b550: 3c73 7061 6e20 636c 6173 733d 226e 6222 super()< │ │ │ │ +0001b580: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ +0001b5b0: 5f69 6e69 745f 5f3c 2f73 7061 6e3e 3c73 _init__(< │ │ │ │ +0001b5d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>lhs │ │ │ │ +0001b5f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001b600: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , self.SUB │ │ │ │ +0001b650: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +0001b670: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001b680: 7268 733c 2f73 7061 6e3e 3c73 7061 6e20 rhs).. def as_sql(self, co │ │ │ │ +0001b740: 6d70 696c 6572 3c2f 7370 616e 3e3c 7370 mpiler, connection │ │ │ │ +0001b780: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +0001b7a0: 0a20 2020 2020 2020 203c 7370 616e 2063 . connect │ │ │ │ +0001b7c0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion.ops.check_expres │ │ │ │ +0001b830: 7369 6f6e 5f73 7570 706f 7274 3c2f 7370 sion_support(self │ │ │ │ +0001b870: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +0001b890: 2020 2020 2020 2020 3c73 7061 6e20 636c lhs = comp │ │ │ │ +0001b8e0: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler.compile(self.lhs │ │ │ │ +0001b980: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +0001b9a0: 2020 2020 2020 2020 3c73 7061 6e20 636c rhs = comp │ │ │ │ +0001b9f0: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler.compile(self.rhs │ │ │ │ +0001ba90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +0001bab0: 2020 2020 2020 2020 3c73 7061 6e20 636c return connection │ │ │ │ +0001baf0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0001bb10: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +0001bb20: 7073 3c2f 7370 616e 3e3c 7370 616e 2063 ps.subtract_tempor │ │ │ │ +0001bb60: 616c 733c 2f73 7061 6e3e 3c73 7061 6e20 als(. < │ │ │ │ +0001bb90: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0001bba0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.lhs.output_fiel │ │ │ │ +0001bc10: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d. │ │ │ │ +0001bc30: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001bc40: 6765 745f 696e 7465 726e 616c 5f74 7970 get_internal_typ │ │ │ │ +0001bc50: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e(), lhs, rhs │ │ │ │ +0001bcc0: 0a20 2020 2020 2020 203c 7370 616e 2063 . )...
.[ │ │ │ │ +0001bd70: 646f 6375 6d65 6e74 695d 3c2f 613e 0a3c documenti].< │ │ │ │ +0001bd80: 7370 616e 2063 6c61 7373 3d22 6e64 223e span class="nd"> │ │ │ │ +0001bd90: 4064 6563 6f6e 7374 7275 6374 6962 6c65 @deconstructible │ │ │ │ +0001bda0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0001bdc0: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ +0001bdd0: 6174 683c 2f73 7061 6e3e 3c73 7061 6e20 ath="django. │ │ │ │ +0001be10: 6462 2e6d 6f64 656c 732e 4626 7175 6f74 db.models.F" │ │ │ │ +0001be20: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;) │ │ │ │ +0001be40: 0a3c 7370 616e 2063 6c61 7373 3d22 6b22 .class F │ │ │ │ +0001be70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0001be90: 7370 616e 2063 6c61 7373 3d22 6e22 3e43 span class="n">C │ │ │ │ +0001bea0: 6f6d 6269 6e61 626c 653c 2f73 7061 6e3e ombinable │ │ │ │ +0001beb0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001bec0: 293a 3c2f 7370 616e 3e0a 3c73 7061 6e20 ):. "&quo │ │ │ │ +0001bf00: 743b 2671 756f 743b 416e 206f 626a 6563 t;"An objec │ │ │ │ +0001bf10: 7420 6361 7061 626c 6520 6f66 2072 6573 t capable of res │ │ │ │ +0001bf20: 6f6c 7669 6e67 2072 6566 6572 656e 6365 olving reference │ │ │ │ +0001bf30: 7320 746f 2065 7869 7374 696e 6720 7175 s to existing qu │ │ │ │ +0001bf40: 6572 7920 6f62 6a65 6374 732e 2671 756f ery objects.&quo │ │ │ │ +0001bf50: 743b 2671 756f 743b 2671 756f 743b 3c2f t;"".. def __init__< │ │ │ │ +0001bfa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0001bfd0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, name): │ │ │ │ +0001c020: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c . │ │ │ │ +0001c040: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 "&q │ │ │ │ +0001c060: 756f 743b 2671 756f 743b 3c2f 7370 616e uot;". Argum │ │ │ │ +0001c090: 656e 7473 3a3c 2f73 7061 6e3e 0a3c 7370 ents:. │ │ │ │ +0001c0b0: 2020 2020 2020 202a 206e 616d 653a 2074 * name: t │ │ │ │ +0001c0c0: 6865 206e 616d 6520 6f66 2074 6865 2066 he name of the f │ │ │ │ +0001c0d0: 6965 6c64 2074 6869 7320 6578 7072 6573 ield this expres │ │ │ │ +0001c0e0: 7369 6f6e 2072 6566 6572 656e 6365 733c sion references< │ │ │ │ +0001c0f0: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61 /span>. │ │ │ │ +0001c110: 2671 756f 743b 2671 756f 743b 2671 756f ""&quo │ │ │ │ +0001c120: 743b 3c2f 7370 616e 3e0a 2020 2020 2020 t;. │ │ │ │ +0001c130: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ +0001c160: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>name = name< │ │ │ │ +0001c1b0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ +0001c1d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> __repr__ │ │ │ │ +0001c1f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0001c210: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0001c220: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. ret │ │ │ │ +0001c260: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn &quo │ │ │ │ +0001c280: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;{}({}< │ │ │ │ +0001c2d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>)".for │ │ │ │ +0001c320: 6d61 743c 2f73 7061 6e3e 3c73 7061 6e20 mat(self.< │ │ │ │ +0001c370: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>__class__ │ │ │ │ +0001c390: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0001c3b0: 7370 616e 2063 6c61 7373 3d22 766d 223e span class="vm"> │ │ │ │ +0001c3c0: 5f5f 6e61 6d65 5f5f 3c2f 7370 616e 3e3c __name__< │ │ │ │ +0001c3d0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0001c3e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.name │ │ │ │ +0001c430: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +0001c450: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ +0001c470: 3c73 7061 6e20 636c 6173 733d 226e 6622 resolve_express │ │ │ │ +0001c490: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion(. self │ │ │ │ +0001c4d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +0001c4f0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001c500: 7175 6572 793c 2f73 7061 6e3e 3c73 7061 query=None │ │ │ │ +0001c540: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001c550: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , allow_j │ │ │ │ +0001c570: 6f69 6e73 3c2f 7370 616e 3e3c 7370 616e oins=True< │ │ │ │ +0001c5b0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0001c5c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c reuse=Non │ │ │ │ +0001c610: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ +0001c630: 203c 7370 616e 2063 6c61 7373 3d22 6e22 summarize=False< │ │ │ │ +0001c680: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0001c6a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +0001c6b0: 6f72 5f73 6176 653c 2f73 7061 6e3e 3c73 or_save=< │ │ │ │ +0001c6d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>False. ):. return │ │ │ │ +0001c730: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c query.reso │ │ │ │ +0001c780: 6c76 655f 7265 663c 2f73 7061 6e3e 3c73 lve_ref(< │ │ │ │ +0001c7a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.name, al │ │ │ │ +0001c820: 6c6f 775f 6a6f 696e 733c 2f73 7061 6e3e low_joins │ │ │ │ +0001c830: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001c840: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , reuse, su │ │ │ │ +0001c890: 6d6d 6172 697a 653c 2f73 7061 6e3e 3c73 mmarize)< │ │ │ │ +0001c8b0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ +0001c8d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> replace_ │ │ │ │ +0001c8f0: 6578 7072 6573 7369 6f6e 733c 2f73 7061 expressions(self< │ │ │ │ +0001c930: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0001c950: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ +0001c960: 6570 6c61 6365 6d65 6e74 733c 2f73 7061 eplacements):. │ │ │ │ +0001c990: 2020 2020 3c73 7061 6e20 636c 6173 733d return replacements.get │ │ │ │ +0001ca00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0001ca20: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0001ca30: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self, self │ │ │ │ +0001ca70: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001ca80: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ).. de │ │ │ │ +0001caa0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f asc(sel │ │ │ │ +0001caf0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ +0001cb10: 203c 7370 616e 2063 6c61 7373 3d22 6f22 **kwargs │ │ │ │ +0001cb40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +0001cb60: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ +0001cb80: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> OrderBy(se │ │ │ │ +0001cbd0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, **kwarg │ │ │ │ +0001cc20: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s) │ │ │ │ +0001cc40: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ +0001cc60: 203c 7370 616e 2063 6c61 7373 3d22 6e66 desc(self, **kwargs │ │ │ │ +0001cd00: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001cd10: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +0001cd20: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ +0001cd40: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001cd50: 4f72 6465 7242 793c 2f73 7061 6e3e 3c73 OrderBy(< │ │ │ │ +0001cd70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self, desce │ │ │ │ +0001cdc0: 6e64 696e 673c 2f73 7061 6e3e 3c73 7061 nding=True │ │ │ │ +0001ce00: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001ce10: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , **kwargs< │ │ │ │ +0001ce50: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0001ce60: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +0001ce80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c __eq__< │ │ │ │ +0001cea0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0001ced0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, other< │ │ │ │ +0001cf10: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0001cf20: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0001cf30: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +0001cf50: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0001cf60: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.__class__ == < │ │ │ │ +0001cfc0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +0001cfd0: 7468 6572 3c2f 7370 616e 3e3c 7370 616e ther.__class__ and │ │ │ │ +0001d030: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.name │ │ │ │ +0001d080: 203c 7370 616e 2063 6c61 7373 3d22 6f22 == other │ │ │ │ +0001d0b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0001d0d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6e span class="n">n │ │ │ │ +0001d0e0: 616d 653c 2f73 7061 6e3e 0a0a 2020 2020 ame.. │ │ │ │ +0001d0f0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0001d100: 6465 663c 2f73 7061 6e3e 203c 7370 616e def __ha │ │ │ │ +0001d120: 7368 5f5f 3c2f 7370 616e 3e3c 7370 616e sh__(self< │ │ │ │ +0001d160: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0001d170: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0001d180: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +0001d1a0: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +0001d1b0: 6861 7368 3c2f 7370 616e 3e3c 7370 616e hash(self< │ │ │ │ +0001d1f0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0001d200: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 name).. │ │ │ │ +0001d240: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0001d250: 6465 663c 2f73 7061 6e3e 203c 7370 616e def copy │ │ │ │ +0001d270: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0001d290: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0001d2a0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. ret │ │ │ │ +0001d2e0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn copy< │ │ │ │ +0001d300: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ +0001d330: 7079 3c2f 7370 616e 3e3c 7370 616e 2063 py(self)
....< │ │ │ │ +0001d390: 7370 616e 2063 6c61 7373 3d22 6b22 3e63 span class="k">c │ │ │ │ +0001d3a0: 6c61 7373 3c2f 7370 616e 3e20 3c73 7061 lass
Res │ │ │ │ +0001d3c0: 6f6c 7665 644f 7574 6572 5265 663c 2f73 olvedOuterRef(F):. │ │ │ │ +0001d430: 2020 3c2f 7370 616e 3e3c 7370 616e 2063
" │ │ │ │ +0001d450: 2671 756f 743b 2671 756f 743b 3c2f 7370 "". An obje │ │ │ │ +0001d480: 6374 2074 6861 7420 636f 6e74 6169 6e73 ct that contains │ │ │ │ +0001d490: 2061 2072 6566 6572 656e 6365 2074 6f20 a reference to │ │ │ │ +0001d4a0: 616e 206f 7574 6572 2071 7565 7279 2e3c an outer query.< │ │ │ │ +0001d4b0: 2f73 7061 6e3e 0a0a 3c73 7061 6e20 636c /span>.. In │ │ │ │ +0001d4d0: 7468 6973 2063 6173 652c 2074 6865 2072 this case, the r │ │ │ │ +0001d4e0: 6566 6572 656e 6365 2074 6f20 7468 6520 eference to the │ │ │ │ +0001d4f0: 6f75 7465 7220 7175 6572 7920 6861 7320 outer query has │ │ │ │ +0001d500: 6265 656e 2072 6573 6f6c 7665 6420 6265 been resolved be │ │ │ │ +0001d510: 6361 7573 653c 2f73 7061 6e3e 0a3c 7370 cause. │ │ │ │ +0001d530: 2020 7468 6520 696e 6e65 7220 7175 6572 the inner quer │ │ │ │ +0001d540: 7920 6861 7320 6265 656e 2075 7365 6420 y has been used │ │ │ │ +0001d550: 6173 2061 2073 7562 7175 6572 792e 3c2f as a subquery.. " │ │ │ │ +0001d580: 3b26 7175 6f74 3b26 7175 6f74 3b3c 2f73 ;"".. contai │ │ │ │ +0001d5b0: 6e73 5f61 6767 7265 6761 7465 3c2f 7370 ns_aggregate = Fa │ │ │ │ +0001d5f0: 6c73 653c 2f73 7061 6e3e 0a20 2020 203c lse. < │ │ │ │ +0001d600: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0001d610: 6f6e 7461 696e 735f 6f76 6572 5f63 6c61 ontains_over_cla │ │ │ │ +0001d620: 7573 653c 2f73 7061 6e3e 203c 7370 616e use
= False.. def as_sql │ │ │ │ +0001d6a0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001d6b0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self, *args │ │ │ │ +0001d720: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001d730: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , **kwargs< │ │ │ │ +0001d770: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0001d780: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0001d790: 203c 7370 616e 2063 6c61 7373 3d22 6b22 raise V │ │ │ │ +0001d7c0: 616c 7565 4572 726f 723c 2f73 7061 6e3e alueError
│ │ │ │ +0001d7d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001d7e0: 283c 2f73 7061 6e3e 0a20 2020 2020 2020 (. │ │ │ │ +0001d7f0: 2020 2020 203c 7370 616e 2063 6c61 7373 "This │ │ │ │ +0001d810: 2071 7565 7279 7365 7420 636f 6e74 6169 queryset contai │ │ │ │ +0001d820: 6e73 2061 2072 6566 6572 656e 6365 2074 ns a reference t │ │ │ │ +0001d830: 6f20 616e 206f 7574 6572 2071 7565 7279 o an outer query │ │ │ │ +0001d840: 2061 6e64 206d 6179 2026 7175 6f74 3b3c and may "< │ │ │ │ +0001d850: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0001d860: 2020 203c 7370 616e 2063 6c61 7373 3d22 "only b │ │ │ │ +0001d880: 6520 7573 6564 2069 6e20 6120 7375 6271 e used in a subq │ │ │ │ +0001d890: 7565 7279 2e26 7175 6f74 3b3c 2f73 7061 uery.". ).. def resolve_exp │ │ │ │ +0001d900: 7265 7373 696f 6e3c 2f73 7061 6e3e 3c73 ression(< │ │ │ │ +0001d920: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self, *args,< │ │ │ │ +0001d9a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ** │ │ │ │ +0001d9c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001d9d0: 6b77 6172 6773 3c2f 7370 616e 3e3c 7370 kwargs):< │ │ │ │ +0001d9f0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0001da00: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0001da10: 6f6c 3c2f 7370 616e 3e20 3c73 7061 6e20 ol = super │ │ │ │ +0001da50: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001da60: 2829 3c2f 7370 616e 3e3c 7370 616e 2063 ().resolve_express │ │ │ │ +0001daa0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion(*args, ** │ │ │ │ +0001db20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 kwargs). │ │ │ │ +0001db60: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +0001db80: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0001db90: 6f6c 3c2f 7370 616e 3e3c 7370 616e 2063 ol.contains_over_c │ │ │ │ +0001dbd0: 6c61 7573 653c 2f73 7061 6e3e 3c73 7061 lause:. │ │ │ │ +0001dc00: 203c 7370 616e 2063 6c61 7373 3d22 6b22 raise No │ │ │ │ +0001dc30: 7453 7570 706f 7274 6564 4572 726f 723c tSupportedError< │ │ │ │ +0001dc40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(. │ │ │ │ +0001dc60: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +0001dc70: 7370 616e 2063 6c61 7373 3d22 7361 223e span class="sa"> │ │ │ │ +0001dc80: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f"R │ │ │ │ +0001dca0: 6566 6572 656e 6369 6e67 206f 7574 6572 eferencing outer │ │ │ │ +0001dcb0: 2071 7565 7279 2077 696e 646f 7720 6578 query window ex │ │ │ │ +0001dcc0: 7072 6573 7369 6f6e 2069 7320 6e6f 7420 pression is not │ │ │ │ +0001dcd0: 7375 7070 6f72 7465 643a 2026 7175 6f74 supported: " │ │ │ │ +0001dce0: 3b3c 2f73 7061 6e3e 0a20 2020 2020 2020 ;. │ │ │ │ +0001dcf0: 2020 2020 2020 2020 203c 7370 616e 2063 f" │ │ │ │ +0001dd30: 3c73 7061 6e20 636c 6173 733d 2273 6922 {self.nam │ │ │ │ +0001dd90: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e}." │ │ │ │ +0001ddd0: 0a20 2020 2020 2020 2020 2020 203c 7370 . ). # │ │ │ │ +0001de10: 2046 4958 4d45 3a20 5265 6e61 6d65 2070 FIXME: Rename p │ │ │ │ +0001de20: 6f73 7369 626c 795f 6d75 6c74 6976 616c ossibly_multival │ │ │ │ +0001de30: 7565 6420 746f 206d 756c 7469 7661 6c75 ued to multivalu │ │ │ │ +0001de40: 6564 2061 6e64 2066 6978 2064 6574 6563 ed and fix detec │ │ │ │ +0001de50: 7469 6f6e 3c2f 7370 616e 3e0a 2020 2020 tion. │ │ │ │ +0001de60: 2020 2020 3c73 7061 6e20 636c 6173 733d # for non-m │ │ │ │ +0001de80: 756c 7469 7661 6c75 6564 204a 4f49 4e73 ultivalued JOINs │ │ │ │ +0001de90: 2028 652e 672e 2066 6f72 6569 676e 206b (e.g. foreign k │ │ │ │ +0001dea0: 6579 2066 6965 6c64 7329 2e20 5468 6973 ey fields). This │ │ │ │ +0001deb0: 2073 686f 756c 6420 7461 6b65 3c2f 7370 should take. col< │ │ │ │ -0001dee0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.po │ │ │ │ -0001df10: 7373 6962 6c79 5f6d 756c 7469 7661 6c75 ssibly_multivalu │ │ │ │ -0001df20: 6564 3c2f 7370 616e 3e20 3c73 7061 6e20 ed = LOOKUP_SEP in │ │ │ │ -0001df80: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.name. │ │ │ │ -0001dfd0: 2020 2020 2020 2020 3c73 7061 6e20 636c return col │ │ │ │ -0001e010: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -0001e030: 203c 7370 616e 2063 6c61 7373 3d22 6e66 relabeled_clon │ │ │ │ -0001e050: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -0001e070: 3c73 7061 6e20 636c 6173 733d 2262 7022 self, relabels):. │ │ │ │ -0001e0e0: 2020 2020 2020 3c73 7061 6e20 636c 6173 return self │ │ │ │ -0001e120: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -0001e140: 203c 7370 616e 2063 6c61 7373 3d22 6e66 get_group_by_c │ │ │ │ -0001e160: 6f6c 733c 2f73 7061 6e3e 3c73 7061 6e20 ols(self): │ │ │ │ -0001e1b0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0001e1c0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0001e1d0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return [] │ │ │ │ -0001e1f0: 3c2f 7370 616e 3e0a 0a0a 3c64 6976 2063 ...
.[docs].cl │ │ │ │ -0001e2b0: 6173 733c 2f73 7061 6e3e 203c 7370 616e ass Oute │ │ │ │ -0001e2d0: 7252 6566 3c2f 7370 616e 3e3c 7370 616e rRef(F):. contain │ │ │ │ -0001e340: 735f 6167 6772 6567 6174 653c 2f73 7061 s_aggregate = Fal │ │ │ │ -0001e380: 7365 3c2f 7370 616e 3e0a 2020 2020 3c73 se. co │ │ │ │ -0001e3a0: 6e74 6169 6e73 5f6f 7665 725f 636c 6175 ntains_over_clau │ │ │ │ -0001e3b0: 7365 3c2f 7370 616e 3e20 3c73 7061 6e20 se = False │ │ │ │ -0001e3f0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -0001e410: 203c 7370 616e 2063 6c61 7373 3d22 6e66 resolve_expres │ │ │ │ -0001e430: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion(self< │ │ │ │ -0001e470: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0001e480: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c * │ │ │ │ -0001e4a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001e4b0: 6172 6773 3c2f 7370 616e 3e3c 7370 616e args, **kwa │ │ │ │ -0001e500: 7267 733c 2f73 7061 6e3e 3c73 7061 6e20 rgs):. if isinstanc │ │ │ │ -0001e560: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -0001e580: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.name< │ │ │ │ -0001e5d0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0001e5e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.__c │ │ │ │ -0001e630: 6c61 7373 5f5f 3c2f 7370 616e 3e3c 7370 lass__):< │ │ │ │ -0001e650: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0001e660: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ -0001e680: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.name │ │ │ │ -0001e6d0: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -0001e6f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ResolvedO │ │ │ │ -0001e710: 7574 6572 5265 663c 2f73 7061 6e3e 3c73 uterRef(< │ │ │ │ -0001e730: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.name).. │ │ │ │ -0001e7a0: 2020 203c 7370 616e 2063 6c61 7373 3d22 def r │ │ │ │ -0001e7d0: 656c 6162 656c 6564 5f63 6c6f 6e65 3c2f elabeled_clone(se │ │ │ │ -0001e810: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, relabels):. │ │ │ │ -0001e870: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ -0001e890: 203c 7370 616e 2063 6c61 7373 3d22 6270 self....
.[docs].@deconstruct │ │ │ │ -0001e970: 6962 6c65 3c2f 7370 616e 3e3c 7370 616e ible(path=< │ │ │ │ -0001e9c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"dja │ │ │ │ -0001e9e0: 6e67 6f2e 6462 2e6d 6f64 656c 732e 4675 ngo.db.models.Fu │ │ │ │ -0001e9f0: 6e63 2671 756f 743b 3c2f 7370 616e 3e3c nc"< │ │ │ │ -0001ea00: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0001ea10: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c .class Func(SQLiteN │ │ │ │ -0001ea80: 756d 6572 6963 4d69 7869 6e3c 2f73 7061 umericMixin, Expre │ │ │ │ -0001eac0: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion):. ""&q │ │ │ │ -0001eb20: 756f 743b 416e 2053 514c 2066 756e 6374 uot;An SQL funct │ │ │ │ -0001eb30: 696f 6e20 6361 6c6c 2e26 7175 6f74 3b26 ion call."& │ │ │ │ -0001eb40: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;".. function │ │ │ │ -0001eb70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -0001eb90: 203c 7370 616e 2063 6c61 7373 3d22 6b63 None. │ │ │ │ -0001ebb0: 2020 3c73 7061 6e20 636c 6173 733d 226e template = &quo │ │ │ │ -0001ec00: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;%(func │ │ │ │ -0001ec20: 7469 6f6e 2973 3c2f 7370 616e 3e3c 7370 tion)s(< │ │ │ │ -0001ec40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>%(express │ │ │ │ -0001ec60: 696f 6e73 2973 3c2f 7370 616e 3e3c 7370 ions)s)& │ │ │ │ -0001ec80: 7175 6f74 3b3c 2f73 7061 6e3e 0a20 2020 quot;. │ │ │ │ -0001ec90: 203c 7370 616e 2063 6c61 7373 3d22 6e22 arg_joiner = &qu │ │ │ │ -0001ece0: 6f74 3b2c 2026 7175 6f74 3b3c 2f73 7061 ot;, ". arity = No │ │ │ │ -0001ed40: 6e65 3c2f 7370 616e 3e20 203c 7370 616e ne # Th │ │ │ │ -0001ed60: 6520 6e75 6d62 6572 206f 6620 6172 6775 e number of argu │ │ │ │ -0001ed70: 6d65 6e74 7320 7468 6520 6675 6e63 7469 ments the functi │ │ │ │ -0001ed80: 6f6e 2061 6363 6570 7473 2e3c 2f73 7061 on accepts... def __init__(self │ │ │ │ -0001ee00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0001ee20: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001ee30: 2a3c 2f73 7061 6e3e 3c73 7061 6e20 636c *expressi │ │ │ │ -0001ee50: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20 ons, output_field< │ │ │ │ -0001ee90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=N │ │ │ │ -0001eec0: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one, **extr │ │ │ │ -0001ef10: 613c 2f73 7061 6e3e 3c73 7061 6e20 636c a):. if self │ │ │ │ -0001ef70: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001ef80: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .arity is │ │ │ │ -0001efc0: 3c73 7061 6e20 636c 6173 733d 226f 7722 not Non │ │ │ │ -0001eff0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e and len │ │ │ │ -0001f030: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001f040: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (expressi │ │ │ │ -0001f060: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20 ons) != se │ │ │ │ -0001f0b0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.arity:. │ │ │ │ -0001f110: 2020 3c73 7061 6e20 636c 6173 733d 226b raise < │ │ │ │ -0001f130: 7370 616e 2063 6c61 7373 3d22 6e65 223e span class="ne"> │ │ │ │ -0001f140: 5479 7065 4572 726f 723c 2f73 7061 6e3e TypeError │ │ │ │ -0001f150: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001f160: 283c 2f73 7061 6e3e 0a20 2020 2020 2020 (. │ │ │ │ -0001f170: 2020 2020 2020 2020 203c 7370 616e 2063 " │ │ │ │ -0001f190: 2623 3339 3b3c 2f73 7061 6e3e 3c73 7061 '%s< │ │ │ │ -0001f1b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>' tak │ │ │ │ -0001f1d0: 6573 2065 7861 6374 6c79 203c 2f73 7061 es exactly %s %s< │ │ │ │ -0001f230: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -0001f240: 2028 3c2f 7370 616e 3e3c 7370 616e 2063 (%s given)" │ │ │ │ -0001f280: 3b3c 2f73 7061 6e3e 0a20 2020 2020 2020 ;. │ │ │ │ -0001f290: 2020 2020 2020 2020 203c 7370 616e 2063 % (. │ │ │ │ -0001f2d0: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ -0001f2e0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -0001f2f0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.__class__.__n │ │ │ │ -0001f360: 616d 655f 5f3c 2f73 7061 6e3e 3c73 7061 ame__,. │ │ │ │ -0001f390: 2020 2020 2020 2020 203c 7370 616e 2063 self.ari │ │ │ │ -0001f3e0: 7479 3c2f 7370 616e 3e3c 7370 616e 2063 ty,. │ │ │ │ -0001f410: 2020 2020 2020 3c73 7061 6e20 636c 6173 "arg │ │ │ │ -0001f430: 756d 656e 7426 7175 6f74 3b3c 2f73 7061 ument" if se │ │ │ │ -0001f470: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.arity == │ │ │ │ +0001ded0: 6e20 636c 6173 733d 2263 3122 3e23 2069 n class="c1"># i │ │ │ │ +0001dee0: 6e74 6f20 6163 636f 756e 74c2 a06f 6e6c nto account..onl │ │ │ │ +0001def0: 7920 6d61 6e79 2d74 6f2d 6d61 6e79 2061 y many-to-many a │ │ │ │ +0001df00: 6e64 206f 6e65 2d74 6f2d 6d61 6e79 2072 nd one-to-many r │ │ │ │ +0001df10: 656c 6174 696f 6e73 6869 7073 2e3c 2f73 elationships.. col │ │ │ │ +0001df40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0001df60: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ +0001df70: 6f73 7369 626c 795f 6d75 6c74 6976 616c ossibly_multival │ │ │ │ +0001df80: 7565 643c 2f73 7061 6e3e 203c 7370 616e ued = LOOKUP_SEP in │ │ │ │ +0001dfe0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.name │ │ │ │ +0001e030: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ +0001e050: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> col.. def relabeled_clo │ │ │ │ +0001e0b0: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne(self, relabels):. │ │ │ │ +0001e140: 2020 2020 2020 203c 7370 616e 2063 6c61 return self.. def get_group_by_ │ │ │ │ +0001e1c0: 636f 6c73 3c2f 7370 616e 3e3c 7370 616e cols(self< │ │ │ │ +0001e200: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0001e210: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0001e220: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +0001e240: 7370 616e 2063 6c61 7373 3d22 7022 3e5b span class="p">[ │ │ │ │ +0001e250: 5d3c 2f73 7061 6e3e 0a0a 0a3c 6469 7620 ]...
.[documenti]< │ │ │ │ +0001e300: 2f61 3e0a 3c73 7061 6e20 636c 6173 733d /a>.class │ │ │ │ +0001e320: 203c 7370 616e 2063 6c61 7373 3d22 6e63 OuterRef(F):. < │ │ │ │ +0001e390: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0001e3a0: 6f6e 7461 696e 735f 6167 6772 6567 6174 ontains_aggregat │ │ │ │ +0001e3b0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = False. │ │ │ │ +0001e3f0: 2020 2020 3c73 7061 6e20 636c 6173 733d contains_ove │ │ │ │ +0001e410: 725f 636c 6175 7365 3c2f 7370 616e 3e20 r_clause │ │ │ │ +0001e420: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0001e430: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = False< │ │ │ │ +0001e450: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ +0001e470: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> resolve_ │ │ │ │ +0001e490: 6578 7072 6573 7369 6f6e 3c2f 7370 616e expression(self, *< │ │ │ │ +0001e500: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>args, **kwargs │ │ │ │ +0001e570: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001e580: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +0001e590: 2020 3c73 7061 6e20 636c 6173 733d 226b if isi │ │ │ │ +0001e5c0: 6e73 7461 6e63 653c 2f73 7061 6e3e 3c73 nstance(< │ │ │ │ +0001e5e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.name, s │ │ │ │ +0001e660: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.__class__):. │ │ │ │ +0001e6c0: 2020 2020 2020 2020 203c 7370 616e 2063 return< │ │ │ │ +0001e6e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.name< │ │ │ │ +0001e730: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0001e740: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +0001e750: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn Res │ │ │ │ +0001e770: 6f6c 7665 644f 7574 6572 5265 663c 2f73 olvedOuterRef(sel │ │ │ │ +0001e7b0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +0001e7d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0001e7e0: 6e61 6d65 3c2f 7370 616e 3e3c 7370 616e name).. def relabeled_c │ │ │ │ +0001e840: 6c6f 6e65 3c2f 7370 616e 3e3c 7370 616e lone(self< │ │ │ │ +0001e880: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0001e890: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c relabels │ │ │ │ +0001e8b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +0001e8d0: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ +0001e8f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self
.....[d │ │ │ │ +0001e9b0: 6f63 756d 656e 7469 5d3c 2f61 3e0a 3c73 ocumenti].@ │ │ │ │ +0001e9d0: 6465 636f 6e73 7472 7563 7469 626c 653c deconstructible< │ │ │ │ +0001e9e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(pa │ │ │ │ +0001ea10: 7468 3c2f 7370 616e 3e3c 7370 616e 2063 th="django.d │ │ │ │ +0001ea50: 622e 6d6f 6465 6c73 2e46 756e 6326 7175 b.models.Func&qu │ │ │ │ +0001ea60: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;).class │ │ │ │ +0001eaa0: 3c73 7061 6e20 636c 6173 733d 226e 6322 Func(SQLiteNumeri │ │ │ │ +0001eaf0: 634d 6978 696e 3c2f 7370 616e 3e3c 7370 cMixin, Expression │ │ │ │ +0001eb30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +0001eb50: 0a3c 7370 616e 2063 6c61 7373 3d22 7722 . &qu │ │ │ │ +0001eb80: 6f74 3b26 7175 6f74 3b26 7175 6f74 3b41 ot;""A │ │ │ │ +0001eb90: 6e20 5351 4c20 6675 6e63 7469 6f6e 2063 n SQL function c │ │ │ │ +0001eba0: 616c 6c2e 2671 756f 743b 2671 756f 743b all."" │ │ │ │ +0001ebb0: 2671 756f 743b 3c2f 7370 616e 3e0a 0a20 ".. │ │ │ │ +0001ebc0: 2020 203c 7370 616e 2063 6c61 7373 3d22 function = Non │ │ │ │ +0001ec10: 653c 2f73 7061 6e3e 0a20 2020 203c 7370 e. tem │ │ │ │ +0001ec30: 706c 6174 653c 2f73 7061 6e3e 203c 7370 plate = "%(function) │ │ │ │ +0001ec90: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s(%(expressions) │ │ │ │ +0001ecd0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s)" │ │ │ │ +0001ecf0: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . arg_ │ │ │ │ +0001ed10: 6a6f 696e 6572 3c2f 7370 616e 3e20 3c73 joiner =< │ │ │ │ +0001ed30: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ", │ │ │ │ +0001ed50: 2671 756f 743b 3c2f 7370 616e 3e0a 2020 ". │ │ │ │ +0001ed60: 2020 3c73 7061 6e20 636c 6173 733d 226e arity < │ │ │ │ +0001ed80: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +0001ed90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c None # The num │ │ │ │ +0001edd0: 6265 7220 6f66 2061 7267 756d 656e 7473 ber of arguments │ │ │ │ +0001ede0: 2074 6865 2066 756e 6374 696f 6e20 6163 the function ac │ │ │ │ +0001edf0: 6365 7074 732e 3c2f 7370 616e 3e0a 0a20 cepts... │ │ │ │ +0001ee00: 2020 203c 7370 616e 2063 6c61 7373 3d22 def _ │ │ │ │ +0001ee30: 5f69 6e69 745f 5f3c 2f73 7061 6e3e 3c73 _init__(< │ │ │ │ +0001ee50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self, *expressions, ou │ │ │ │ +0001eef0: 7470 7574 5f66 6965 6c64 3c2f 7370 616e tput_field=None, ** │ │ │ │ +0001ef60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 extra):. │ │ │ │ +0001efa0: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +0001efc0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0001efd0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.arity │ │ │ │ +0001f010: 3c73 7061 6e20 636c 6173 733d 226f 7722 is not< │ │ │ │ +0001f040: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> None and │ │ │ │ +0001f080: 3c73 7061 6e20 636c 6173 733d 226e 6222 len(expressions) != │ │ │ │ +0001f100: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.arit │ │ │ │ +0001f150: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y: │ │ │ │ +0001f170: 0a20 2020 2020 2020 2020 2020 203c 7370 . rai │ │ │ │ +0001f190: 7365 3c2f 7370 616e 3e20 3c73 7061 6e20 se TypeE │ │ │ │ +0001f1b0: 7272 6f72 3c2f 7370 616e 3e3c 7370 616e rror(. │ │ │ │ +0001f1e0: 2020 2020 3c73 7061 6e20 636c 6173 733d "' │ │ │ │ +0001f200: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 %s' takes ex │ │ │ │ +0001f240: 6163 746c 7920 3c2f 7370 616e 3e3c 7370 actly %s │ │ │ │ +0001f260: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 │ │ │ │ +0001f280: 3c73 7061 6e20 636c 6173 733d 2273 6922 %s (%s │ │ │ │ +0001f2e0: 6769 7665 6e29 2671 756f 743b 3c2f 7370 given)". │ │ │ │ +0001f300: 2020 2020 3c73 7061 6e20 636c 6173 733d % (. │ │ │ │ +0001f340: 2020 2020 2020 2020 2020 3c73 7061 6e20 self< │ │ │ │ +0001f360: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ +0001f390: 5f63 6c61 7373 5f5f 3c2f 7370 616e 3e3c _class__< │ │ │ │ +0001f3a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0001f3b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __name__ │ │ │ │ +0001f3d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ,. │ │ │ │ +0001f3f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0001f400: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +0001f420: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0001f430: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .arity,. │ │ │ │ +0001f470: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0001f480: 203c 7370 616e 2063 6c61 7373 3d22 7332 "argument │ │ │ │ +0001f4a0: 2671 756f 743b 3c2f 7370 616e 3e20 3c73 " if │ │ │ │ 0001f4c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c 1 else & │ │ │ │ -0001f510: 7175 6f74 3b61 7267 756d 656e 7473 2671 quot;arguments&q │ │ │ │ -0001f520: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;,. │ │ │ │ -0001f550: 2020 2020 2020 2020 3c73 7061 6e20 636c len(expre │ │ │ │ -0001f5a0: 7373 696f 6e73 3c2f 7370 616e 3e3c 7370 ssions),< │ │ │ │ -0001f5c0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0001f5d0: 2020 2020 2020 203c 7370 616e 2063 6c61 ). │ │ │ │ -0001f5f0: 2020 2020 2020 2020 2020 2020 3c73 7061 ). su │ │ │ │ -0001f630: 7065 723c 2f73 7061 6e3e 3c73 7061 6e20 per().__in │ │ │ │ -0001f680: 6974 5f5f 3c2f 7370 616e 3e3c 7370 616e it__(output_field< │ │ │ │ -0001f6c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=ou │ │ │ │ -0001f6f0: 7470 7574 5f66 6965 6c64 3c2f 7370 616e tput_field). │ │ │ │ -0001f720: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ -0001f750: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>source_exp │ │ │ │ -0001f770: 7265 7373 696f 6e73 3c2f 7370 616e 3e20 ressions │ │ │ │ -0001f780: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001f790: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = self._pa │ │ │ │ -0001f7e0: 7273 655f 6578 7072 6573 7369 6f6e 733c rse_expressions< │ │ │ │ -0001f7f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(*< │ │ │ │ -0001f820: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>expression │ │ │ │ -0001f840: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s) │ │ │ │ -0001f860: 0a20 2020 2020 2020 203c 7370 616e 2063 . self.ext │ │ │ │ -0001f8b0: 7261 3c2f 7370 616e 3e20 3c73 7061 6e20 ra = extra. │ │ │ │ -0001f8f0: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ -0001f910: 3c73 7061 6e20 636c 6173 733d 2266 6d22 __repr__ │ │ │ │ -0001f930: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0001f940: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ -0001f980: 2020 2020 2020 3c73 7061 6e20 636c 6173 args = self │ │ │ │ -0001f9d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0001f9f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -0001fa00: 7267 5f6a 6f69 6e65 723c 2f73 7061 6e3e rg_joiner │ │ │ │ -0001fa10: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001fa20: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .join(str< │ │ │ │ -0001fa70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(ar │ │ │ │ -0001faa0: 673c 2f73 7061 6e3e 3c73 7061 6e20 636c g) │ │ │ │ -0001fac0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 for arg< │ │ │ │ -0001faf0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> in self.< │ │ │ │ -0001fb40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>source_exp │ │ │ │ -0001fb60: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c ressions< │ │ │ │ -0001fb70: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0001fb80: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0001fb90: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0001fba0: 6578 7472 613c 2f73 7061 6e3e 203c 7370 extra = {** │ │ │ │ -0001fbf0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.extra │ │ │ │ -0001fc40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0001fc60: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001fc70: 2a2a 3c2f 7370 616e 3e3c 7370 616e 2063 **self._ge │ │ │ │ -0001fcc0: 745f 7265 7072 5f6f 7074 696f 6e73 3c2f t_repr_options()}. │ │ │ │ -0001fcf0: 2020 2020 2020 2020 3c73 7061 6e20 636c if extra:< │ │ │ │ -0001fd40: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0001fd50: 2020 203c 7370 616e 2063 6c61 7373 3d22 extra │ │ │ │ -0001fd70: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001fd80: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = " │ │ │ │ -0001fda0: 2c20 2671 756f 743b 3c2f 7370 616e 3e3c , "< │ │ │ │ -0001fdb0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0001fdc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 join(. │ │ │ │ -0001fe00: 2020 2020 2020 2020 2020 203c 7370 616e str< │ │ │ │ -0001fe20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(ke │ │ │ │ -0001fe50: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y) │ │ │ │ -0001fe70: 203c 7370 616e 2063 6c61 7373 3d22 6f22 + " │ │ │ │ -0001fea0: 3b3d 2671 756f 743b 3c2f 7370 616e 3e20 ;=" │ │ │ │ -0001feb0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0001fec0: 2b3c 2f73 7061 6e3e 203c 7370 616e 2063 + str(val< │ │ │ │ -0001ff10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>) < │ │ │ │ -0001ff30: 7370 616e 2063 6c61 7373 3d22 6b22 3e66 span class="k">f │ │ │ │ -0001ff40: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or key, val │ │ │ │ -0001ff90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c in sorted(extra.ite │ │ │ │ -00020030: 6d73 3c2f 7370 616e 3e3c 7370 616e 2063 ms()). │ │ │ │ -00020060: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00020070: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -00020080: 2020 2020 203c 7370 616e 2063 6c61 7373 return "{}({}, │ │ │ │ -00020120: 203c 2f73 7061 6e3e 3c73 7061 6e20 636c {})".format< │ │ │ │ -00020190: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -000201c0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.__class__.__na │ │ │ │ -00020230: 6d65 5f5f 3c2f 7370 616e 3e3c 7370 616e me__, args< │ │ │ │ -00020270: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00020280: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c extra). │ │ │ │ -000202c0: 2020 2020 203c 7370 616e 2063 6c61 7373 return "{}({}) │ │ │ │ -00020360: 2671 756f 743b 3c2f 7370 616e 3e3c 7370 ".format(self< │ │ │ │ -000203d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ -00020400: 5f63 6c61 7373 5f5f 3c2f 7370 616e 3e3c _class__< │ │ │ │ -00020410: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00020420: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __name__ │ │ │ │ -00020440: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00020460: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00020470: 6172 6773 3c2f 7370 616e 3e3c 7370 616e args).. def _get_repr_o │ │ │ │ -000204d0: 7074 696f 6e73 3c2f 7370 616e 3e3c 7370 ptions(self):. │ │ │ │ -00020540: 2020 203c 2f73 7061 6e3e 3c73 7061 6e20 " │ │ │ │ -00020560: 3b26 7175 6f74 3b26 7175 6f74 3b52 6574 ;""Ret │ │ │ │ -00020570: 7572 6e20 6120 6469 6374 206f 6620 6578 urn a dict of ex │ │ │ │ -00020580: 7472 6120 5f5f 696e 6974 5f5f 2829 206f tra __init__() o │ │ │ │ -00020590: 7074 696f 6e73 2074 6f20 696e 636c 7564 ptions to includ │ │ │ │ -000205a0: 6520 696e 2074 6865 2072 6570 722e 2671 e in the repr.&q │ │ │ │ -000205b0: 756f 743b 2671 756f 743b 2671 756f 743b uot;"" │ │ │ │ -000205c0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000205d0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -000205e0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return {} │ │ │ │ -00020600: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -00020620: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c get_sou │ │ │ │ -00020640: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ -00020650: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -00020680: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. retu │ │ │ │ -000206c0: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn self< │ │ │ │ -000206e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.so │ │ │ │ -00020710: 7572 6365 5f65 7870 7265 7373 696f 6e73 urce_expressions │ │ │ │ -00020720: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -00020740: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c set_sou │ │ │ │ -00020760: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ -00020770: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -000207a0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, exprs< │ │ │ │ -000207e0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -000207f0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00020800: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.source_expr │ │ │ │ -00020850: 6573 7369 6f6e 733c 2f73 7061 6e3e 203c essions < │ │ │ │ -00020860: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00020870: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c exprs.. def resolve_ex │ │ │ │ -000208d0: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ -000208e0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -000208f0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00020900: 3c73 7061 6e20 636c 6173 733d 2262 7022 self, query=None, al │ │ │ │ -000209b0: 6c6f 775f 6a6f 696e 733c 2f73 7061 6e3e low_joins │ │ │ │ -000209c0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000209d0: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =True, reu │ │ │ │ -00020a20: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se=None, summarize< │ │ │ │ -00020a90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=F │ │ │ │ -00020ac0: 616c 7365 3c2f 7370 616e 3e3c 7370 616e alse, for_save=Fals │ │ │ │ -00020b30: 653c 2f73 7061 6e3e 0a20 2020 203c 7370 e. ):< │ │ │ │ -00020b50: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00020b60: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00020b70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -00020b90: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.copy │ │ │ │ -00020be0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00020bf0: 2829 3c2f 7370 616e 3e0a 2020 2020 2020 (). │ │ │ │ -00020c00: 2020 3c73 7061 6e20 636c 6173 733d 226e c.is_summary = sum │ │ │ │ -00020c80: 6d61 7269 7a65 3c2f 7370 616e 3e0a 2020 marize. │ │ │ │ -00020c90: 2020 2020 2020 3c73 7061 6e20 636c 6173 for │ │ │ │ -00020cb0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 pos, arg < │ │ │ │ -00020d00: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -00020d10: 696e 3c2f 7370 616e 3e20 3c73 7061 6e20 in enume │ │ │ │ -00020d30: 7261 7465 3c2f 7370 616e 3e3c 7370 616e rate(c.source_expres │ │ │ │ -00020da0: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061 sions):. │ │ │ │ -00020dd0: 2020 3c73 7061 6e20 636c 6173 733d 226e c.source_express │ │ │ │ -00020e20: 696f 6e73 3c2f 7370 616e 3e3c 7370 616e ions[pos] = < │ │ │ │ -00020e90: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -00020ea0: 7267 3c2f 7370 616e 3e3c 7370 616e 2063 rg.resolve_express │ │ │ │ -00020ee0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion(. │ │ │ │ -00020f10: 2020 203c 7370 616e 2063 6c61 7373 3d22 query< │ │ │ │ -00020f30: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00020f40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c allow_jo │ │ │ │ -00020f60: 696e 733c 2f73 7061 6e3e 3c73 7061 6e20 ins, reuse< │ │ │ │ -00020fa0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00020fb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c summariz │ │ │ │ -00020fd0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ -00020ff0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 for_save │ │ │ │ -00021010: 0a20 2020 2020 2020 2020 2020 203c 7370 . ). re │ │ │ │ -00021050: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn c..
.[docs]. │ │ │ │ -00021120: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -00021140: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ -00021150: 6173 5f73 716c 3c2f 7370 616e 3e3c 7370 as_sql(. s │ │ │ │ -00021190: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf,. compi │ │ │ │ -000211d0: 6c65 723c 2f73 7061 6e3e 3c73 7061 6e20 ler,. conne │ │ │ │ -00021210: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction,. fun │ │ │ │ -00021250: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction=None │ │ │ │ -00021290: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000212a0: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ -000212b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ -000212d0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000212e0: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =None,. │ │ │ │ -00021320: 2020 2020 203c 7370 616e 2063 6c61 7373 arg_joiner< │ │ │ │ -00021340: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=N │ │ │ │ -00021370: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one,. **extra_contex │ │ │ │ -000213d0: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t, │ │ │ │ -000213f0: 0a20 2020 203c 7370 616e 2063 6c61 7373 . ):. │ │ │ │ -00021410: 2020 2020 2020 203c 7370 616e 2063 6c61 connectio │ │ │ │ -00021430: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ -00021450: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00021460: 6f70 733c 2f73 7061 6e3e 3c73 7061 6e20 ops.check_expressi │ │ │ │ -000214a0: 6f6e 5f73 7570 706f 7274 3c2f 7370 616e on_support(self). │ │ │ │ -00021500: 2020 2020 2020 3c73 7061 6e20 636c 6173 sql_parts< │ │ │ │ -00021520: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -00021540: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00021550: 5b5d 3c2f 7370 616e 3e0a 2020 2020 2020 []. │ │ │ │ -00021560: 2020 3c73 7061 6e20 636c 6173 733d 226e params │ │ │ │ -00021580: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00021590: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = []. for arg │ │ │ │ -000215f0: 203c 7370 616e 2063 6c61 7373 3d22 6f77 in sel │ │ │ │ -00021620: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00021640: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00021650: 736f 7572 6365 5f65 7870 7265 7373 696f source_expressio │ │ │ │ -00021660: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063 ns:. tr │ │ │ │ -000216a0: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y: │ │ │ │ -000216c0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -000216d0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 arg_sql< │ │ │ │ -000216f0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00021700: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c arg_para │ │ │ │ -00021720: 6d73 3c2f 7370 616e 3e20 3c73 7061 6e20 ms = compiler.compil │ │ │ │ -00021790: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -000217b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000217c0: 6172 673c 2f73 7061 6e3e 3c73 7061 6e20 arg). < │ │ │ │ -000217f0: 7370 616e 2063 6c61 7373 3d22 6b22 3e65 span class="k">e │ │ │ │ -00021800: 7863 6570 743c 2f73 7061 6e3e 203c 7370 xcept Emp │ │ │ │ -00021820: 7479 5265 7375 6c74 5365 743c 2f73 7061 tyResultSet:. │ │ │ │ -00021850: 2020 2020 2020 2020 2020 203c 7370 616e empty │ │ │ │ -00021870: 5f72 6573 756c 745f 7365 745f 7661 6c75 _result_set_valu │ │ │ │ -00021880: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = getattr(. │ │ │ │ -000218e0: 2020 2020 2020 2020 2020 2020 2020 3c73 ar │ │ │ │ -00021900: 673c 2f73 7061 6e3e 3c73 7061 6e20 636c g, │ │ │ │ -00021920: 203c 7370 616e 2063 6c61 7373 3d22 7332 "empty_re │ │ │ │ -00021940: 7375 6c74 5f73 6574 5f76 616c 7565 2671 sult_set_value&q │ │ │ │ -00021950: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;, NotImplemen │ │ │ │ -00021990: 7465 643c 2f73 7061 6e3e 0a20 2020 2020 ted. │ │ │ │ -000219a0: 2020 2020 2020 2020 2020 203c 7370 616e ). │ │ │ │ -000219d0: 2020 2020 3c73 7061 6e20 636c 6173 733d if em │ │ │ │ -00021a00: 7074 795f 7265 7375 6c74 5f73 6574 5f76 pty_result_set_v │ │ │ │ -00021a10: 616c 7565 3c2f 7370 616e 3e20 3c73 7061 alue is< │ │ │ │ -00021a30: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> NotImple │ │ │ │ -00021a50: 6d65 6e74 6564 3c2f 7370 616e 3e3c 7370 mented:. │ │ │ │ -00021a80: 2020 2020 2020 2020 2020 3c73 7061 6e20 raise< │ │ │ │ -00021aa0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -00021ab0: 2020 2020 2020 203c 7370 616e 2063 6c61 arg_sql, ar │ │ │ │ -00021b00: 675f 7061 7261 6d73 3c2f 7370 616e 3e20 g_params │ │ │ │ -00021b10: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00021b20: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = compile │ │ │ │ -00021b40: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r. │ │ │ │ -00021b60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00021b70: 636f 6d70 696c 653c 2f73 7061 6e3e 3c73 compile(< │ │ │ │ -00021b90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>Value(empty_ │ │ │ │ -00021be0: 7265 7375 6c74 5f73 6574 5f76 616c 7565 result_set_value │ │ │ │ -00021bf0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 )) │ │ │ │ -00021c10: 0a20 2020 2020 2020 2020 2020 203c 7370 . exc │ │ │ │ -00021c30: 6570 743c 2f73 7061 6e3e 203c 7370 616e ept FullR │ │ │ │ -00021c50: 6573 756c 7453 6574 3c2f 7370 616e 3e3c esultSet< │ │ │ │ -00021c60: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ -00021c70: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00021c80: 2020 2020 2020 2020 3c73 7061 6e20 636c arg_sql< │ │ │ │ -00021ca0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00021cc0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -00021cd0: 7267 5f70 6172 616d 733c 2f73 7061 6e3e rg_params │ │ │ │ -00021ce0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = compil │ │ │ │ -00021d10: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er.compile< │ │ │ │ -00021d50: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00021d60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 Value(True │ │ │ │ -00021db0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 )) │ │ │ │ -00021dd0: 0a20 2020 2020 2020 2020 2020 203c 7370 . sql │ │ │ │ -00021df0: 5f70 6172 7473 3c2f 7370 616e 3e3c 7370 _parts.append(arg_sq │ │ │ │ -00021e60: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l) │ │ │ │ -00021e80: 0a20 2020 2020 2020 2020 2020 203c 7370 . par │ │ │ │ -00021ea0: 616d 733c 2f73 7061 6e3e 3c73 7061 6e20 ams.extend< │ │ │ │ -00021ee0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00021ef0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 arg_param │ │ │ │ -00021f10: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s) │ │ │ │ -00021f30: 0a20 2020 2020 2020 203c 7370 616e 2063 . data = {< │ │ │ │ -00021f80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>**< │ │ │ │ -00021fa0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00021fb0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.extra< │ │ │ │ -00021ff0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00022000: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c **extra_context}. │ │ │ │ -00022060: 2020 2020 2020 3c73 7061 6e20 636c 6173 # Use the │ │ │ │ -00022080: 2066 6972 7374 2073 7570 706c 6965 6420 first supplied │ │ │ │ -00022090: 7661 6c75 6520 696e 2074 6869 7320 6f72 value in this or │ │ │ │ -000220a0: 6465 723a 2074 6865 2070 6172 616d 6574 der: the paramet │ │ │ │ -000220b0: 6572 2074 6f20 7468 6973 3c2f 7370 616e er to this. # met │ │ │ │ -000220e0: 686f 642c 2061 2076 616c 7565 2073 7570 hod, a value sup │ │ │ │ -000220f0: 706c 6965 6420 696e 205f 5f69 6e69 745f plied in __init_ │ │ │ │ -00022100: 5f28 2926 2333 393b 7320 2a2a 6578 7472 _()'s **extr │ │ │ │ -00022110: 6120 2874 6865 2076 616c 7565 2069 6e3c a (the value in< │ │ │ │ -00022120: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00022130: 7370 616e 2063 6c61 7373 3d22 6331 223e span class="c1"> │ │ │ │ -00022140: 2320 6064 6174 6160 292c 206f 7220 7468 # `data`), or th │ │ │ │ -00022150: 6520 7661 6c75 6520 6465 6669 6e65 6420 e value defined │ │ │ │ -00022160: 6f6e 2074 6865 2063 6c61 7373 2e3c 2f73 on the class.. if< │ │ │ │ -00022190: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> function< │ │ │ │ -000221b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> is not N │ │ │ │ -00022200: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one:. < │ │ │ │ -00022230: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ -00022240: 6174 613c 2f73 7061 6e3e 3c73 7061 6e20 ata["functio │ │ │ │ -00022280: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 3c73 n"]< │ │ │ │ -000222a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -000222c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000222d0: 6675 6e63 7469 6f6e 3c2f 7370 616e 3e0a function. │ │ │ │ -000222e0: 2020 2020 2020 2020 3c73 7061 6e20 636c else:. │ │ │ │ -00022320: 2020 2020 2020 2020 3c73 7061 6e20 636c data.setde │ │ │ │ -00022370: 6661 756c 743c 2f73 7061 6e3e 3c73 7061 fault("funct │ │ │ │ -000223b0: 696f 6e26 7175 6f74 3b3c 2f73 7061 6e3e ion" │ │ │ │ -000223c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000223d0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , self.fun │ │ │ │ -00022420: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction). tem │ │ │ │ -00022460: 706c 6174 653c 2f73 7061 6e3e 203c 7370 plate = template or │ │ │ │ -000224c0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 data.get(< │ │ │ │ -00022520: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"tem │ │ │ │ -00022540: 706c 6174 6526 7175 6f74 3b3c 2f73 7061 plate", self │ │ │ │ -00022580: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000225a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e74 span class="n">t │ │ │ │ -000225b0: 656d 706c 6174 653c 2f73 7061 6e3e 3c73 emplate)< │ │ │ │ -000225d0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -000225e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -000225f0: 7267 5f6a 6f69 6e65 723c 2f73 7061 6e3e rg_joiner │ │ │ │ -00022600: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = arg_jo │ │ │ │ -00022630: 696e 6572 3c2f 7370 616e 3e20 3c73 7061 iner or< │ │ │ │ -00022650: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> data.get(&qu │ │ │ │ -000226d0: 6f74 3b61 7267 5f6a 6f69 6e65 7226 7175 ot;arg_joiner&qu │ │ │ │ -000226e0: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;, self< │ │ │ │ -00022720: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00022730: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 arg_joine │ │ │ │ -00022750: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r) │ │ │ │ -00022770: 0a20 2020 2020 2020 203c 7370 616e 2063 . data[&qu │ │ │ │ -000227c0: 6f74 3b65 7870 7265 7373 696f 6e73 2671 ot;expressions&q │ │ │ │ -000227d0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;] = dat │ │ │ │ -00022820: 613c 2f73 7061 6e3e 3c73 7061 6e20 636c a[ │ │ │ │ -00022840: 3c73 7061 6e20 636c 6173 733d 2273 3222 "field&quo │ │ │ │ -00022860: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;] = arg_j │ │ │ │ -000228b0: 6f69 6e65 723c 2f73 7061 6e3e 3c73 7061 oiner.join< │ │ │ │ -000228f0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00022900: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 sql_parts │ │ │ │ -00022920: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00022940: 2020 2020 2020 2020 3c73 7061 6e20 636c return template % < │ │ │ │ -000229a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ -000229b0: 6174 613c 2f73 7061 6e3e 3c73 7061 6e20 ata, params │ │ │ │ -000229f0: 3c2f 6469 763e 0a0a 0a20 2020 203c 7370
... def │ │ │ │ -00022a10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c copy(sel │ │ │ │ -00022a60: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f):. copy = < │ │ │ │ -00022ac0: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -00022ad0: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().cop │ │ │ │ -00022b20: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y(). copyself.arit │ │ │ │ +0001f510: 793c 2f73 7061 6e3e 203c 7370 616e 2063 y == 1 els │ │ │ │ +0001f560: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e " │ │ │ │ +0001f580: 6172 6775 6d65 6e74 7326 7175 6f74 3b3c arguments"< │ │ │ │ +0001f590: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ +0001f5b0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0001f5c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 len(< │ │ │ │ +0001f5f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>expression │ │ │ │ +0001f610: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s),. │ │ │ │ +0001f640: 2020 3c73 7061 6e20 636c 6173 733d 2270 ). │ │ │ │ +0001f660: 2020 2020 2020 203c 7370 616e 2063 6c61 ). │ │ │ │ +0001f680: 2020 2020 2020 2020 3c73 7061 6e20 636c super().< │ │ │ │ +0001f6d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>__init__< │ │ │ │ +0001f6f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(ou │ │ │ │ +0001f720: 7470 7574 5f66 6965 6c64 3c2f 7370 616e tput_field=output_ │ │ │ │ +0001f760: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field). se │ │ │ │ +0001f7a0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.source_expressi │ │ │ │ +0001f7e0: 6f6e 733c 2f73 7061 6e3e 203c 7370 616e ons = self │ │ │ │ +0001f820: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0001f830: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c ._parse_e │ │ │ │ +0001f850: 7870 7265 7373 696f 6e73 3c2f 7370 616e xpressions(*expressions). │ │ │ │ +0001f8d0: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +0001f8f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0001f900: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .extra = ex │ │ │ │ +0001f950: 7472 613c 2f73 7061 6e3e 0a0a 2020 2020 tra.. │ │ │ │ +0001f960: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0001f970: 6465 663c 2f73 7061 6e3e 203c 7370 616e def __re │ │ │ │ +0001f990: 7072 5f5f 3c2f 7370 616e 3e3c 7370 616e pr__(self< │ │ │ │ +0001f9d0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0001f9e0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0001f9f0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 args = self.arg_jo │ │ │ │ +0001fa70: 696e 6572 3c2f 7370 616e 3e3c 7370 616e iner.join(< │ │ │ │ +0001fac0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>str(arg) for< │ │ │ │ +0001fb40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> arg in se │ │ │ │ +0001fb90: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.source_expressi │ │ │ │ +0001fbd0: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20 ons). extra │ │ │ │ +0001fc10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +0001fc30: 203c 7370 616e 2063 6c61 7373 3d22 7022 {**self.< │ │ │ │ +0001fc90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>extra, **self │ │ │ │ +0001fd00: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0001fd10: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c ._get_rep │ │ │ │ +0001fd30: 725f 6f70 7469 6f6e 733c 2f73 7061 6e3e r_options │ │ │ │ +0001fd40: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0001fd50: 2829 7d3c 2f73 7061 6e3e 0a20 2020 2020 ()}. │ │ │ │ +0001fd60: 2020 203c 7370 616e 2063 6c61 7373 3d22 if ext │ │ │ │ +0001fd90: 7261 3c2f 7370 616e 3e3c 7370 616e 2063 ra:. ex │ │ │ │ +0001fdd0: 7472 613c 2f73 7061 6e3e 203c 7370 616e tra = ", &qu │ │ │ │ +0001fe10: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;.join(. │ │ │ │ +0001fe70: 2020 2020 2020 3c73 7061 6e20 636c 6173 str(key) + "=&qu │ │ │ │ +0001ff10: 6f74 3b3c 2f73 7061 6e3e 203c 7370 616e ot; + str< │ │ │ │ +0001ff50: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0001ff60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 val) for key< │ │ │ │ +0001ffd0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0001ffe0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c val in s │ │ │ │ +00020030: 6f72 7465 643c 2f73 7061 6e3e 3c73 7061 orted(extra │ │ │ │ +00020070: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00020080: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .items()). │ │ │ │ +000200c0: 2020 2020 2020 2020 2020 203c 7370 616e ). │ │ │ │ +000200f0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00020100: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return & │ │ │ │ +00020120: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;{}< │ │ │ │ +00020140: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(< │ │ │ │ +00020160: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ +00020170: 7b7d 3c2f 7370 616e 3e3c 7370 616e 2063 {}, {})& │ │ │ │ +000201c0: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;.format(self.__ │ │ │ │ +00020260: 636c 6173 735f 5f3c 2f73 7061 6e3e 3c73 class__.< │ │ │ │ +00020280: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>__name__< │ │ │ │ +000202a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +000202c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +000202d0: 7267 733c 2f73 7061 6e3e 3c73 7061 6e20 rgs, extra< │ │ │ │ +00020310: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00020320: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00020330: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00020340: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return & │ │ │ │ +00020360: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;{}< │ │ │ │ +00020380: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(< │ │ │ │ +000203a0: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ +000203b0: 7b7d 3c2f 7370 616e 3e3c 7370 616e 2063 {})" │ │ │ │ +000203d0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;. │ │ │ │ +000203f0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00020400: 666f 726d 6174 3c2f 7370 616e 3e3c 7370 format(self.__clas │ │ │ │ +00020470: 735f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 s__.__name__, args< │ │ │ │ +000204e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).. │ │ │ │ +00020500: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +00020520: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ +00020530: 5f67 6574 5f72 6570 725f 6f70 7469 6f6e _get_repr_option │ │ │ │ +00020540: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s( │ │ │ │ +00020560: 3c73 7061 6e20 636c 6173 733d 2262 7022 self):. "&quo │ │ │ │ +000205d0: 743b 2671 756f 743b 5265 7475 726e 2061 t;"Return a │ │ │ │ +000205e0: 2064 6963 7420 6f66 2065 7874 7261 205f dict of extra _ │ │ │ │ +000205f0: 5f69 6e69 745f 5f28 2920 6f70 7469 6f6e _init__() option │ │ │ │ +00020600: 7320 746f 2069 6e63 6c75 6465 2069 6e20 s to include in │ │ │ │ +00020610: 7468 6520 7265 7072 2e26 7175 6f74 3b26 the repr."& │ │ │ │ +00020620: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;". retur │ │ │ │ +00020650: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n {}.. def get_source_e │ │ │ │ +000206b0: 7870 7265 7373 696f 6e73 3c2f 7370 616e xpressions(self):. │ │ │ │ +00020710: 2020 2020 2020 203c 7370 616e 2063 6c61 return self.source_ │ │ │ │ +00020780: 6578 7072 6573 7369 6f6e 733c 2f73 7061 expressions.. def set_source_e │ │ │ │ +000207d0: 7870 7265 7373 696f 6e73 3c2f 7370 616e xpressions(self, ex │ │ │ │ +00020840: 7072 733c 2f73 7061 6e3e 3c73 7061 6e20 prs):. sel │ │ │ │ +00020880: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +000208a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000208b0: 736f 7572 6365 5f65 7870 7265 7373 696f source_expressio │ │ │ │ +000208c0: 6e73 3c2f 7370 616e 3e20 3c73 7061 6e20 ns = exprs. │ │ │ │ +00020900: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ +00020920: 3c73 7061 6e20 636c 6173 733d 226e 6622 resolve_express │ │ │ │ +00020940: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion(. self │ │ │ │ +00020980: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +000209a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000209b0: 7175 6572 793c 2f73 7061 6e3e 3c73 7061 query=None │ │ │ │ +000209f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00020a00: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , allow_j │ │ │ │ +00020a20: 6f69 6e73 3c2f 7370 616e 3e3c 7370 616e oins=True< │ │ │ │ +00020a60: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00020a70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c reuse=Non │ │ │ │ +00020ac0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ +00020ae0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 summarize=False< │ │ │ │ +00020b30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00020b50: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +00020b60: 6f72 5f73 6176 653c 2f73 7061 6e3e 3c73 or_save=< │ │ │ │ +00020b80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>False. ):. c = sel │ │ │ │ +00020c10: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +00020c30: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00020c40: 636f 7079 3c2f 7370 616e 3e3c 7370 616e copy(). c.is_ │ │ │ │ +00020cb0: 7375 6d6d 6172 793c 2f73 7061 6e3e 203c summary < │ │ │ │ +00020cc0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00020cd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c summariz │ │ │ │ +00020cf0: 653c 2f73 7061 6e3e 0a20 2020 2020 2020 e. │ │ │ │ +00020d00: 203c 7370 616e 2063 6c61 7373 3d22 6b22 for pos< │ │ │ │ +00020d30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00020d50: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +00020d60: 7267 3c2f 7370 616e 3e20 3c73 7061 6e20 rg in enumerate< │ │ │ │ +00020da0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(c< │ │ │ │ +00020dd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.so │ │ │ │ +00020e00: 7572 6365 5f65 7870 7265 7373 696f 6e73 urce_expressions │ │ │ │ +00020e10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +00020e30: 0a20 2020 2020 2020 2020 2020 203c 7370 . c.sou │ │ │ │ +00020e80: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ +00020e90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>[po │ │ │ │ +00020ec0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s] │ │ │ │ +00020ee0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = arg.reso │ │ │ │ +00020f40: 6c76 655f 6578 7072 6573 7369 6f6e 3c2f lve_expression(. │ │ │ │ +00020f70: 2020 2020 2020 2020 2020 2020 2020 3c73 qu │ │ │ │ +00020f90: 6572 793c 2f73 7061 6e3e 3c73 7061 6e20 ery, allow_joins, re │ │ │ │ +00021000: 7573 653c 2f73 7061 6e3e 3c73 7061 6e20 use, summarize, for_ │ │ │ │ +00021070: 7361 7665 3c2f 7370 616e 3e0a 2020 2020 save. │ │ │ │ +00021080: 2020 2020 2020 2020 3c73 7061 6e20 636c ) │ │ │ │ +000210a0: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ +000210c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> c. │ │ │ │ +000210e0: 0a3c 6469 7620 636c 6173 733d 2276 6965 .
.< │ │ │ │ +00021110: 6120 636c 6173 733d 2276 6965 7763 6f64 a class="viewcod │ │ │ │ +00021120: 652d 6261 636b 2220 6872 6566 3d22 2e2e e-back" href=".. │ │ │ │ +00021130: 2f2e 2e2f 2e2e 2f2e 2e2f 7265 662f 6d6f /../../../ref/mo │ │ │ │ +00021140: 6465 6c73 2f65 7870 7265 7373 696f 6e73 dels/expressions │ │ │ │ +00021150: 2e68 746d 6c23 646a 616e 676f 2e64 622e .html#django.db. │ │ │ │ +00021160: 6d6f 6465 6c73 2e65 7870 7265 7373 696f models.expressio │ │ │ │ +00021170: 6e73 2e46 756e 632e 6173 5f73 716c 223e ns.Func.as_sql"> │ │ │ │ +00021180: 5b64 6f63 756d 656e 7469 5d3c 2f61 3e0a [documenti]. │ │ │ │ +00021190: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +000211b0: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ +000211c0: 6173 5f73 716c 3c2f 7370 616e 3e3c 7370 as_sql(. s │ │ │ │ +00021200: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf,. compi │ │ │ │ +00021240: 6c65 723c 2f73 7061 6e3e 3c73 7061 6e20 ler,. conne │ │ │ │ +00021280: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction,. fun │ │ │ │ +000212c0: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction=None │ │ │ │ +00021300: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00021310: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ +00021320: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ +00021340: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00021350: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =None,. │ │ │ │ +00021390: 2020 2020 203c 7370 616e 2063 6c61 7373 arg_joiner< │ │ │ │ +000213b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=N │ │ │ │ +000213e0: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one,. **extra_contex │ │ │ │ +00021440: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t, │ │ │ │ +00021460: 0a20 2020 203c 7370 616e 2063 6c61 7373 . ):. │ │ │ │ +00021480: 2020 2020 2020 203c 7370 616e 2063 6c61 connectio │ │ │ │ +000214a0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ +000214c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000214d0: 6f70 733c 2f73 7061 6e3e 3c73 7061 6e20 ops.check_expressi │ │ │ │ +00021510: 6f6e 5f73 7570 706f 7274 3c2f 7370 616e on_support(self). │ │ │ │ +00021570: 2020 2020 2020 3c73 7061 6e20 636c 6173 sql_parts< │ │ │ │ +00021590: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +000215b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000215c0: 5b5d 3c2f 7370 616e 3e0a 2020 2020 2020 []. │ │ │ │ +000215d0: 2020 3c73 7061 6e20 636c 6173 733d 226e params │ │ │ │ +000215f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00021600: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = []. for arg │ │ │ │ +00021660: 203c 7370 616e 2063 6c61 7373 3d22 6f77 in sel │ │ │ │ +00021690: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +000216b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000216c0: 736f 7572 6365 5f65 7870 7265 7373 696f source_expressio │ │ │ │ +000216d0: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063 ns:. tr │ │ │ │ +00021710: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y: │ │ │ │ +00021730: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ +00021740: 203c 7370 616e 2063 6c61 7373 3d22 6e22 arg_sql< │ │ │ │ +00021760: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00021770: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c arg_para │ │ │ │ +00021790: 6d73 3c2f 7370 616e 3e20 3c73 7061 6e20 ms = compiler.compil │ │ │ │ +00021800: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ +00021820: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00021830: 6172 673c 2f73 7061 6e3e 3c73 7061 6e20 arg). < │ │ │ │ +00021860: 7370 616e 2063 6c61 7373 3d22 6b22 3e65 span class="k">e │ │ │ │ +00021870: 7863 6570 743c 2f73 7061 6e3e 203c 7370 xcept Emp │ │ │ │ +00021890: 7479 5265 7375 6c74 5365 743c 2f73 7061 tyResultSet:. │ │ │ │ +000218c0: 2020 2020 2020 2020 2020 203c 7370 616e empty │ │ │ │ +000218e0: 5f72 6573 756c 745f 7365 745f 7661 6c75 _result_set_valu │ │ │ │ +000218f0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = getattr(. │ │ │ │ +00021950: 2020 2020 2020 2020 2020 2020 2020 3c73 ar │ │ │ │ +00021970: 673c 2f73 7061 6e3e 3c73 7061 6e20 636c g, │ │ │ │ +00021990: 203c 7370 616e 2063 6c61 7373 3d22 7332 "empty_re │ │ │ │ +000219b0: 7375 6c74 5f73 6574 5f76 616c 7565 2671 sult_set_value&q │ │ │ │ +000219c0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;, NotImplemen │ │ │ │ +00021a00: 7465 643c 2f73 7061 6e3e 0a20 2020 2020 ted. │ │ │ │ +00021a10: 2020 2020 2020 2020 2020 203c 7370 616e ). │ │ │ │ +00021a40: 2020 2020 3c73 7061 6e20 636c 6173 733d if em │ │ │ │ +00021a70: 7074 795f 7265 7375 6c74 5f73 6574 5f76 pty_result_set_v │ │ │ │ +00021a80: 616c 7565 3c2f 7370 616e 3e20 3c73 7061 alue is< │ │ │ │ +00021aa0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> NotImple │ │ │ │ +00021ac0: 6d65 6e74 6564 3c2f 7370 616e 3e3c 7370 mented:. │ │ │ │ +00021af0: 2020 2020 2020 2020 2020 3c73 7061 6e20 raise< │ │ │ │ +00021b10: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00021b20: 2020 2020 2020 203c 7370 616e 2063 6c61 arg_sql, ar │ │ │ │ +00021b70: 675f 7061 7261 6d73 3c2f 7370 616e 3e20 g_params │ │ │ │ +00021b80: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00021b90: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = compile │ │ │ │ +00021bb0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r. │ │ │ │ +00021bd0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00021be0: 636f 6d70 696c 653c 2f73 7061 6e3e 3c73 compile(< │ │ │ │ +00021c00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>Value(empty_ │ │ │ │ +00021c50: 7265 7375 6c74 5f73 6574 5f76 616c 7565 result_set_value │ │ │ │ +00021c60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 )) │ │ │ │ +00021c80: 0a20 2020 2020 2020 2020 2020 203c 7370 . exc │ │ │ │ +00021ca0: 6570 743c 2f73 7061 6e3e 203c 7370 616e ept FullR │ │ │ │ +00021cc0: 6573 756c 7453 6574 3c2f 7370 616e 3e3c esultSet< │ │ │ │ +00021cd0: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ +00021ce0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00021cf0: 2020 2020 2020 2020 3c73 7061 6e20 636c arg_sql< │ │ │ │ +00021d10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00021d30: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +00021d40: 7267 5f70 6172 616d 733c 2f73 7061 6e3e rg_params │ │ │ │ +00021d50: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = compil │ │ │ │ +00021d80: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er.compile< │ │ │ │ +00021dc0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00021dd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 Value(True │ │ │ │ +00021e20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 )) │ │ │ │ +00021e40: 0a20 2020 2020 2020 2020 2020 203c 7370 . sql │ │ │ │ +00021e60: 5f70 6172 7473 3c2f 7370 616e 3e3c 7370 _parts.append(arg_sq │ │ │ │ +00021ed0: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l) │ │ │ │ +00021ef0: 0a20 2020 2020 2020 2020 2020 203c 7370 . par │ │ │ │ +00021f10: 616d 733c 2f73 7061 6e3e 3c73 7061 6e20 ams.extend< │ │ │ │ +00021f50: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00021f60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 arg_param │ │ │ │ +00021f80: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s) │ │ │ │ +00021fa0: 0a20 2020 2020 2020 203c 7370 616e 2063 . data = {< │ │ │ │ +00021ff0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>**< │ │ │ │ +00022010: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00022020: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.extra< │ │ │ │ +00022060: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00022070: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c **extra_context}. │ │ │ │ +000220d0: 2020 2020 2020 3c73 7061 6e20 636c 6173 # Use the │ │ │ │ +000220f0: 2066 6972 7374 2073 7570 706c 6965 6420 first supplied │ │ │ │ +00022100: 7661 6c75 6520 696e 2074 6869 7320 6f72 value in this or │ │ │ │ +00022110: 6465 723a 2074 6865 2070 6172 616d 6574 der: the paramet │ │ │ │ +00022120: 6572 2074 6f20 7468 6973 3c2f 7370 616e er to this. # met │ │ │ │ +00022150: 686f 642c 2061 2076 616c 7565 2073 7570 hod, a value sup │ │ │ │ +00022160: 706c 6965 6420 696e 205f 5f69 6e69 745f plied in __init_ │ │ │ │ +00022170: 5f28 2926 2333 393b 7320 2a2a 6578 7472 _()'s **extr │ │ │ │ +00022180: 6120 2874 6865 2076 616c 7565 2069 6e3c a (the value in< │ │ │ │ +00022190: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +000221a0: 7370 616e 2063 6c61 7373 3d22 6331 223e span class="c1"> │ │ │ │ +000221b0: 2320 6064 6174 6160 292c 206f 7220 7468 # `data`), or th │ │ │ │ +000221c0: 6520 7661 6c75 6520 6465 6669 6e65 6420 e value defined │ │ │ │ +000221d0: 6f6e 2074 6865 2063 6c61 7373 2e3c 2f73 on the class.. if< │ │ │ │ +00022200: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> function< │ │ │ │ +00022220: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> is not N │ │ │ │ +00022270: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one:. < │ │ │ │ +000222a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ +000222b0: 6174 613c 2f73 7061 6e3e 3c73 7061 6e20 ata["functio │ │ │ │ +000222f0: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 3c73 n"]< │ │ │ │ +00022310: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00022330: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00022340: 6675 6e63 7469 6f6e 3c2f 7370 616e 3e0a function. │ │ │ │ +00022350: 2020 2020 2020 2020 3c73 7061 6e20 636c else:. │ │ │ │ +00022390: 2020 2020 2020 2020 3c73 7061 6e20 636c data.setde │ │ │ │ +000223e0: 6661 756c 743c 2f73 7061 6e3e 3c73 7061 fault("funct │ │ │ │ +00022420: 696f 6e26 7175 6f74 3b3c 2f73 7061 6e3e ion" │ │ │ │ +00022430: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00022440: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , self.fun │ │ │ │ +00022490: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction). tem │ │ │ │ +000224d0: 706c 6174 653c 2f73 7061 6e3e 203c 7370 plate = template or │ │ │ │ +00022530: 203c 7370 616e 2063 6c61 7373 3d22 6e22 data.get(< │ │ │ │ +00022590: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"tem │ │ │ │ +000225b0: 706c 6174 6526 7175 6f74 3b3c 2f73 7061 plate", self │ │ │ │ +000225f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00022610: 7370 616e 2063 6c61 7373 3d22 6e22 3e74 span class="n">t │ │ │ │ +00022620: 656d 706c 6174 653c 2f73 7061 6e3e 3c73 emplate)< │ │ │ │ +00022640: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00022650: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +00022660: 7267 5f6a 6f69 6e65 723c 2f73 7061 6e3e rg_joiner │ │ │ │ +00022670: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = arg_jo │ │ │ │ +000226a0: 696e 6572 3c2f 7370 616e 3e20 3c73 7061 iner or< │ │ │ │ +000226c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> data.get(&qu │ │ │ │ +00022740: 6f74 3b61 7267 5f6a 6f69 6e65 7226 7175 ot;arg_joiner&qu │ │ │ │ +00022750: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;, self< │ │ │ │ +00022790: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +000227a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 arg_joine │ │ │ │ +000227c0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r) │ │ │ │ +000227e0: 0a20 2020 2020 2020 203c 7370 616e 2063 . data[&qu │ │ │ │ +00022830: 6f74 3b65 7870 7265 7373 696f 6e73 2671 ot;expressions&q │ │ │ │ +00022840: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;] = dat │ │ │ │ +00022890: 613c 2f73 7061 6e3e 3c73 7061 6e20 636c a[ │ │ │ │ +000228b0: 3c73 7061 6e20 636c 6173 733d 2273 3222 "field&quo │ │ │ │ +000228d0: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;] = arg_j │ │ │ │ +00022920: 6f69 6e65 723c 2f73 7061 6e3e 3c73 7061 oiner.join< │ │ │ │ +00022960: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00022970: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 sql_parts │ │ │ │ +00022990: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +000229b0: 2020 2020 2020 2020 3c73 7061 6e20 636c return template % < │ │ │ │ +00022a10: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ +00022a20: 6174 613c 2f73 7061 6e3e 3c73 7061 6e20 ata, params │ │ │ │ +00022a60: 3c2f 6469 763e 0a0a 0a20 2020 203c 7370
... def │ │ │ │ +00022a80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c copy(sel │ │ │ │ +00022ad0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f):. copy = < │ │ │ │ +00022b30: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +00022b40: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().sou │ │ │ │ -00022b90: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ -00022ba0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -00022bc0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.source_expre │ │ │ │ -00022c10: 7373 696f 6e73 3c2f 7370 616e 3e3c 7370 ssions[:] │ │ │ │ -00022c30: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00022c40: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00022c50: 636f 7079 3c2f 7370 616e 3e3c 7370 616e copy.extra │ │ │ │ -00022c90: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00022ca0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = self.ext │ │ │ │ -00022cf0: 7261 3c2f 7370 616e 3e3c 7370 616e 2063 ra.copy(). re │ │ │ │ -00022d60: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn copy │ │ │ │ -00022d80: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 0a0a
... │ │ │ │ -00022d90: 0a3c 6469 7620 636c 6173 733d 2276 6965 .
.[docs].< │ │ │ │ -00022e30: 7370 616e 2063 6c61 7373 3d22 6e64 223e span class="nd"> │ │ │ │ -00022e40: 4064 6563 6f6e 7374 7275 6374 6962 6c65 @deconstructible │ │ │ │ -00022e50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00022e70: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ -00022e80: 6174 683c 2f73 7061 6e3e 3c73 7061 6e20 ath="django. │ │ │ │ -00022ec0: 6462 2e6d 6f64 656c 732e 5661 6c75 6526 db.models.Value& │ │ │ │ -00022ed0: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;).class Value< │ │ │ │ -00022f30: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00022f40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 SQLiteNum │ │ │ │ -00022f60: 6572 6963 4d69 7869 6e3c 2f73 7061 6e3e ericMixin │ │ │ │ -00022f70: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00022f80: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , Express │ │ │ │ -00022fa0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion):. < │ │ │ │ -00022fe0: 7370 616e 2063 6c61 7373 3d22 7364 223e span class="sd"> │ │ │ │ -00022ff0: 2671 756f 743b 2671 756f 743b 2671 756f ""&quo │ │ │ │ -00023000: 743b 5265 7072 6573 656e 7420 6120 7772 t;Represent a wr │ │ │ │ -00023010: 6170 7065 6420 7661 6c75 6520 6173 2061 apped value as a │ │ │ │ -00023020: 206e 6f64 6520 7769 7468 696e 2061 6e20 node within an │ │ │ │ -00023030: 6578 7072 6573 7369 6f6e 2e26 7175 6f74 expression." │ │ │ │ -00023040: 3b26 7175 6f74 3b26 7175 6f74 3b3c 2f73 ;"".. # Pro │ │ │ │ -00023070: 7669 6465 2061 2064 6566 6175 6c74 2076 vide a default v │ │ │ │ -00023080: 616c 7565 2066 6f72 2060 666f 725f 7361 alue for `for_sa │ │ │ │ -00023090: 7665 6020 696e 206f 7264 6572 2074 6f20 ve` in order to │ │ │ │ -000230a0: 616c 6c6f 7720 756e 7265 736f 6c76 6564 allow unresolved │ │ │ │ -000230b0: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . # i │ │ │ │ -000230d0: 6e73 7461 6e63 6573 2074 6f20 6265 2063 nstances to be c │ │ │ │ -000230e0: 6f6d 7069 6c65 6420 756e 7469 6c20 6120 ompiled until a │ │ │ │ -000230f0: 6465 6369 7369 6f6e 2069 7320 7461 6b65 decision is take │ │ │ │ -00023100: 6e20 696e 2023 3235 3432 352e 3c2f 7370 n in #25425.. for_save │ │ │ │ -00023130: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -00023150: 203c 7370 616e 2063 6c61 7373 3d22 6b63 False.. │ │ │ │ -00023170: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -00023190: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ -000231a0: 5f5f 696e 6974 5f5f 3c2f 7370 616e 3e3c __init__< │ │ │ │ -000231b0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -000231c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, valu │ │ │ │ -00023210: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ -00023230: 203c 7370 616e 2063 6c61 7373 3d22 6e22 output_field=Non │ │ │ │ -00023280: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e):. ""&q │ │ │ │ -000232e0: 756f 743b 3c2f 7370 616e 3e0a 3c73 7061 uot;. │ │ │ │ -00023300: 2020 2020 2041 7267 756d 656e 7473 3a3c Arguments:< │ │ │ │ +00022b80: 616e 2063 6c61 7373 3d22 6e22 3e63 6f70 an class="n">cop │ │ │ │ +00022b90: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y(). copy.sou │ │ │ │ +00022c00: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ +00022c10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00022c30: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.source_expre │ │ │ │ +00022c80: 7373 696f 6e73 3c2f 7370 616e 3e3c 7370 ssions[:] │ │ │ │ +00022ca0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00022cb0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00022cc0: 636f 7079 3c2f 7370 616e 3e3c 7370 616e copy.extra │ │ │ │ +00022d00: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00022d10: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = self.ext │ │ │ │ +00022d60: 7261 3c2f 7370 616e 3e3c 7370 616e 2063 ra.copy(). re │ │ │ │ +00022dd0: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn copy │ │ │ │ +00022df0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 0a0a
... │ │ │ │ +00022e00: 0a3c 6469 7620 636c 6173 733d 2276 6965 .
.[documenti]< │ │ │ │ +00022ea0: 2f61 3e0a 3c73 7061 6e20 636c 6173 733d /a>.@deconstruc │ │ │ │ +00022ec0: 7469 626c 653c 2f73 7061 6e3e 3c73 7061 tible(path< │ │ │ │ +00022f00: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00022f10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 "dj │ │ │ │ +00022f30: 616e 676f 2e64 622e 6d6f 6465 6c73 2e56 ango.db.models.V │ │ │ │ +00022f40: 616c 7565 2671 756f 743b 3c2f 7370 616e alue").class< │ │ │ │ +00022f80: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> Value(SQLi │ │ │ │ +00022fd0: 7465 4e75 6d65 7269 634d 6978 696e 3c2f teNumericMixin, Ex │ │ │ │ +00023010: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ +00023020: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00023030: 3a3c 2f73 7061 6e3e 0a3c 7370 616e 2063 :. "" │ │ │ │ +00023070: 3b26 7175 6f74 3b52 6570 7265 7365 6e74 ;"Represent │ │ │ │ +00023080: 2061 2077 7261 7070 6564 2076 616c 7565 a wrapped value │ │ │ │ +00023090: 2061 7320 6120 6e6f 6465 2077 6974 6869 as a node withi │ │ │ │ +000230a0: 6e20 616e 2065 7870 7265 7373 696f 6e2e n an expression. │ │ │ │ +000230b0: 2671 756f 743b 2671 756f 743b 2671 756f ""&quo │ │ │ │ +000230c0: 743b 3c2f 7370 616e 3e0a 0a20 2020 203c t;.. < │ │ │ │ +000230d0: 7370 616e 2063 6c61 7373 3d22 6331 223e span class="c1"> │ │ │ │ +000230e0: 2320 5072 6f76 6964 6520 6120 6465 6661 # Provide a defa │ │ │ │ +000230f0: 756c 7420 7661 6c75 6520 666f 7220 6066 ult value for `f │ │ │ │ +00023100: 6f72 5f73 6176 6560 2069 6e20 6f72 6465 or_save` in orde │ │ │ │ +00023110: 7220 746f 2061 6c6c 6f77 2075 6e72 6573 r to allow unres │ │ │ │ +00023120: 6f6c 7665 643c 2f73 7061 6e3e 0a20 2020 olved. │ │ │ │ +00023130: 203c 7370 616e 2063 6c61 7373 3d22 6331 # instances to │ │ │ │ +00023150: 2062 6520 636f 6d70 696c 6564 2075 6e74 be compiled unt │ │ │ │ +00023160: 696c 2061 2064 6563 6973 696f 6e20 6973 il a decision is │ │ │ │ +00023170: 2074 616b 656e 2069 6e20 2332 3534 3235 taken in #25425 │ │ │ │ +00023180: 2e3c 2f73 7061 6e3e 0a20 2020 203c 7370 .. for │ │ │ │ +000231a0: 5f73 6176 653c 2f73 7061 6e3e 203c 7370 _save = False.. def __init__(sel │ │ │ │ +00023250: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ +00023270: 203c 7370 616e 2063 6c61 7373 3d22 6e22 value, output_fie │ │ │ │ +000232c0: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld=None):< │ │ │ │ 00023310: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61 /span>. │ │ │ │ -00023330: 202a 2076 616c 7565 3a20 7468 6520 7661 * value: the va │ │ │ │ -00023340: 6c75 6520 7468 6973 2065 7870 7265 7373 lue this express │ │ │ │ -00023350: 696f 6e20 7265 7072 6573 656e 7473 2e20 ion represents. │ │ │ │ -00023360: 5468 6520 7661 6c75 6520 7769 6c6c 2062 The value will b │ │ │ │ -00023370: 653c 2f73 7061 6e3e 0a3c 7370 616e 2063 e. │ │ │ │ -00023390: 2020 2020 2061 6464 6564 2069 6e74 6f20 added into │ │ │ │ -000233a0: 7468 6520 7371 6c20 7061 7261 6d65 7465 the sql paramete │ │ │ │ -000233b0: 7220 6c69 7374 2061 6e64 2070 726f 7065 r list and prope │ │ │ │ -000233c0: 726c 7920 7175 6f74 6564 2e3c 2f73 7061 rly quoted... * │ │ │ │ -000233f0: 6f75 7470 7574 5f66 6965 6c64 3a20 616e output_field: an │ │ │ │ -00023400: 2069 6e73 7461 6e63 6520 6f66 2074 6865 instance of the │ │ │ │ -00023410: 206d 6f64 656c 2066 6965 6c64 2074 7970 model field typ │ │ │ │ -00023420: 6520 7468 6174 2074 6869 733c 2f73 7061 e that this. e │ │ │ │ -00023450: 7870 7265 7373 696f 6e20 7769 6c6c 2072 xpression will r │ │ │ │ -00023460: 6574 7572 6e2c 2073 7563 6820 6173 2049 eturn, such as I │ │ │ │ -00023470: 6e74 6567 6572 4669 656c 6428 2920 6f72 ntegerField() or │ │ │ │ -00023480: 2043 6861 7246 6965 6c64 2829 2e3c 2f73 CharField().. &q │ │ │ │ -000234b0: 756f 743b 2671 756f 743b 2671 756f 743b uot;"" │ │ │ │ -000234c0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000234d0: 3c73 7061 6e20 636c 6173 733d 226e 6222 super()< │ │ │ │ -00023500: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ -00023530: 5f69 6e69 745f 5f3c 2f73 7061 6e3e 3c73 _init__(< │ │ │ │ -00023550: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>output_fie │ │ │ │ -00023570: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld=output_field). │ │ │ │ -000235d0: 2020 2020 203c 7370 616e 2063 6c61 7373 self.value = < │ │ │ │ -00023640: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ -00023650: 616c 7565 3c2f 7370 616e 3e0a 0a20 2020 alue.. │ │ │ │ -00023660: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def __r │ │ │ │ -00023690: 6570 725f 5f3c 2f73 7061 6e3e 3c73 7061 epr__(self │ │ │ │ -000236d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000236e0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -000236f0: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ -00023710: 3c73 7061 6e20 636c 6173 733d 2273 6122 f" │ │ │ │ -00023740: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 { │ │ │ │ -00023760: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.__class__.__ │ │ │ │ -000237e0: 6e61 6d65 5f5f 3c2f 7370 616e 3e3c 7370 name__}< │ │ │ │ -00023800: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(< │ │ │ │ -00023820: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -00023830: 7b3c 2f73 7061 6e3e 3c73 7061 6e20 636c {self.valu │ │ │ │ -00023880: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e!r})".. def as_sql(self, co │ │ │ │ -00023960: 6d70 696c 6572 3c2f 7370 616e 3e3c 7370 mpiler, connection │ │ │ │ -000239a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -000239c0: 0a20 2020 2020 2020 203c 7370 616e 2063 . connect │ │ │ │ -000239e0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion.ops.check_expres │ │ │ │ -00023a50: 7369 6f6e 5f73 7570 706f 7274 3c2f 7370 sion_support(self │ │ │ │ -00023a90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00023ab0: 2020 2020 2020 2020 3c73 7061 6e20 636c val = sel │ │ │ │ -00023b00: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00023b20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00023b30: 7661 6c75 653c 2f73 7061 6e3e 0a20 2020 value. │ │ │ │ -00023b40: 2020 2020 203c 7370 616e 2063 6c61 7373 output_fiel │ │ │ │ -00023b60: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d = self.< │ │ │ │ -00023bb0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>_output_fi │ │ │ │ -00023bd0: 656c 645f 6f72 5f6e 6f6e 653c 2f73 7061 eld_or_none. if output_fiel │ │ │ │ -00023c20: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d is not │ │ │ │ -00023c60: 3c73 7061 6e20 636c 6173 733d 226b 6322 None:. │ │ │ │ -00023ca0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if self │ │ │ │ -00023cd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00023cf0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00023d00: 6f72 5f73 6176 653c 2f73 7061 6e3e 3c73 or_save:< │ │ │ │ -00023d20: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -00023d30: 2020 2020 2020 203c 7370 616e 2063 6c61 val = outpu │ │ │ │ -00023d80: 745f 6669 656c 643c 2f73 7061 6e3e 3c73 t_field.< │ │ │ │ -00023da0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>get_db_pre │ │ │ │ -00023dc0: 705f 7361 7665 3c2f 7370 616e 3e3c 7370 p_save(val< │ │ │ │ -00023e00: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00023e10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ -00023e30: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on=connection). │ │ │ │ -00023e90: 2020 2020 2020 203c 7370 616e 2063 6c61 else:. │ │ │ │ -00023ed0: 2020 2020 2020 2020 2020 203c 7370 616e val = < │ │ │ │ -00023f10: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -00023f20: 7574 7075 745f 6669 656c 643c 2f73 7061 utput_field.get_db │ │ │ │ -00023f60: 5f70 7265 705f 7661 6c75 653c 2f73 7061 _prep_value(val, con │ │ │ │ -00023fd0: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection=< │ │ │ │ -00023ff0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>connection │ │ │ │ -00024010: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00024030: 2020 2020 2020 2020 2020 2020 3c73 7061 if hasattr(out │ │ │ │ -000240a0: 7075 745f 6669 656c 643c 2f73 7061 6e3e put_field │ │ │ │ -000240b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000240c0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , " │ │ │ │ -000240e0: 6765 745f 706c 6163 6568 6f6c 6465 7226 get_placeholder& │ │ │ │ -000240f0: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;):. │ │ │ │ -00024120: 2020 2020 2020 3c73 7061 6e20 636c 6173 return output_field │ │ │ │ -00024160: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00024180: 7370 616e 2063 6c61 7373 3d22 6e22 3e67 span class="n">g │ │ │ │ -00024190: 6574 5f70 6c61 6365 686f 6c64 6572 3c2f et_placeholder(val │ │ │ │ -000241d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -000241f0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00024200: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ -00024210: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00024220: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ -00024240: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on), [val]. │ │ │ │ -000242b0: 2020 2020 2020 3c73 7061 6e20 636c 6173 if │ │ │ │ -000242d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000242e0: 7661 6c3c 2f73 7061 6e3e 203c 7370 616e val is None:. │ │ │ │ -00024340: 2020 2020 2020 203c 7370 616e 2063 6c61 # cx_Ora │ │ │ │ -00024360: 636c 6520 646f 6573 206e 6f74 2061 6c77 cle does not alw │ │ │ │ -00024370: 6179 7320 636f 6e76 6572 7420 4e6f 6e65 ays convert None │ │ │ │ -00024380: 2074 6f20 7468 6520 6170 7072 6f70 7269 to the appropri │ │ │ │ -00024390: 6174 653c 2f73 7061 6e3e 0a20 2020 2020 ate. │ │ │ │ -000243a0: 2020 2020 2020 203c 7370 616e 2063 6c61 # NULL t │ │ │ │ -000243c0: 7970 6520 286c 696b 6520 696e 2063 6173 ype (like in cas │ │ │ │ -000243d0: 6520 6578 7072 6573 7369 6f6e 7320 7573 e expressions us │ │ │ │ -000243e0: 696e 6720 6e75 6d62 6572 7329 2c20 736f ing numbers), so │ │ │ │ -000243f0: 2077 653c 2f73 7061 6e3e 0a20 2020 2020 we. │ │ │ │ -00024400: 2020 2020 2020 203c 7370 616e 2063 6c61 # use a │ │ │ │ -00024420: 6c69 7465 7261 6c20 5351 4c20 4e55 4c4c literal SQL NULL │ │ │ │ -00024430: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00024440: 2020 2020 3c73 7061 6e20 636c 6173 733d return "NULL&qu │ │ │ │ -00024480: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;, []. │ │ │ │ -000244c0: 2020 2020 203c 7370 616e 2063 6c61 7373 return "%s&quo │ │ │ │ -00024530: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;, [val].. │ │ │ │ -000245a0: 2020 3c73 7061 6e20 636c 6173 733d 226b def re │ │ │ │ -000245d0: 736f 6c76 655f 6578 7072 6573 7369 6f6e solve_expression │ │ │ │ -000245e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (. │ │ │ │ -00024600: 2020 2020 2020 2020 3c73 7061 6e20 636c self, que │ │ │ │ -00024650: 7279 3c2f 7370 616e 3e3c 7370 616e 2063 ry=None, allow_join │ │ │ │ -000246c0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s= │ │ │ │ -000246e0: 3c73 7061 6e20 636c 6173 733d 226b 6322 True, reuse=None, su │ │ │ │ -00024790: 6d6d 6172 697a 653c 2f73 7061 6e3e 3c73 mmarize=< │ │ │ │ -000247b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>False, for_ │ │ │ │ -00024800: 7361 7665 3c2f 7370 616e 3e3c 7370 616e save=False │ │ │ │ -00024840: 0a20 2020 203c 7370 616e 2063 6c61 7373 . ):. │ │ │ │ -00024860: 2020 2020 2020 203c 7370 616e 2063 6c61 c │ │ │ │ +00023320: 7373 3d22 7722 3e20 2020 2020 2020 203c ss="w"> < │ │ │ │ +00023330: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"&qu │ │ │ │ +00023350: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e ot;" │ │ │ │ +00023360: 0a3c 7370 616e 2063 6c61 7373 3d22 7364 . Argume │ │ │ │ +00023380: 6e74 733a 3c2f 7370 616e 3e0a 3c73 7061 nts:. │ │ │ │ +000233a0: 2020 2020 2020 2a20 7661 6c75 653a 2074 * value: t │ │ │ │ +000233b0: 6865 2076 616c 7565 2074 6869 7320 6578 he value this ex │ │ │ │ +000233c0: 7072 6573 7369 6f6e 2072 6570 7265 7365 pression represe │ │ │ │ +000233d0: 6e74 732e 2054 6865 2076 616c 7565 2077 nts. The value w │ │ │ │ +000233e0: 696c 6c20 6265 3c2f 7370 616e 3e0a 3c73 ill be. │ │ │ │ +00023400: 2020 2020 2020 2020 2020 6164 6465 6420 added │ │ │ │ +00023410: 696e 746f 2074 6865 2073 716c 2070 6172 into the sql par │ │ │ │ +00023420: 616d 6574 6572 206c 6973 7420 616e 6420 ameter list and │ │ │ │ +00023430: 7072 6f70 6572 6c79 2071 756f 7465 642e properly quoted. │ │ │ │ +00023440: 3c2f 7370 616e 3e0a 0a3c 7370 616e 2063 .. │ │ │ │ +00023460: 2020 202a 206f 7574 7075 745f 6669 656c * output_fiel │ │ │ │ +00023470: 643a 2061 6e20 696e 7374 616e 6365 206f d: an instance o │ │ │ │ +00023480: 6620 7468 6520 6d6f 6465 6c20 6669 656c f the model fiel │ │ │ │ +00023490: 6420 7479 7065 2074 6861 7420 7468 6973 d type that this │ │ │ │ +000234a0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c . │ │ │ │ +000234c0: 2020 2020 6578 7072 6573 7369 6f6e 2077 expression w │ │ │ │ +000234d0: 696c 6c20 7265 7475 726e 2c20 7375 6368 ill return, such │ │ │ │ +000234e0: 2061 7320 496e 7465 6765 7246 6965 6c64 as IntegerField │ │ │ │ +000234f0: 2829 206f 7220 4368 6172 4669 656c 6428 () or CharField( │ │ │ │ +00023500: 292e 3c2f 7370 616e 3e0a 3c73 7061 6e20 ).. │ │ │ │ +00023520: 2020 2026 7175 6f74 3b26 7175 6f74 3b26 ""& │ │ │ │ +00023530: 7175 6f74 3b3c 2f73 7061 6e3e 0a20 2020 quot;. │ │ │ │ +00023540: 2020 2020 203c 7370 616e 2063 6c61 7373 super().__init__(outpu │ │ │ │ +000235e0: 745f 6669 656c 643c 2f73 7061 6e3e 3c73 t_field=< │ │ │ │ +00023600: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>output_fie │ │ │ │ +00023620: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld). self< │ │ │ │ +00023660: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.va │ │ │ │ +00023690: 6c75 653c 2f73 7061 6e3e 203c 7370 616e lue = value │ │ │ │ +000236d0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ +000236f0: 203c 7370 616e 2063 6c61 7373 3d22 666d __repr__(self):. │ │ │ │ +00023760: 2020 2020 2020 203c 7370 616e 2063 6c61 return f& │ │ │ │ +000237b0: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;{self.__clas │ │ │ │ +00023820: 735f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 s__.__name__}({se │ │ │ │ +000238c0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.value!r │ │ │ │ +00023910: 7d3c 2f73 7061 6e3e 3c73 7061 6e20 636c })" │ │ │ │ +00023930: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +00023950: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c as_sql< │ │ │ │ +00023970: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +000239a0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, compiler, conne │ │ │ │ +00023a10: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction):. co │ │ │ │ +00023a50: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ +00023a60: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00023a70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ops.check_e │ │ │ │ +00023ac0: 7870 7265 7373 696f 6e5f 7375 7070 6f72 xpression_suppor │ │ │ │ +00023ad0: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t( │ │ │ │ +00023af0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self). val │ │ │ │ +00023b40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +00023b60: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.value. output │ │ │ │ +00023bd0: 5f66 6965 6c64 3c2f 7370 616e 3e20 3c73 _field =< │ │ │ │ +00023bf0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self._outp │ │ │ │ +00023c40: 7574 5f66 6965 6c64 5f6f 725f 6e6f 6e65 ut_field_or_none │ │ │ │ +00023c50: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00023c60: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00023c70: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if output │ │ │ │ +00023c90: 5f66 6965 6c64 3c2f 7370 616e 3e20 3c73 _field i │ │ │ │ +00023cb0: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s not None:. │ │ │ │ +00023d10: 2020 2020 2020 3c73 7061 6e20 636c 6173 if │ │ │ │ +00023d30: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.for_save:. │ │ │ │ +00023da0: 2020 2020 2020 2020 2020 2020 3c73 7061 val< │ │ │ │ +00023dc0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00023de0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00023df0: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field.get_d │ │ │ │ +00023e30: 625f 7072 6570 5f73 6176 653c 2f73 7061 b_prep_save(val, con │ │ │ │ +00023ea0: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection=< │ │ │ │ +00023ec0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>connection │ │ │ │ +00023ee0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +00023f00: 2020 2020 2020 2020 2020 2020 3c73 7061 else │ │ │ │ +00023f20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +00023f40: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00023f50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00023f60: 7661 6c3c 2f73 7061 6e3e 203c 7370 616e val = output_field │ │ │ │ +00023fa0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00023fc0: 7370 616e 2063 6c61 7373 3d22 6e22 3e67 span class="n">g │ │ │ │ +00023fd0: 6574 5f64 625f 7072 6570 5f76 616c 7565 et_db_prep_value │ │ │ │ +00023fe0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00024000: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ +00024010: 616c 3c2f 7370 616e 3e3c 7370 616e 2063 al, connection=conne │ │ │ │ +00024080: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction). │ │ │ │ +000240b0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if hasa │ │ │ │ +000240e0: 7474 723c 2f73 7061 6e3e 3c73 7061 6e20 ttr(output_field, & │ │ │ │ +00024150: 7175 6f74 3b67 6574 5f70 6c61 6365 686f quot;get_placeho │ │ │ │ +00024160: 6c64 6572 2671 756f 743b 3c2f 7370 616e lder"):. │ │ │ │ +00024190: 2020 2020 2020 2020 2020 203c 7370 616e retur │ │ │ │ +000241b0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n output_ │ │ │ │ +000241d0: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field.get_placehol │ │ │ │ +00024210: 6465 723c 2f73 7061 6e3e 3c73 7061 6e20 der(val, compiler, con │ │ │ │ +000242b0: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection), │ │ │ │ +000242d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c [ │ │ │ │ +000242f0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00024300: 7661 6c3c 2f73 7061 6e3e 3c73 7061 6e20 val]. if val │ │ │ │ +00024360: 3c73 7061 6e20 636c 6173 733d 226f 7722 is None │ │ │ │ +00024390: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +000243b0: 2020 2020 2020 2020 2020 2020 3c73 7061 # c │ │ │ │ +000243d0: 785f 4f72 6163 6c65 2064 6f65 7320 6e6f x_Oracle does no │ │ │ │ +000243e0: 7420 616c 7761 7973 2063 6f6e 7665 7274 t always convert │ │ │ │ +000243f0: 204e 6f6e 6520 746f 2074 6865 2061 7070 None to the app │ │ │ │ +00024400: 726f 7072 6961 7465 3c2f 7370 616e 3e0a ropriate. │ │ │ │ +00024410: 2020 2020 2020 2020 2020 2020 3c73 7061 # N │ │ │ │ +00024430: 554c 4c20 7479 7065 2028 6c69 6b65 2069 ULL type (like i │ │ │ │ +00024440: 6e20 6361 7365 2065 7870 7265 7373 696f n case expressio │ │ │ │ +00024450: 6e73 2075 7369 6e67 206e 756d 6265 7273 ns using numbers │ │ │ │ +00024460: 292c 2073 6f20 7765 3c2f 7370 616e 3e0a ), so we. │ │ │ │ +00024470: 2020 2020 2020 2020 2020 2020 3c73 7061 # u │ │ │ │ +00024490: 7365 2061 206c 6974 6572 616c 2053 514c se a literal SQL │ │ │ │ +000244a0: 204e 554c 4c3c 2f73 7061 6e3e 0a20 2020 NULL. │ │ │ │ +000244b0: 2020 2020 2020 2020 203c 7370 616e 2063 return< │ │ │ │ +000244d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "NU │ │ │ │ +000244f0: 4c4c 2671 756f 743b 3c2f 7370 616e 3e3c LL"< │ │ │ │ +00024500: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00024510: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c []. return │ │ │ │ +00024550: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c "< │ │ │ │ +00024570: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>%s │ │ │ │ +00024590: 3c73 7061 6e20 636c 6173 733d 2273 3222 ",< │ │ │ │ +000245c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> [< │ │ │ │ +000245e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ +000245f0: 616c 3c2f 7370 616e 3e3c 7370 616e 2063 al].. def resolve_expre │ │ │ │ +00024650: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion(. se │ │ │ │ +00024690: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, query=< │ │ │ │ +000246e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>None, allow │ │ │ │ +00024730: 5f6a 6f69 6e73 3c2f 7370 616e 3e3c 7370 _joins=True, reuse< │ │ │ │ +000247a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=N │ │ │ │ +000247d0: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one, summarize=Fals │ │ │ │ +00024840: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ +00024860: 203c 7370 616e 2063 6c61 7373 3d22 6e22 for_save │ │ │ │ 00024880: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00024890: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = super< │ │ │ │ -000248b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>()< │ │ │ │ -000248d0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000248e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 resolve_e │ │ │ │ -00024900: 7870 7265 7373 696f 6e3c 2f73 7061 6e3e xpression │ │ │ │ -00024910: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00024920: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (queryFalse. ):. c = s │ │ │ │ +00024920: 7570 6572 3c2f 7370 616e 3e3c 7370 616e uper(), all │ │ │ │ -00024970: 6f77 5f6a 6f69 6e73 3c2f 7370 616e 3e3c ow_joins< │ │ │ │ -00024980: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00024990: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c reuse, sum │ │ │ │ -000249e0: 6d61 7269 7a65 3c2f 7370 616e 3e3c 7370 marize, for_save). │ │ │ │ -00024a40: 2020 2020 2020 3c73 7061 6e20 636c 6173 c.< │ │ │ │ -00024a70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>for_save = < │ │ │ │ -00024ab0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ -00024ac0: 6f72 5f73 6176 653c 2f73 7061 6e3e 0a20 or_save. │ │ │ │ -00024ad0: 2020 2020 2020 203c 7370 616e 2063 6c61 return c.. │ │ │ │ -00024b10: 2020 203c 7370 616e 2063 6c61 7373 3d22 def g │ │ │ │ -00024b40: 6574 5f67 726f 7570 5f62 795f 636f 6c73 et_group_by_cols │ │ │ │ -00024b50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00024b70: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00024b80: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. ret │ │ │ │ -00024bc0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn [].. def _resolve_o │ │ │ │ -00024c20: 7574 7075 745f 6669 656c 643c 2f73 7061 utput_field(self< │ │ │ │ -00024c60: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -00024c80: 2020 2020 2020 2020 3c73 7061 6e20 636c if isinstance(sel │ │ │ │ -00024cf0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00024d10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00024d20: 7661 6c75 653c 2f73 7061 6e3e 3c73 7061 value, str │ │ │ │ -00024d60: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00024d70: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -00024d80: 2020 2020 2020 3c73 7061 6e20 636c 6173 return fields.CharFie │ │ │ │ -00024df0: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld(). if isinstance │ │ │ │ -00024e50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00024e70: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00024e80: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.value< │ │ │ │ -00024ec0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00024ed0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c bool):. │ │ │ │ -00024f10: 2020 2020 2020 2020 2020 3c73 7061 6e20 return │ │ │ │ -00024f30: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Boo │ │ │ │ -00024f80: 6c65 616e 4669 656c 643c 2f73 7061 6e3e leanField │ │ │ │ -00024f90: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00024fa0: 2829 3c2f 7370 616e 3e0a 2020 2020 2020 (). │ │ │ │ -00024fb0: 2020 3c73 7061 6e20 636c 6173 733d 226b if isi │ │ │ │ -00024fe0: 6e73 7461 6e63 653c 2f73 7061 6e3e 3c73 nstance(< │ │ │ │ -00025000: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.value< │ │ │ │ -00025050: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00025070: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -00025080: 696e 743c 2f73 7061 6e3e 3c73 7061 6e20 int):. │ │ │ │ -000250b0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -000250c0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return fi │ │ │ │ -000250e0: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.IntegerField< │ │ │ │ -00025120: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(). │ │ │ │ -00025140: 2020 2020 2020 2020 3c73 7061 6e20 636c if isinstance(sel │ │ │ │ -000251b0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -000251d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000251e0: 7661 6c75 653c 2f73 7061 6e3e 3c73 7061 value, float):. │ │ │ │ -00025240: 2020 2020 2020 2020 3c73 7061 6e20 636c return fields.Float │ │ │ │ -000252b0: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field(). if │ │ │ │ -000252f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c isinsta │ │ │ │ -00025310: 6e63 653c 2f73 7061 6e3e 3c73 7061 6e20 nce(self.< │ │ │ │ -00025360: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>value, datet │ │ │ │ -000253b0: 696d 653c 2f73 7061 6e3e 3c73 7061 6e20 ime.datetime):. │ │ │ │ -00025410: 2020 2020 2020 203c 7370 616e 2063 6c61 return fields.DateTi │ │ │ │ -00025480: 6d65 4669 656c 643c 2f73 7061 6e3e 3c73 meField() │ │ │ │ -000254a0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000254b0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -000254c0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if isins │ │ │ │ -000254e0: 7461 6e63 653c 2f73 7061 6e3e 3c73 7061 tance(self │ │ │ │ -00025520: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00025530: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .value, dat │ │ │ │ -00025580: 6574 696d 653c 2f73 7061 6e3e 3c73 7061 etime.date< │ │ │ │ -000255c0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -000255d0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -000255e0: 2020 2020 203c 7370 616e 2063 6c61 7373 return fields │ │ │ │ -00025620: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00025630: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .DateFiel │ │ │ │ -00025650: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d(). if isinstance< │ │ │ │ -000256b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -000256e0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.value,< │ │ │ │ -00025730: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> datetime< │ │ │ │ -00025750: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ti │ │ │ │ -00025780: 6d65 3c2f 7370 616e 3e3c 7370 616e 2063 me):. < │ │ │ │ -000257b0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ -000257c0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn fie │ │ │ │ -000257e0: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.TimeField(). │ │ │ │ -00025840: 2020 2020 3c73 7061 6e20 636c 6173 733d if i │ │ │ │ -00025870: 7369 6e73 7461 6e63 653c 2f73 7061 6e3e sinstance │ │ │ │ -00025880: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00025890: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self.valu │ │ │ │ -000258e0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ -00025900: 203c 7370 616e 2063 6c61 7373 3d22 6e22 datetime │ │ │ │ -00025920: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00025930: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .timedelt │ │ │ │ -00025950: 613c 2f73 7061 6e3e 3c73 7061 6e20 636c a):. re │ │ │ │ -00025990: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn fiel │ │ │ │ -000259b0: 6473 3c2f 7370 616e 3e3c 7370 616e 2063 ds.DurationField(). │ │ │ │ -00025a10: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ -00025a30: 203c 7370 616e 2063 6c61 7373 3d22 6e62 isinstance(self │ │ │ │ -00025a80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00025aa0: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ -00025ab0: 616c 7565 3c2f 7370 616e 3e3c 7370 616e alue, Decimal):. │ │ │ │ -00025b10: 2020 2020 2020 2020 3c73 7061 6e20 636c return fields.Decim │ │ │ │ -00025b80: 616c 4669 656c 643c 2f73 7061 6e3e 3c73 alField() │ │ │ │ -00025ba0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00025bb0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00025bc0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if isins │ │ │ │ -00025be0: 7461 6e63 653c 2f73 7061 6e3e 3c73 7061 tance(self │ │ │ │ -00025c20: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00025c30: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .value, by │ │ │ │ -00025c80: 7465 733c 2f73 7061 6e3e 3c73 7061 6e20 tes):. │ │ │ │ -00025cb0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00025cc0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return fi │ │ │ │ -00025ce0: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.BinaryField(). │ │ │ │ -00025d40: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ -00025d60: 203c 7370 616e 2063 6c61 7373 3d22 6e62 isinstance(self │ │ │ │ -00025db0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00025dd0: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ -00025de0: 616c 7565 3c2f 7370 616e 3e3c 7370 616e alue, UUID< │ │ │ │ -00025e20: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00025e30: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00025e40: 2020 2020 203c 7370 616e 2063 6c61 7373 return fields │ │ │ │ -00025e80: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00025e90: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .UUIDFiel │ │ │ │ -00025eb0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d().. @propert │ │ │ │ -00025ef0: 793c 2f73 7061 6e3e 0a20 2020 203c 7370 y. def │ │ │ │ -00025f10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c empty_r │ │ │ │ -00025f30: 6573 756c 745f 7365 745f 7661 6c75 653c esult_set_value< │ │ │ │ -00025f40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -00025f70: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. retu │ │ │ │ -00025fb0: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn self< │ │ │ │ -00025fd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.va │ │ │ │ -00026000: 6c75 653c 2f73 7061 6e3e 3c2f 6469 763e lue
│ │ │ │ -00026010: 0a0a 0a0a 3c64 6976 2063 6c61 7373 3d22 ....
.[docs]< │ │ │ │ -000260b0: 2f61 3e0a 3c73 7061 6e20 636c 6173 733d /a>.class │ │ │ │ -000260d0: 203c 7370 616e 2063 6c61 7373 3d22 6e63 RawSQL< │ │ │ │ -000260f0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00026100: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 Expressio │ │ │ │ -00026120: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n):. def │ │ │ │ -00026160: 203c 7370 616e 2063 6c61 7373 3d22 666d __init__(self, sq │ │ │ │ -000261e0: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l, │ │ │ │ -00026200: 203c 7370 616e 2063 6c61 7373 3d22 6e22 params,< │ │ │ │ -00026230: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> output_fi │ │ │ │ -00026250: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld=None): │ │ │ │ -000262a0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000262b0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -000262c0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if output │ │ │ │ -000262e0: 5f66 6965 6c64 3c2f 7370 616e 3e20 3c73 _field i │ │ │ │ -00026300: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s None:. │ │ │ │ -00026340: 2020 2020 2020 2020 2020 3c73 7061 6e20 output │ │ │ │ -00026360: 5f66 6965 6c64 3c2f 7370 616e 3e20 3c73 _field =< │ │ │ │ -00026380: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> fields.Fiel │ │ │ │ -000263d0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d(). self< │ │ │ │ -00026410: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.sq │ │ │ │ -00026440: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l, │ │ │ │ -00026460: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.params = sql< │ │ │ │ -000264e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00026500: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ -00026510: 6172 616d 733c 2f73 7061 6e3e 0a20 2020 arams. │ │ │ │ -00026520: 2020 2020 203c 7370 616e 2063 6c61 7373 super().__init__(outpu │ │ │ │ -000265c0: 745f 6669 656c 643c 2f73 7061 6e3e 3c73 t_field=< │ │ │ │ -000265e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>output_fie │ │ │ │ -00026600: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld).. def __repr__(self< │ │ │ │ -00026690: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -000266b0: 2020 2020 2020 2020 3c73 7061 6e20 636c return ".reso │ │ │ │ +00024970: 6c76 655f 6578 7072 6573 7369 6f6e 3c2f lve_expression(que │ │ │ │ +000249b0: 7279 3c2f 7370 616e 3e3c 7370 616e 2063 ry, allow_joins, reu │ │ │ │ +00024a20: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se, summarize, for_s │ │ │ │ +00024a90: 6176 653c 2f73 7061 6e3e 3c73 7061 6e20 ave). c.for_s │ │ │ │ +00024b00: 6176 653c 2f73 7061 6e3e 203c 7370 616e ave = for_save. retu │ │ │ │ +00024b60: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn c.. def get_group_by │ │ │ │ +00024bc0: 5f63 6f6c 733c 2f73 7061 6e3e 3c73 7061 _cols(self │ │ │ │ +00024c00: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00024c10: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +00024c20: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ +00024c40: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00024c50: 5b5d 3c2f 7370 616e 3e0a 0a20 2020 203c [].. < │ │ │ │ +00024c60: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +00024c70: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef _reso │ │ │ │ +00024c90: 6c76 655f 6f75 7470 7574 5f66 6965 6c64 lve_output_field │ │ │ │ +00024ca0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00024cc0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00024cd0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. if< │ │ │ │ +00024d10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> isinstan │ │ │ │ +00024d30: 6365 3c2f 7370 616e 3e3c 7370 616e 2063 ce(self.value, str):. │ │ │ │ +00024df0: 2020 2020 2020 2020 2020 203c 7370 616e retur │ │ │ │ +00024e10: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n fields< │ │ │ │ +00024e30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Ch │ │ │ │ +00024e60: 6172 4669 656c 643c 2f73 7061 6e3e 3c73 arField() │ │ │ │ +00024e80: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00024e90: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00024ea0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if isins │ │ │ │ +00024ec0: 7461 6e63 653c 2f73 7061 6e3e 3c73 7061 tance(self │ │ │ │ +00024f00: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00024f10: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .value, bo │ │ │ │ +00024f60: 6f6c 3c2f 7370 616e 3e3c 7370 616e 2063 ol):. < │ │ │ │ +00024f90: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +00024fa0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn fie │ │ │ │ +00024fc0: 6c64 733c 2f73 7061 6e3e 3c73 7061 6e20 lds.BooleanField(). │ │ │ │ +00025020: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ +00025040: 203c 7370 616e 2063 6c61 7373 3d22 6e62 isinstance(self │ │ │ │ +00025090: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000250b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ +000250c0: 616c 7565 3c2f 7370 616e 3e3c 7370 616e alue, int< │ │ │ │ +00025100: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00025110: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +00025120: 2020 2020 203c 7370 616e 2063 6c61 7373 return fields │ │ │ │ +00025160: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00025170: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .IntegerF │ │ │ │ +00025190: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield(). if< │ │ │ │ +000251d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> isinstan │ │ │ │ +000251f0: 6365 3c2f 7370 616e 3e3c 7370 616e 2063 ce(self.value, float │ │ │ │ +00025290: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +000252b0: 0a20 2020 2020 2020 2020 2020 203c 7370 . ret │ │ │ │ +000252d0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn field │ │ │ │ +000252f0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00025310: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00025320: 466c 6f61 7446 6965 6c64 3c2f 7370 616e FloatField(). │ │ │ │ +00025350: 2020 203c 7370 616e 2063 6c61 7373 3d22 if is │ │ │ │ +00025380: 696e 7374 616e 6365 3c2f 7370 616e 3e3c instance< │ │ │ │ +00025390: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +000253a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.value │ │ │ │ +000253f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00025410: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00025420: 6461 7465 7469 6d65 3c2f 7370 616e 3e3c datetime< │ │ │ │ +00025430: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00025440: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 datetime< │ │ │ │ +00025460: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ +00025480: 2020 2020 2020 2020 2020 2020 3c73 7061 retu │ │ │ │ +000254a0: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn fields │ │ │ │ +000254c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000254e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e44 span class="n">D │ │ │ │ +000254f0: 6174 6554 696d 6546 6965 6c64 3c2f 7370 ateTimeField(). │ │ │ │ +00025520: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +00025540: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +00025550: 6973 696e 7374 616e 6365 3c2f 7370 616e isinstance(self.val │ │ │ │ +000255c0: 7565 3c2f 7370 616e 3e3c 7370 616e 2063 ue, datetime.date):. │ │ │ │ +00025650: 2020 2020 2020 2020 2020 3c73 7061 6e20 return │ │ │ │ +00025670: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.Dat │ │ │ │ +000256c0: 6546 6965 6c64 3c2f 7370 616e 3e3c 7370 eField()< │ │ │ │ +000256e0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +000256f0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ +00025700: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f isinst │ │ │ │ +00025720: 616e 6365 3c2f 7370 616e 3e3c 7370 616e ance(self< │ │ │ │ +00025760: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00025770: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 value, date │ │ │ │ +000257c0: 7469 6d65 3c2f 7370 616e 3e3c 7370 616e time.time): │ │ │ │ +00025810: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00025820: 2020 2020 3c73 7061 6e20 636c 6173 733d return fields< │ │ │ │ +00025860: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00025870: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 TimeField │ │ │ │ +00025890: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 () │ │ │ │ +000258b0: 0a20 2020 2020 2020 203c 7370 616e 2063 . if isinstance(se │ │ │ │ +00025920: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.value, datetime.tim │ │ │ │ +000259c0: 6564 656c 7461 3c2f 7370 616e 3e3c 7370 edelta):< │ │ │ │ +000259e0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +000259f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ +00025a10: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ +00025a40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>DurationFi │ │ │ │ +00025a60: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld(). if isinstanc │ │ │ │ +00025ac0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ +00025ae0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.value │ │ │ │ +00025b30: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00025b40: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , Decimal │ │ │ │ +00025b60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +00025b80: 0a20 2020 2020 2020 2020 2020 203c 7370 . ret │ │ │ │ +00025ba0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn field │ │ │ │ +00025bc0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00025be0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00025bf0: 4465 6369 6d61 6c46 6965 6c64 3c2f 7370 DecimalField(). │ │ │ │ +00025c20: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +00025c40: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +00025c50: 6973 696e 7374 616e 6365 3c2f 7370 616e isinstance(self.val │ │ │ │ +00025cc0: 7565 3c2f 7370 616e 3e3c 7370 616e 2063 ue, bytes< │ │ │ │ +00025d00: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00025d10: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +00025d20: 2020 2020 203c 7370 616e 2063 6c61 7373 return fields │ │ │ │ +00025d60: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00025d70: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .BinaryFi │ │ │ │ +00025d90: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld(). if isinstanc │ │ │ │ +00025df0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ +00025e10: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.value │ │ │ │ +00025e60: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00025e70: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , UUID):. │ │ │ │ +00025eb0: 2020 2020 2020 2020 2020 3c73 7061 6e20 return │ │ │ │ +00025ed0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c fields.UUI │ │ │ │ +00025f20: 4446 6965 6c64 3c2f 7370 616e 3e3c 7370 DField()< │ │ │ │ +00025f40: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. @pr │ │ │ │ +00025f60: 6f70 6572 7479 3c2f 7370 616e 3e0a 2020 operty. │ │ │ │ +00025f70: 2020 3c73 7061 6e20 636c 6173 733d 226b def em │ │ │ │ +00025fa0: 7074 795f 7265 7375 6c74 5f73 6574 5f76 pty_result_set_v │ │ │ │ +00025fb0: 616c 7565 3c2f 7370 616e 3e3c 7370 616e alue(self< │ │ │ │ +00025ff0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00026000: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +00026010: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +00026030: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00026040: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.value< │ │ │ │ +00026080: 2f64 6976 3e0a 0a0a 0a3c 6469 7620 636c /div>....
.[d │ │ │ │ +00026120: 6f63 756d 656e 7469 5d3c 2f61 3e0a 3c73 ocumenti].cl │ │ │ │ +00026140: 6173 733c 2f73 7061 6e3e 203c 7370 616e ass RawS │ │ │ │ +00026160: 514c 3c2f 7370 616e 3e3c 7370 616e 2063 QL(Expression):. │ │ │ │ +000261c0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +000261d0: 6465 663c 2f73 7061 6e3e 203c 7370 616e def __in │ │ │ │ +000261f0: 6974 5f5f 3c2f 7370 616e 3e3c 7370 616e it__(self< │ │ │ │ +00026230: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00026240: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c sql, param │ │ │ │ +00026290: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s, │ │ │ │ +000262b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 output_field=Non │ │ │ │ +00026300: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e):. if output_field │ │ │ │ +00026360: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c is None< │ │ │ │ +000263a0: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ +000263b0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +000263c0: 2020 2020 3c73 7061 6e20 636c 6173 733d output_field │ │ │ │ +000263e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +00026400: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ +00026430: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>Field(). │ │ │ │ +00026470: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +00026490: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000264a0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .sql, self │ │ │ │ +000264f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00026510: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ +00026520: 6172 616d 733c 2f73 7061 6e3e 203c 7370 arams = sql │ │ │ │ +00026560: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00026570: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , params< │ │ │ │ +00026590: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +000265a0: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +000265b0: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().__ │ │ │ │ +00026600: 696e 6974 5f5f 3c2f 7370 616e 3e3c 7370 init__(output_fiel │ │ │ │ +00026640: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d= │ │ │ │ +00026660: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00026670: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field).. │ │ │ │ +000266a0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def __r │ │ │ │ +000266d0: 6570 725f 5f3c 2f73 7061 6e3e 3c73 7061 epr__({}( │ │ │ │ -00026720: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 {}, {})".form │ │ │ │ -000267c0: 6174 3c2f 7370 616e 3e3c 7370 616e 2063 at(self.__class__< │ │ │ │ -00026830: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ -00026860: 5f6e 616d 655f 5f3c 2f73 7061 6e3e 3c73 _name__,< │ │ │ │ -00026880: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.sql, s │ │ │ │ -00026900: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.params< │ │ │ │ -00026940: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00026950: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -00026970: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c as_sql< │ │ │ │ -00026990: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -000269c0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, compiler, conne │ │ │ │ -00026a30: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction):. re │ │ │ │ -00026a70: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn &qu │ │ │ │ -00026a90: 6f74 3b28 3c2f 7370 616e 3e3c 7370 616e ot;(%s)" % s │ │ │ │ -00026b00: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.sql, self.params< │ │ │ │ -00026ba0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ -00026bc0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> get_grou │ │ │ │ -00026be0: 705f 6279 5f63 6f6c 733c 2f73 7061 6e3e p_by_cols │ │ │ │ -00026bf0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00026c00: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ -00026c40: 2020 2020 2020 3c73 7061 6e20 636c 6173 return [sel │ │ │ │ -00026c90: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f] │ │ │ │ -00026cb0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -00026cd0: 203c 7370 616e 2063 6c61 7373 3d22 6e66 resolve_expres │ │ │ │ -00026cf0: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion(. sel │ │ │ │ -00026d30: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ -00026d50: 203c 7370 616e 2063 6c61 7373 3d22 6e22 query=None, allow_ │ │ │ │ -00026dd0: 6a6f 696e 733c 2f73 7061 6e3e 3c73 7061 joins=True │ │ │ │ -00026e10: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00026e20: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , reuse=No │ │ │ │ -00026e70: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne, summarize=False │ │ │ │ -00026ee0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00026f00: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00026f10: 666f 725f 7361 7665 3c2f 7370 616e 3e3c for_save< │ │ │ │ -00026f20: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00026f30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 False. ):. # Re │ │ │ │ -00026f90: 736f 6c76 6520 7061 7265 6e74 7320 6669 solve parents fi │ │ │ │ -00026fa0: 656c 6473 2075 7365 6420 696e 2072 6177 elds used in raw │ │ │ │ -00026fb0: 2053 514c 2e3c 2f73 7061 6e3e 0a20 2020 SQL.. │ │ │ │ -00026fc0: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ -00026fe0: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ -00026ff0: 7565 7279 3c2f 7370 616e 3e3c 7370 616e uery.model< │ │ │ │ -00027030: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ -00027040: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00027050: 2020 2020 3c73 7061 6e20 636c 6173 733d for < │ │ │ │ -00027070: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ -00027080: 6172 656e 743c 2f73 7061 6e3e 203c 7370 arent in │ │ │ │ -000270a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c query.mode │ │ │ │ -000270f0: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l. │ │ │ │ -00027110: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00027120: 5f6d 6574 613c 2f73 7061 6e3e 3c73 7061 _meta.get_parent_l │ │ │ │ -00027160: 6973 743c 2f73 7061 6e3e 3c73 7061 6e20 ist():. │ │ │ │ -00027190: 2020 2020 203c 7370 616e 2063 6c61 7373 for │ │ │ │ -000271b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000271c0: 7061 7265 6e74 5f66 6965 6c64 3c2f 7370 parent_field in < │ │ │ │ -000271f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ -00027200: 6172 656e 743c 2f73 7061 6e3e 3c73 7061 arent._meta │ │ │ │ -00027240: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00027250: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .local_fi │ │ │ │ -00027270: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds:. │ │ │ │ -000272a0: 2020 2020 2020 2020 3c73 7061 6e20 636c _ │ │ │ │ -000272c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000272d0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , column_ │ │ │ │ -000272f0: 6e61 6d65 3c2f 7370 616e 3e20 3c73 7061 name = parent_fiel │ │ │ │ -00027330: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d. │ │ │ │ -00027350: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00027360: 6765 745f 6174 746e 616d 655f 636f 6c75 get_attname_colu │ │ │ │ -00027370: 6d6e 3c2f 7370 616e 3e3c 7370 616e 2063 mn(). │ │ │ │ -000273a0: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ -000273c0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 column_name.lower │ │ │ │ -00027410: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 () │ │ │ │ -00027430: 203c 7370 616e 2063 6c61 7373 3d22 6f77 in sel │ │ │ │ -00027460: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00027480: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00027490: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql.lower() │ │ │ │ -000274e0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -000274f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00027500: 203c 7370 616e 2063 6c61 7373 3d22 6e22 query.resolve_ref │ │ │ │ -00027550: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (. │ │ │ │ -00027570: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00027580: 2020 2020 2020 2020 2020 2020 3c73 7061 pare │ │ │ │ -000275a0: 6e74 5f66 6965 6c64 3c2f 7370 616e 3e3c nt_field< │ │ │ │ -000275b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000275c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 name, allow │ │ │ │ -00027610: 5f6a 6f69 6e73 3c2f 7370 616e 3e3c 7370 _joins, reuse, summa │ │ │ │ -00027680: 7269 7a65 3c2f 7370 616e 3e0a 2020 2020 rize. │ │ │ │ -00027690: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000276a0: 2020 2020 3c73 7061 6e20 636c 6173 733d ). │ │ │ │ -000276c0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000276d0: 2020 2020 203c 7370 616e 2063 6c61 7373 break. return │ │ │ │ -00027710: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c super().< │ │ │ │ -00027760: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>resolve_ex │ │ │ │ -00027780: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ -00027790: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -000277a0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000277b0: 2020 2020 3c73 7061 6e20 636c 6173 733d query │ │ │ │ -000277d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000277e0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , allow_j │ │ │ │ -00027800: 6f69 6e73 3c2f 7370 616e 3e3c 7370 616e oins, reuse │ │ │ │ -00027840: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00027850: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , summari │ │ │ │ -00027870: 7a65 3c2f 7370 616e 3e3c 7370 616e 2063 ze, for_save. )
....clas │ │ │ │ -000278f0: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s Star(Exp │ │ │ │ -00027940: 7265 7373 696f 6e3c 2f73 7061 6e3e 3c73 ression): │ │ │ │ -00027960: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . def< │ │ │ │ -00027980: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> __repr__ │ │ │ │ +00026700: 2262 7022 3e73 656c 663c 2f73 7061 6e3e "bp">self │ │ │ │ +00026710: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00026720: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +00026730: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ +00026750: 3c73 7061 6e20 636c 6173 733d 2273 3222 "{ │ │ │ │ +00026780: 7d3c 2f73 7061 6e3e 3c73 7061 6e20 636c }({}, {}< │ │ │ │ +000267f0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00026800: 2926 7175 6f74 3b3c 2f73 7061 6e3e 3c73 )".< │ │ │ │ +00026820: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>format(self │ │ │ │ +00026870: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00026890: 7370 616e 2063 6c61 7373 3d22 766d 223e span class="vm"> │ │ │ │ +000268a0: 5f5f 636c 6173 735f 5f3c 2f73 7061 6e3e __class__ │ │ │ │ +000268b0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000268c0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .__name_ │ │ │ │ +000268e0: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c _, │ │ │ │ +00026900: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.sql< │ │ │ │ +00026950: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00026960: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.para │ │ │ │ +000269b0: 6d73 3c2f 7370 616e 3e3c 7370 616e 2063 ms).. def as_sql │ │ │ │ +00026a10: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00026a20: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self, com │ │ │ │ +00026a70: 7069 6c65 723c 2f73 7061 6e3e 3c73 7061 piler, connection< │ │ │ │ +00026ab0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ +00026ad0: 2020 2020 2020 2020 3c73 7061 6e20 636c return "(%s< │ │ │ │ +00026b30: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00026b40: 2926 7175 6f74 3b3c 2f73 7061 6e3e 203c )" < │ │ │ │ +00026b50: 7370 616e 2063 6c61 7373 3d22 6f22 3e25 span class="o">% │ │ │ │ +00026b60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.sql< │ │ │ │ +00026bb0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00026bd0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00026be0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.params │ │ │ │ +00026c20: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ +00026c40: 203c 7370 616e 2063 6c61 7373 3d22 6e66 get_group_by_c │ │ │ │ +00026c60: 6f6c 733c 2f73 7061 6e3e 3c73 7061 6e20 ols(self): │ │ │ │ +00026cb0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00026cc0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00026cd0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return [< │ │ │ │ +00026cf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self].. │ │ │ │ +00026d30: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00026d40: 6465 663c 2f73 7061 6e3e 203c 7370 616e def reso │ │ │ │ +00026d60: 6c76 655f 6578 7072 6573 7369 6f6e 3c2f lve_expression(. │ │ │ │ +00026d90: 2020 2020 2020 3c73 7061 6e20 636c 6173 self, query │ │ │ │ +00026de0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 =< │ │ │ │ +00026e00: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ +00026e10: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e None, allow_joins< │ │ │ │ +00026e50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=T │ │ │ │ +00026e80: 7275 653c 2f73 7061 6e3e 3c73 7061 6e20 rue, reuse< │ │ │ │ +00026ec0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00026ed0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 None, summ │ │ │ │ +00026f20: 6172 697a 653c 2f73 7061 6e3e 3c73 7061 arize=False, for_sa │ │ │ │ +00026f90: 7665 3c2f 7370 616e 3e3c 7370 616e 2063 ve=False. │ │ │ │ +00026fd0: 2020 203c 7370 616e 2063 6c61 7373 3d22 ):. │ │ │ │ +00026ff0: 2020 2020 203c 7370 616e 2063 6c61 7373 # Resolve │ │ │ │ +00027010: 7061 7265 6e74 7320 6669 656c 6473 2075 parents fields u │ │ │ │ +00027020: 7365 6420 696e 2072 6177 2053 514c 2e3c sed in raw SQL.< │ │ │ │ +00027030: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00027040: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ +00027050: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f query.mod │ │ │ │ +000270a0: 656c 3c2f 7370 616e 3e3c 7370 616e 2063 el:. fo │ │ │ │ +000270e0: 723c 2f73 7061 6e3e 203c 7370 616e 2063 r parent< │ │ │ │ +00027100: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> in query.< │ │ │ │ +00027150: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>model._meta< │ │ │ │ +000271a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ge │ │ │ │ +000271d0: 745f 7061 7265 6e74 5f6c 6973 743c 2f73 t_parent_list():. │ │ │ │ +00027200: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +00027210: 7370 616e 2063 6c61 7373 3d22 6b22 3e66 span class="k">f │ │ │ │ +00027220: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or parent │ │ │ │ +00027240: 5f66 6965 6c64 3c2f 7370 616e 3e20 3c73 _field i │ │ │ │ +00027260: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n parent< │ │ │ │ +00027280: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._m │ │ │ │ +000272b0: 6574 613c 2f73 7061 6e3e 3c73 7061 6e20 eta.local_fields:. │ │ │ │ +00027310: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00027320: 2020 3c73 7061 6e20 636c 6173 733d 226e _, column_name = < │ │ │ │ +00027390: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ +000273a0: 6172 656e 745f 6669 656c 643c 2f73 7061 arent_field.get_at │ │ │ │ +000273e0: 746e 616d 655f 636f 6c75 6d6e 3c2f 7370 tname_column(). │ │ │ │ +00027410: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00027420: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if colum │ │ │ │ +00027450: 6e5f 6e61 6d65 3c2f 7370 616e 3e3c 7370 n_name.lower() in self.sql.lowe │ │ │ │ +00027540: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r():. │ │ │ │ +00027570: 2020 2020 2020 2020 2020 203c 7370 616e query │ │ │ │ +00027590: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000275b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ +000275c0: 6573 6f6c 7665 5f72 6566 3c2f 7370 616e esolve_ref(. │ │ │ │ +000275f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00027600: 2020 2020 2020 3c73 7061 6e20 636c 6173 parent_fie │ │ │ │ +00027620: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld.name, allow_joins │ │ │ │ +00027690: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +000276b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000276c0: 7265 7573 653c 2f73 7061 6e3e 3c73 7061 reuse, summarize. │ │ │ │ +00027710: 2020 2020 2020 2020 2020 2020 2020 3c73 )< │ │ │ │ +00027730: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00027740: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +00027750: 7370 616e 2063 6c61 7373 3d22 6b22 3e62 span class="k">b │ │ │ │ +00027760: 7265 616b 3c2f 7370 616e 3e0a 2020 2020 reak. │ │ │ │ +00027770: 2020 2020 3c73 7061 6e20 636c 6173 733d return super< │ │ │ │ +000277b0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +000277c0: 293c 2f73 7061 6e3e 3c73 7061 6e20 636c ). │ │ │ │ +000277e0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000277f0: 7265 736f 6c76 655f 6578 7072 6573 7369 resolve_expressi │ │ │ │ +00027800: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(. qu │ │ │ │ +00027840: 6572 793c 2f73 7061 6e3e 3c73 7061 6e20 ery, allow_joins, re │ │ │ │ +000278b0: 7573 653c 2f73 7061 6e3e 3c73 7061 6e20 use, summarize, for_ │ │ │ │ +00027920: 7361 7665 3c2f 7370 616e 3e0a 2020 2020 save. │ │ │ │ +00027930: 2020 2020 3c73 7061 6e20 636c 6173 733d )....class Star< │ │ │ │ +00027990: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ 000279a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -000279c0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -000279d0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. ret │ │ │ │ -00027a10: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn &quo │ │ │ │ -00027a30: 743b 2623 3339 3b2a 2623 3339 3b26 7175 t;'*'&qu │ │ │ │ -00027a40: 6f74 3b3c 2f73 7061 6e3e 0a0a 2020 2020 ot;.. │ │ │ │ -00027a50: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00027a60: 6465 663c 2f73 7061 6e3e 203c 7370 616e def as_s │ │ │ │ -00027a80: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql(self, compiler, co │ │ │ │ -00027b20: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ -00027b30: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00027b40: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00027b50: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -00027b70: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -00027b80: 2671 756f 743b 2a26 7175 6f74 3b3c 2f73 "*", []< │ │ │ │ -00027bc0: 2f73 7061 6e3e 0a0a 0a3c 7370 616e 2063 /span>...class Col(Express │ │ │ │ -00027c30: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion):. contains │ │ │ │ -00027c70: 5f63 6f6c 756d 6e5f 7265 6665 7265 6e63 _column_referenc │ │ │ │ -00027c80: 6573 3c2f 7370 616e 3e20 3c73 7061 6e20 es = True. │ │ │ │ -00027cc0: 2020 2020 3c73 7061 6e20 636c 6173 733d possibly_mul │ │ │ │ -00027ce0: 7469 7661 6c75 6564 3c2f 7370 616e 3e20 tivalued │ │ │ │ -00027cf0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00027d00: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = False< │ │ │ │ -00027d20: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ -00027d40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> __init__ │ │ │ │ -00027d60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00027d80: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00027d90: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self, alias │ │ │ │ -00027dd0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00027de0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , target< │ │ │ │ -00027e00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00027e20: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -00027e30: 7574 7075 745f 6669 656c 643c 2f73 7061 utput_field=None< │ │ │ │ -00027e70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -00027e90: 2020 2020 2020 2020 3c73 7061 6e20 636c if output_field is │ │ │ │ -00027ef0: 203c 7370 616e 2063 6c61 7373 3d22 6b63 None:. │ │ │ │ -00027f30: 2020 3c73 7061 6e20 636c 6173 733d 226e output_field = < │ │ │ │ -00027f70: 7370 616e 2063 6c61 7373 3d22 6e22 3e74 span class="n">t │ │ │ │ -00027f80: 6172 6765 743c 2f73 7061 6e3e 0a20 2020 arget. │ │ │ │ -00027f90: 2020 2020 203c 7370 616e 2063 6c61 7373 super().__init__(outpu │ │ │ │ -00028030: 745f 6669 656c 643c 2f73 7061 6e3e 3c73 t_field=< │ │ │ │ -00028050: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>output_fie │ │ │ │ -00028070: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld). self< │ │ │ │ -000280b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.al │ │ │ │ -000280e0: 6961 733c 2f73 7061 6e3e 3c73 7061 6e20 ias, self< │ │ │ │ -00028120: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00028130: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 target = al │ │ │ │ -00028180: 6961 733c 2f73 7061 6e3e 3c73 7061 6e20 ias, target │ │ │ │ -000281c0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -000281e0: 203c 7370 616e 2063 6c61 7373 3d22 666d __repr__(self):. │ │ │ │ -00028250: 2020 2020 2020 203c 7370 616e 2063 6c61 alias, targ │ │ │ │ -000282a0: 6574 3c2f 7370 616e 3e20 3c73 7061 6e20 et = self< │ │ │ │ -000282e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000282f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 alias, sel │ │ │ │ -00028340: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00028360: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00028370: 7461 7267 6574 3c2f 7370 616e 3e0a 2020 target. │ │ │ │ -00028380: 2020 2020 2020 3c73 7061 6e20 636c 6173 identifier │ │ │ │ -000283a0: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = (alias< │ │ │ │ -000283f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00028410: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -00028420: 7374 723c 2f73 7061 6e3e 3c73 7061 6e20 str(target< │ │ │ │ -00028460: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00028470: 293c 2f73 7061 6e3e 203c 7370 616e 2063 ) if alias │ │ │ │ -000284b0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -000284c0: 656c 7365 3c2f 7370 616e 3e20 3c73 7061 else (str< │ │ │ │ -00028500: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00028510: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 target),). │ │ │ │ -00028550: 2020 2020 2020 203c 7370 616e 2063 6c61 return "{}(< │ │ │ │ -000285c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>{} │ │ │ │ -000285e0: 3c73 7061 6e20 636c 6173 733d 2273 3222 )"< │ │ │ │ -00028600: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00028610: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 format(sel │ │ │ │ -00028660: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00028680: 3c73 7061 6e20 636c 6173 733d 2276 6d22 __class__.__name │ │ │ │ -000286d0: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __, ", " │ │ │ │ -00028710: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;. │ │ │ │ -00028730: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00028740: 6a6f 696e 3c2f 7370 616e 3e3c 7370 616e join(identifiers)).. │ │ │ │ -000287a0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -000287c0: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ -000287d0: 6173 5f73 716c 3c2f 7370 616e 3e3c 7370 as_sql(self, compil │ │ │ │ -00028840: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er, connection):. │ │ │ │ -000288a0: 2020 2020 203c 7370 616e 2063 6c61 7373 alias, column │ │ │ │ -000288f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -00028910: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.alias, self< │ │ │ │ -00028990: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ta │ │ │ │ -000289c0: 7267 6574 3c2f 7370 616e 3e3c 7370 616e rget.column │ │ │ │ -00028a00: 0a20 2020 2020 2020 203c 7370 616e 2063 . identif │ │ │ │ -00028a20: 6965 7273 3c2f 7370 616e 3e20 3c73 7061 iers = (ali │ │ │ │ -00028a70: 6173 3c2f 7370 616e 3e3c 7370 616e 2063 as, column< │ │ │ │ -00028ab0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00028ac0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c if alias < │ │ │ │ -00028b00: 7370 616e 2063 6c61 7373 3d22 6b22 3e65 span class="k">e │ │ │ │ -00028b10: 6c73 653c 2f73 7061 6e3e 203c 7370 616e lse (column │ │ │ │ -00028b50: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00028b60: 2c29 3c2f 7370 616e 3e0a 2020 2020 2020 ,). │ │ │ │ -00028b70: 2020 3c73 7061 6e20 636c 6173 733d 226e sql = ".&q │ │ │ │ -00028bc0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;.join(< │ │ │ │ -00028c10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>map(compile │ │ │ │ -00028c60: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r. │ │ │ │ -00028c80: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00028c90: 7175 6f74 655f 6e61 6d65 5f75 6e6c 6573 quote_name_unles │ │ │ │ -00028ca0: 735f 616c 6961 733c 2f73 7061 6e3e 3c73 s_alias,< │ │ │ │ -00028cc0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> identifie │ │ │ │ -00028ce0: 7273 3c2f 7370 616e 3e3c 7370 616e 2063 rs)). retur │ │ │ │ -00028d20: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n sql, [].. def relabeled │ │ │ │ -00028db0: 5f63 6c6f 6e65 3c2f 7370 616e 3e3c 7370 _clone(self, relabe │ │ │ │ -00028e20: 6c73 3c2f 7370 616e 3e3c 7370 616e 2063 ls):. if self.alias is │ │ │ │ -00028ed0: 203c 7370 616e 2063 6c61 7373 3d22 6b63 None:. │ │ │ │ -00028f10: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ -00028f30: 3c73 7061 6e20 636c 6173 733d 2262 7022 self. │ │ │ │ -00028f50: 2020 2020 203c 7370 616e 2063 6c61 7373 return self< │ │ │ │ -00028f90: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00028fa0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __class_ │ │ │ │ -00028fc0: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c _( │ │ │ │ -00028fe0: 0a20 2020 2020 2020 2020 2020 203c 7370 . rel │ │ │ │ -00029000: 6162 656c 733c 2f73 7061 6e3e 3c73 7061 abels.get(< │ │ │ │ -00029050: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.alias< │ │ │ │ -000290a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -000290c0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -000290d0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.alias< │ │ │ │ -00029110: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00029120: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , self.tar │ │ │ │ -00029170: 6765 743c 2f73 7061 6e3e 3c73 7061 6e20 get, self< │ │ │ │ -000291b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000291c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 output_fi │ │ │ │ -000291e0: 656c 643c 2f73 7061 6e3e 0a20 2020 2020 eld. │ │ │ │ -000291f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 ).. │ │ │ │ -00029210: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def get │ │ │ │ -00029240: 5f67 726f 7570 5f62 795f 636f 6c73 3c2f _group_by_cols(se │ │ │ │ -00029280: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf):. retur │ │ │ │ -000292c0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n [self].. def get_db_co │ │ │ │ -00029350: 6e76 6572 7465 7273 3c2f 7370 616e 3e3c nverters< │ │ │ │ -00029360: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +000279b0: 7373 3d22 6e22 3e45 7870 7265 7373 696f ss="n">Expressio │ │ │ │ +000279c0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n):. def │ │ │ │ +00027a00: 203c 7370 616e 2063 6c61 7373 3d22 666d __repr__(self):. │ │ │ │ +00027a70: 2020 2020 2020 203c 7370 616e 2063 6c61 return "' │ │ │ │ +00027ab0: 3b2a 2623 3339 3b26 7175 6f74 3b3c 2f73 ;*'".. def as_sql(self │ │ │ │ +00027b30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00027b50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00027b60: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ +00027b70: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00027b80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ +00027ba0: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on):. retur │ │ │ │ +00027be0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n " │ │ │ │ +00027c00: 2a26 7175 6f74 3b3c 2f73 7061 6e3e 3c73 *",< │ │ │ │ +00027c20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> [] │ │ │ │ +00027c40: 0a0a 0a3c 7370 616e 2063 6c61 7373 3d22 ...class │ │ │ │ +00027c60: 3c73 7061 6e20 636c 6173 733d 226e 6322 Col(Expression):. │ │ │ │ +00027cd0: 2020 3c73 7061 6e20 636c 6173 733d 226e contains_colum │ │ │ │ +00027cf0: 6e5f 7265 6665 7265 6e63 6573 3c2f 7370 n_references = Tr │ │ │ │ +00027d30: 7565 3c2f 7370 616e 3e0a 2020 2020 3c73 ue. po │ │ │ │ +00027d50: 7373 6962 6c79 5f6d 756c 7469 7661 6c75 ssibly_multivalu │ │ │ │ +00027d60: 6564 3c2f 7370 616e 3e20 3c73 7061 6e20 ed = False │ │ │ │ +00027da0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ +00027dc0: 203c 7370 616e 2063 6c61 7373 3d22 666d __init__(self, al │ │ │ │ +00027e40: 6961 733c 2f73 7061 6e3e 3c73 7061 6e20 ias, target │ │ │ │ +00027e80: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00027e90: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , output_ │ │ │ │ +00027eb0: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field=None │ │ │ │ +00027ef0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00027f00: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +00027f10: 2020 3c73 7061 6e20 636c 6173 733d 226b if outp │ │ │ │ +00027f40: 7574 5f66 6965 6c64 3c2f 7370 616e 3e20 ut_field │ │ │ │ +00027f50: 3c73 7061 6e20 636c 6173 733d 226f 7722 is None │ │ │ │ +00027f80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +00027fa0: 2020 2020 2020 2020 2020 2020 3c73 7061 outp │ │ │ │ +00027fc0: 7574 5f66 6965 6c64 3c2f 7370 616e 3e20 ut_field │ │ │ │ +00027fd0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00027fe0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = target< │ │ │ │ +00028000: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00028010: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +00028020: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().__ │ │ │ │ +00028070: 696e 6974 5f5f 3c2f 7370 616e 3e3c 7370 init__(output_fiel │ │ │ │ +000280b0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d= │ │ │ │ +000280d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000280e0: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field). │ │ │ │ +00028110: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +00028130: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00028140: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .alias, se │ │ │ │ +00028190: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.target < │ │ │ │ +000281d0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +000281e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c alias, tar │ │ │ │ +00028230: 6765 743c 2f73 7061 6e3e 0a0a 2020 2020 get.. │ │ │ │ +00028240: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00028250: 6465 663c 2f73 7061 6e3e 203c 7370 616e def __re │ │ │ │ +00028270: 7072 5f5f 3c2f 7370 616e 3e3c 7370 616e pr__(self< │ │ │ │ +000282b0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +000282c0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +000282d0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 alias, target = se │ │ │ │ +00028350: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.alias, self.target │ │ │ │ +000283f0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00028400: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00028410: 6964 656e 7469 6669 6572 733c 2f73 7061 identifiers = (alias │ │ │ │ +00028470: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00028480: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , str
(targ │ │ │ │ +000284d0: 6574 3c2f 7370 616e 3e3c 7370 616e 2063 et)) if ali │ │ │ │ +00028520: 6173 3c2f 7370 616e 3e20 3c73 7061 6e20 as else (s │ │ │ │ +00028570: 7472 3c2f 7370 616e 3e3c 7370 616e 2063 tr(target), │ │ │ │ +000285c0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +000285d0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +000285f0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00028600: 2671 756f 743b 3c2f 7370 616e 3e3c 7370 "{} │ │ │ │ +00028620: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ( │ │ │ │ +00028640: 3c73 7061 6e20 636c 6173 733d 2273 6922 {})&quo │ │ │ │ +00028670: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;.format(< │ │ │ │ +000286c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.__cla │ │ │ │ +00028710: 7373 5f5f 3c2f 7370 616e 3e3c 7370 616e ss__.__name__, &qu │ │ │ │ +00028780: 6f74 3b2c 2026 7175 6f74 3b3c 2f73 7061 ot;, ".join(ide │ │ │ │ +000287f0: 6e74 6966 6965 7273 3c2f 7370 616e 3e3c ntifiers< │ │ │ │ +00028800: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00028810: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ).. de │ │ │ │ +00028830: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f as_sql │ │ │ │ +00028850: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00028870: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00028880: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self, compiler, conn │ │ │ │ +000288f0: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection):< │ │ │ │ +00028910: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00028920: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +00028930: 6c69 6173 3c2f 7370 616e 3e3c 7370 616e lias, column = self │ │ │ │ +000289a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000289c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +000289d0: 6c69 6173 3c2f 7370 616e 3e3c 7370 616e lias, self │ │ │ │ +00028a10: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00028a20: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .target.col │ │ │ │ +00028a70: 756d 6e3c 2f73 7061 6e3e 0a20 2020 2020 umn. │ │ │ │ +00028a80: 2020 203c 7370 616e 2063 6c61 7373 3d22 identifiers = < │ │ │ │ +00028ac0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00028ad0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 alias, colu │ │ │ │ +00028b20: 6d6e 3c2f 7370 616e 3e3c 7370 616e 2063 mn) if alia │ │ │ │ +00028b70: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s else (col │ │ │ │ +00028bc0: 756d 6e3c 2f73 7061 6e3e 3c73 7061 6e20 umn,). sql< │ │ │ │ +00028c00: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00028c20: 3c73 7061 6e20 636c 6173 733d 2273 3222 ".".joi │ │ │ │ +00028c70: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n( │ │ │ │ +00028c90: 3c73 7061 6e20 636c 6173 733d 226e 6222 map(compiler.quote_ │ │ │ │ +00028d10: 6e61 6d65 5f75 6e6c 6573 735f 616c 6961 name_unless_alia │ │ │ │ +00028d20: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s, │ │ │ │ +00028d40: 203c 7370 616e 2063 6c61 7373 3d22 6e22 identifiers)). │ │ │ │ +00028d80: 2020 2020 203c 7370 616e 2063 6c61 7373 return sql, []. │ │ │ │ +00028df0: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ +00028e10: 3c73 7061 6e20 636c 6173 733d 226e 6622 relabeled_clone │ │ │ │ +00028e30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00028e50: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00028e60: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self, relabels):. │ │ │ │ +00028ec0: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +00028ee0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00028ef0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.alias │ │ │ │ +00028f30: 3c73 7061 6e20 636c 6173 733d 226f 7722 is None │ │ │ │ +00028f60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +00028f80: 2020 2020 2020 2020 2020 2020 3c73 7061 retu │ │ │ │ +00028fa0: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn self< │ │ │ │ +00028fc0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00028fd0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +00028fe0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn se │ │ │ │ +00029000: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.__class__(. │ │ │ │ +00029060: 2020 2020 2020 203c 7370 616e 2063 6c61 relabels< │ │ │ │ +00029080: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ge │ │ │ │ +000290b0: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t( │ │ │ │ +000290d0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.alias │ │ │ │ +00029120: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00029130: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , self.ali │ │ │ │ +00029180: 6173 3c2f 7370 616e 3e3c 7370 616e 2063 as), self< │ │ │ │ +000291c0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +000291d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 target, se │ │ │ │ +00029220: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.output_field. ).. def get_group │ │ │ │ +000292c0: 5f62 795f 636f 6c73 3c2f 7370 616e 3e3c _by_cols< │ │ │ │ +000292d0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +000292e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self):. │ │ │ │ +00029320: 2020 2020 203c 7370 616e 2063 6c61 7373 return [self │ │ │ │ 00029370: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, conn │ │ │ │ -000293c0: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection):< │ │ │ │ -000293e0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -000293f0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ -00029400: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f self.tar │ │ │ │ -00029450: 6765 743c 2f73 7061 6e3e 203c 7370 616e get == self.output_ │ │ │ │ -000294c0: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field:
. │ │ │ │ -000294f0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -00029510: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00029520: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.output_field< │ │ │ │ -00029560: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ge │ │ │ │ -00029590: 745f 6462 5f63 6f6e 7665 7274 6572 733c t_db_converters< │ │ │ │ -000295a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(co │ │ │ │ -000295d0: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ -000295e0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -000295f0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00029600: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00029610: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return s │ │ │ │ -00029630: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.output_field.get │ │ │ │ -000296a0: 5f64 625f 636f 6e76 6572 7465 7273 3c2f _db_converters(. │ │ │ │ -000296d0: 2020 2020 2020 2020 2020 3c73 7061 6e20 connec │ │ │ │ -000296f0: 7469 6f6e 3c2f 7370 616e 3e0a 2020 2020 tion. │ │ │ │ -00029700: 2020 2020 3c73 7061 6e20 636c 6173 733d ) + self.target │ │ │ │ -00029780: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000297a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e67 span class="n">g │ │ │ │ -000297b0: 6574 5f64 625f 636f 6e76 6572 7465 7273 et_db_converters │ │ │ │ -000297c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -000297e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -000297f0: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ -00029800: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00029810: 293c 2f73 7061 6e3e 0a0a 0a3c 7370 616e )...class │ │ │ │ -00029830: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c Ref(Expre │ │ │ │ -00029880: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion):. ""&q │ │ │ │ -000298e0: 756f 743b 3c2f 7370 616e 3e0a 3c73 7061 uot;. │ │ │ │ -00029900: 2052 6566 6572 656e 6365 2074 6f20 636f Reference to co │ │ │ │ -00029910: 6c75 6d6e 2061 6c69 6173 206f 6620 7468 lumn alias of th │ │ │ │ -00029920: 6520 7175 6572 792e 2046 6f72 2065 7861 e query. For exa │ │ │ │ -00029930: 6d70 6c65 2c20 5265 6628 2623 3339 3b73 mple, Ref('s │ │ │ │ -00029940: 756d 5f63 6f73 7426 2333 393b 2920 696e um_cost') in │ │ │ │ -00029950: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c . qs. │ │ │ │ -00029970: 616e 6e6f 7461 7465 2873 756d 5f63 6f73 annotate(sum_cos │ │ │ │ -00029980: 743d 5375 6d28 2623 3339 3b63 6f73 7426 t=Sum('cost& │ │ │ │ -00029990: 2333 393b 2929 2071 7565 7279 2e3c 2f73 #39;)) query.. " │ │ │ │ -000299c0: 2671 756f 743b 2671 756f 743b 3c2f 7370 "".. def __init__(sel │ │ │ │ -00029a40: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ -00029a60: 203c 7370 616e 2063 6c61 7373 3d22 6e22 refs, source):. │ │ │ │ -00029ad0: 2020 2020 3c73 7061 6e20 636c 6173 733d super().__init__(). │ │ │ │ -00029b60: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ -00029b80: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00029b90: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .refs, sel │ │ │ │ -00029be0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00029c00: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00029c10: 736f 7572 6365 3c2f 7370 616e 3e20 3c73 source =< │ │ │ │ -00029c30: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> refs, sourc │ │ │ │ -00029c80: 653c 2f73 7061 6e3e 0a0a 2020 2020 3c73 e.. de │ │ │ │ -00029ca0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f __repr │ │ │ │ -00029cc0: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __(self):< │ │ │ │ -00029d10: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00029d20: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ -00029d30: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn &q │ │ │ │ -00029d50: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;{}({ │ │ │ │ -00029da0: 7d3c 2f73 7061 6e3e 3c73 7061 6e20 636c }, {})&q │ │ │ │ -00029df0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;.format │ │ │ │ -00029e30: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00029e40: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self.__c │ │ │ │ -00029e90: 6c61 7373 5f5f 3c2f 7370 616e 3e3c 7370 lass__.__name__, s │ │ │ │ -00029f00: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.refs, self.source │ │ │ │ -00029fa0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00029fc0: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ -00029fe0: 3c73 7061 6e20 636c 6173 733d 226e 6622 get_source_expr │ │ │ │ -0002a000: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73 essions(< │ │ │ │ -0002a020: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self):. │ │ │ │ -0002a060: 2020 2020 3c73 7061 6e20 636c 6173 733d return [self< │ │ │ │ -0002a0b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.so │ │ │ │ -0002a0e0: 7572 6365 3c2f 7370 616e 3e3c 7370 616e urce].. def set_source_ │ │ │ │ -0002a140: 6578 7072 6573 7369 6f6e 733c 2f73 7061 expressions(self< │ │ │ │ -0002a180: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002a1a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -0002a1b0: 7870 7273 3c2f 7370 616e 3e3c 7370 616e xprs):. (self.source< │ │ │ │ -0002a240: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,) │ │ │ │ -0002a260: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0002a270: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = exprs.. def resolve_e │ │ │ │ -0002a2d0: 7870 7265 7373 696f 6e3c 2f73 7061 6e3e xpression │ │ │ │ -0002a2e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002a2f0: 283c 2f73 7061 6e3e 0a20 2020 2020 2020 (. │ │ │ │ -0002a300: 203c 7370 616e 2063 6c61 7373 3d22 6270 self, query=None< │ │ │ │ -0002a380: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002a3a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -0002a3b0: 6c6c 6f77 5f6a 6f69 6e73 3c2f 7370 616e llow_joins=True, re │ │ │ │ -0002a420: 7573 653c 2f73 7061 6e3e 3c73 7061 6e20 use=None,< │ │ │ │ -0002a470: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> summarize │ │ │ │ -0002a490: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 =< │ │ │ │ -0002a4b0: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ -0002a4c0: 4661 6c73 653c 2f73 7061 6e3e 3c73 7061 False, for_save=Fal │ │ │ │ -0002a530: 7365 3c2f 7370 616e 3e0a 2020 2020 3c73 se. ): │ │ │ │ -0002a550: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0002a560: 3c73 7061 6e20 636c 6173 733d 2263 3122 # The sub-expre │ │ │ │ -0002a580: 7373 696f 6e20 6073 6f75 7263 6560 2068 ssion `source` h │ │ │ │ -0002a590: 6173 2061 6c72 6561 6479 2062 6565 6e20 as already been │ │ │ │ -0002a5a0: 7265 736f 6c76 6564 2c20 6173 2074 6869 resolved, as thi │ │ │ │ -0002a5b0: 7320 6973 3c2f 7370 616e 3e0a 2020 2020 s is. │ │ │ │ -0002a5c0: 2020 2020 3c73 7061 6e20 636c 6173 733d # just a re │ │ │ │ -0002a5e0: 6665 7265 6e63 6520 746f 2074 6865 206e ference to the n │ │ │ │ -0002a5f0: 616d 6520 6f66 2060 736f 7572 6365 602e ame of `source`. │ │ │ │ -0002a600: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0002a610: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0002a620: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return s │ │ │ │ -0002a640: 656c 663c 2f73 7061 6e3e 0a0a 2020 2020 elf.. │ │ │ │ -0002a650: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0002a660: 6465 663c 2f73 7061 6e3e 203c 7370 616e def get_ │ │ │ │ -0002a680: 7265 6673 3c2f 7370 616e 3e3c 7370 616e refs(self< │ │ │ │ -0002a6c0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0002a6d0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -0002a6e0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -0002a700: 7370 616e 2063 6c61 7373 3d22 7022 3e7b span class="p">{ │ │ │ │ -0002a710: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.refs< │ │ │ │ -0002a760: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>}.. │ │ │ │ -0002a780: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -0002a7a0: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ -0002a7b0: 7265 6c61 6265 6c65 645f 636c 6f6e 653c relabeled_clone< │ │ │ │ -0002a7c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -0002a7f0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, relabels):. │ │ │ │ -0002a850: 2020 2020 3c73 7061 6e20 636c 6173 733d clone │ │ │ │ -0002a870: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = self< │ │ │ │ -0002a8a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ -0002a8d0: 7079 3c2f 7370 616e 3e3c 7370 616e 2063 py(). clone │ │ │ │ -0002a910: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0002a930: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -0002a940: 6f75 7263 653c 2f73 7061 6e3e 203c 7370 ource = self.source │ │ │ │ -0002a9b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0002a9d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ -0002a9e0: 656c 6162 656c 6564 5f63 6c6f 6e65 3c2f elabeled_clone(rel │ │ │ │ -0002aa20: 6162 656c 733c 2f73 7061 6e3e 3c73 7061 abels). ret │ │ │ │ -0002aa60: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn clone │ │ │ │ -0002aa80: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -0002aaa0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c as_sql< │ │ │ │ -0002aac0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -0002aaf0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, compiler, conne │ │ │ │ -0002ab60: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction):. re │ │ │ │ -0002aba0: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn conn │ │ │ │ -0002abc0: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection.ops< │ │ │ │ -0002ac00: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0002ac10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 quote_nam │ │ │ │ -0002ac30: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -0002ac50: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.refs< │ │ │ │ -0002aca0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0002acb0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , [].. def get_group_by │ │ │ │ -0002ad10: 5f63 6f6c 733c 2f73 7061 6e3e 3c73 7061 _cols(self │ │ │ │ -0002ad50: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002ad60: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -0002ad70: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ -0002ad90: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002ada0: 5b3c 2f73 7061 6e3e 3c73 7061 6e20 636c [self]...< │ │ │ │ -0002ade0: 7370 616e 2063 6c61 7373 3d22 6b22 3e63 span class="k">c │ │ │ │ -0002adf0: 6c61 7373 3c2f 7370 616e 3e20 3c73 7061 lass Exp │ │ │ │ -0002ae10: 7265 7373 696f 6e4c 6973 743c 2f73 7061 ressionList(Func):.< │ │ │ │ -0002ae70: 7370 616e 2063 6c61 7373 3d22 7722 3e20 span class="w"> │ │ │ │ -0002ae80: 2020 203c 2f73 7061 6e3e 3c73 7061 6e20 " │ │ │ │ -0002aea0: 3b26 7175 6f74 3b26 7175 6f74 3b3c 2f73 ;"". An exp │ │ │ │ -0002aed0: 7265 7373 696f 6e20 636f 6e74 6169 6e69 ression containi │ │ │ │ -0002aee0: 6e67 206d 756c 7469 706c 6520 6578 7072 ng multiple expr │ │ │ │ -0002aef0: 6573 7369 6f6e 732e 2043 616e 2062 6520 essions. Can be │ │ │ │ -0002af00: 7573 6564 2074 6f20 7072 6f76 6964 6520 used to provide │ │ │ │ -0002af10: 613c 2f73 7061 6e3e 0a3c 7370 616e 2063 a. li │ │ │ │ -0002af30: 7374 206f 6620 6578 7072 6573 7369 6f6e st of expression │ │ │ │ -0002af40: 7320 6173 2061 6e20 6172 6775 6d65 6e74 s as an argument │ │ │ │ -0002af50: 2074 6f20 616e 6f74 6865 7220 6578 7072 to another expr │ │ │ │ -0002af60: 6573 7369 6f6e 2c20 6c69 6b65 2061 2070 ession, like a p │ │ │ │ -0002af70: 6172 7469 7469 6f6e 3c2f 7370 616e 3e0a artition. │ │ │ │ -0002af80: 3c73 7061 6e20 636c 6173 733d 2273 6422 clause.. "& │ │ │ │ -0002afc0: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;".. template │ │ │ │ -0002aff0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -0002b010: 203c 7370 616e 2063 6c61 7373 3d22 7332 "< │ │ │ │ -0002b030: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -0002b040: 2528 6578 7072 6573 7369 6f6e 7329 733c %(expressions)s< │ │ │ │ -0002b050: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>".. def __init__(se │ │ │ │ -0002b0e0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, *expres │ │ │ │ -0002b130: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061 sions, **ex │ │ │ │ -0002b180: 7472 613c 2f73 7061 6e3e 3c73 7061 6e20 tra):. if not expressions]. │ │ │ │ +00029390: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ +000293b0: 3c73 7061 6e20 636c 6173 733d 226e 6622 get_db_converte │ │ │ │ +000293d0: 7273 3c2f 7370 616e 3e3c 7370 616e 2063 rs(self, connection │ │ │ │ +00029440: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +00029460: 0a20 2020 2020 2020 203c 7370 616e 2063 . if self< │ │ │ │ +000294a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +000294b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 target == < │ │ │ │ +000294f0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00029500: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.output_field< │ │ │ │ +00029540: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>:. │ │ │ │ +00029560: 2020 2020 2020 2020 2020 203c 7370 616e retur │ │ │ │ +00029580: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n self.out │ │ │ │ +000295d0: 7075 745f 6669 656c 643c 2f73 7061 6e3e put_field │ │ │ │ +000295e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000295f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .get_db_c │ │ │ │ +00029610: 6f6e 7665 7274 6572 733c 2f73 7061 6e3e onverters │ │ │ │ +00029620: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00029630: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (connecti │ │ │ │ +00029650: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on). return │ │ │ │ +00029690: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.outp │ │ │ │ +000296e0: 7574 5f66 6965 6c64 3c2f 7370 616e 3e3c ut_field< │ │ │ │ +000296f0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00029700: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 get_db_co │ │ │ │ +00029720: 6e76 6572 7465 7273 3c2f 7370 616e 3e3c nverters< │ │ │ │ +00029730: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00029740: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00029750: 2020 2020 3c73 7061 6e20 636c 6173 733d connection. )< │ │ │ │ +00029790: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> + │ │ │ │ +000297b0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.target.get_db_ │ │ │ │ +00029830: 636f 6e76 6572 7465 7273 3c2f 7370 616e converters(connect │ │ │ │ +00029870: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion)...class Ref(Expression< │ │ │ │ +00029900: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ +00029920: 3c73 7061 6e20 636c 6173 733d 2277 223e │ │ │ │ +00029930: 2020 2020 3c2f 7370 616e 3e3c 7370 616e &quo │ │ │ │ +00029950: 743b 2671 756f 743b 2671 756f 743b 3c2f t;"". Refer │ │ │ │ +00029980: 656e 6365 2074 6f20 636f 6c75 6d6e 2061 ence to column a │ │ │ │ +00029990: 6c69 6173 206f 6620 7468 6520 7175 6572 lias of the quer │ │ │ │ +000299a0: 792e 2046 6f72 2065 7861 6d70 6c65 2c20 y. For example, │ │ │ │ +000299b0: 5265 6628 2623 3339 3b73 756d 5f63 6f73 Ref('sum_cos │ │ │ │ +000299c0: 7426 2333 393b 2920 696e 3c2f 7370 616e t') in. qs.annota │ │ │ │ +000299f0: 7465 2873 756d 5f63 6f73 743d 5375 6d28 te(sum_cost=Sum( │ │ │ │ +00029a00: 2623 3339 3b63 6f73 7426 2333 393b 2929 'cost')) │ │ │ │ +00029a10: 2071 7565 7279 2e3c 2f73 7061 6e3e 0a3c query..< │ │ │ │ +00029a20: 7370 616e 2063 6c61 7373 3d22 7364 223e span class="sd"> │ │ │ │ +00029a30: 2020 2020 2671 756f 743b 2671 756f 743b "" │ │ │ │ +00029a40: 2671 756f 743b 3c2f 7370 616e 3e0a 0a20 ".. │ │ │ │ +00029a50: 2020 203c 7370 616e 2063 6c61 7373 3d22 def _ │ │ │ │ +00029a80: 5f69 6e69 745f 5f3c 2f73 7061 6e3e 3c73 _init__(< │ │ │ │ +00029aa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self, refs< │ │ │ │ +00029af0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00029b10: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ +00029b20: 6f75 7263 653c 2f73 7061 6e3e 3c73 7061 ource):. s │ │ │ │ +00029b60: 7570 6572 3c2f 7370 616e 3e3c 7370 616e uper().__i │ │ │ │ +00029bb0: 6e69 745f 5f3c 2f73 7061 6e3e 3c73 7061 nit__(). s │ │ │ │ +00029bf0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.refs, self.source │ │ │ │ +00029c90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +00029cb0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 refs, source.. def __repr__(self │ │ │ │ +00029d70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +00029d90: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ +00029db0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "{}< │ │ │ │ +00029df0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00029e00: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c ({}, {}< │ │ │ │ +00029e50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>)".for │ │ │ │ +00029ea0: 6d61 743c 2f73 7061 6e3e 3c73 7061 6e20 mat(self.< │ │ │ │ +00029ef0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>__class__ │ │ │ │ +00029f10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00029f30: 7370 616e 2063 6c61 7373 3d22 766d 223e span class="vm"> │ │ │ │ +00029f40: 5f5f 6e61 6d65 5f5f 3c2f 7370 616e 3e3c __name__< │ │ │ │ +00029f50: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00029f60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.refs │ │ │ │ +00029fb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00029fd0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.source).. < │ │ │ │ +0002a040: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +0002a050: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef get_s │ │ │ │ +0002a070: 6f75 7263 655f 6578 7072 6573 7369 6f6e ource_expression │ │ │ │ +0002a080: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s( │ │ │ │ +0002a0a0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self):. re │ │ │ │ +0002a0f0: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn [self │ │ │ │ +0002a130: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002a140: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .source].. │ │ │ │ +0002a180: 2020 203c 7370 616e 2063 6c61 7373 3d22 def s │ │ │ │ +0002a1b0: 6574 5f73 6f75 7263 655f 6578 7072 6573 et_source_expres │ │ │ │ +0002a1c0: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061 sions(self │ │ │ │ +0002a200: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002a210: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , exprs):. │ │ │ │ +0002a250: 2020 2020 2020 203c 7370 616e 2063 6c61 (< │ │ │ │ +0002a270: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0002a280: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.source │ │ │ │ +0002a2c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002a2d0: 2c29 3c2f 7370 616e 3e20 3c73 7061 6e20 ,) = exprs. │ │ │ │ +0002a310: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ +0002a330: 3c73 7061 6e20 636c 6173 733d 226e 6622 resolve_express │ │ │ │ +0002a350: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion(. self │ │ │ │ +0002a390: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +0002a3b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0002a3c0: 7175 6572 793c 2f73 7061 6e3e 3c73 7061 query=None │ │ │ │ +0002a400: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002a410: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , allow_j │ │ │ │ +0002a430: 6f69 6e73 3c2f 7370 616e 3e3c 7370 616e oins=True< │ │ │ │ +0002a470: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0002a480: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c reuse
=Non │ │ │ │ +0002a4d0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ +0002a4f0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 summarize=False< │ │ │ │ +0002a540: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0002a560: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +0002a570: 6f72 5f73 6176 653c 2f73 7061 6e3e 3c73 or_save=< │ │ │ │ +0002a590: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>False. ):. # The │ │ │ │ +0002a5f0: 2073 7562 2d65 7870 7265 7373 696f 6e20 sub-expression │ │ │ │ +0002a600: 6073 6f75 7263 6560 2068 6173 2061 6c72 `source` has alr │ │ │ │ +0002a610: 6561 6479 2062 6565 6e20 7265 736f 6c76 eady been resolv │ │ │ │ +0002a620: 6564 2c20 6173 2074 6869 7320 6973 3c2f ed, as this is. # │ │ │ │ +0002a650: 206a 7573 7420 6120 7265 6665 7265 6e63 just a referenc │ │ │ │ +0002a660: 6520 746f 2074 6865 206e 616d 6520 6f66 e to the name of │ │ │ │ +0002a670: 2060 736f 7572 6365 602e 3c2f 7370 616e `source`.. return │ │ │ │ +0002a6a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.. def get_refs(se │ │ │ │ +0002a730: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf):. retur │ │ │ │ +0002a770: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n {self.refs │ │ │ │ +0002a7e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002a7f0: 7d3c 2f73 7061 6e3e 0a0a 2020 2020 3c73 }.. de │ │ │ │ +0002a810: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f relabe │ │ │ │ +0002a830: 6c65 645f 636c 6f6e 653c 2f73 7061 6e3e led_clone │ │ │ │ +0002a840: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002a850: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self, rel │ │ │ │ +0002a8a0: 6162 656c 733c 2f73 7061 6e3e 3c73 7061 abels):. cl │ │ │ │ +0002a8e0: 6f6e 653c 2f73 7061 6e3e 203c 7370 616e one = self │ │ │ │ +0002a920: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002a930: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .copy(). │ │ │ │ +0002a970: 2020 2020 203c 7370 616e 2063 6c61 7373 clone.source< │ │ │ │ +0002a9c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +0002a9e0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.source.relabel │ │ │ │ +0002aa60: 6564 5f63 6c6f 6e65 3c2f 7370 616e 3e3c ed_clone< │ │ │ │ +0002aa70: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0002aa80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 relabels< │ │ │ │ +0002aaa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ +0002aac0: 2020 2020 2020 203c 7370 616e 2063 6c61 return
clone.. def as_sql │ │ │ │ +0002ab40: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002ab50: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self
, com │ │ │ │ +0002aba0: 7069 6c65 723c 2f73 7061 6e3e 3c73 7061 piler,
connection< │ │ │ │ +0002abe0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ +0002ac00: 2020 2020 2020 2020 3c73 7061 6e20 636c return connection │ │ │ │ +0002ac40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0002ac60: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +0002ac70: 7073 3c2f 7370 616e 3e3c 7370 616e 2063 ps.quote_name(self< │ │ │ │ +0002ace0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.re │ │ │ │ +0002ad10: 6673 3c2f 7370 616e 3e3c 7370 616e 2063 fs), [].. │ │ │ │ +0002ad50: 2020 3c73 7061 6e20 636c 6173 733d 226b def ge │ │ │ │ +0002ad80: 745f 6772 6f75 705f 6279 5f63 6f6c 733c t_group_by_cols< │ │ │ │ +0002ad90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0002adc0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. retu │ │ │ │ +0002ae00: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn [self]< │ │ │ │ +0002ae50: 2f73 7061 6e3e 0a0a 0a3c 7370 616e 2063 /span>...class Expressio │ │ │ │ +0002ae90: 6e4c 6973 743c 2f73 7061 6e3e 3c73 7061 nList(Func< │ │ │ │ +0002aed0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0002aee0: 3a3c 2f73 7061 6e3e 0a3c 7370 616e 2063 :. "" │ │ │ │ +0002af20: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 0a3c ;".< │ │ │ │ +0002af30: 7370 616e 2063 6c61 7373 3d22 7364 223e span class="sd"> │ │ │ │ +0002af40: 2020 2020 416e 2065 7870 7265 7373 696f An expressio │ │ │ │ +0002af50: 6e20 636f 6e74 6169 6e69 6e67 206d 756c n containing mul │ │ │ │ +0002af60: 7469 706c 6520 6578 7072 6573 7369 6f6e tiple expression │ │ │ │ +0002af70: 732e 2043 616e 2062 6520 7573 6564 2074 s. Can be used t │ │ │ │ +0002af80: 6f20 7072 6f76 6964 6520 613c 2f73 7061 o provide a. list of │ │ │ │ +0002afb0: 6578 7072 6573 7369 6f6e 7320 6173 2061 expressions as a │ │ │ │ +0002afc0: 6e20 6172 6775 6d65 6e74 2074 6f20 616e n argument to an │ │ │ │ +0002afd0: 6f74 6865 7220 6578 7072 6573 7369 6f6e other expression │ │ │ │ +0002afe0: 2c20 6c69 6b65 2061 2070 6172 7469 7469 , like a partiti │ │ │ │ +0002aff0: 6f6e 3c2f 7370 616e 3e0a 3c73 7061 6e20 on. c │ │ │ │ +0002b010: 6c61 7573 652e 3c2f 7370 616e 3e0a 3c73 lause.. │ │ │ │ +0002b030: 2020 2026 7175 6f74 3b26 7175 6f74 3b26 ""& │ │ │ │ +0002b040: 7175 6f74 3b3c 2f73 7061 6e3e 0a0a 2020 quot;.. │ │ │ │ +0002b050: 2020 3c73 7061 6e20 636c 6173 733d 226e template = &quo │ │ │ │ +0002b0a0: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;%(expr │ │ │ │ +0002b0c0: 6573 7369 6f6e 7329 733c 2f73 7061 6e3e essions)s │ │ │ │ +0002b0d0: 3c73 7061 6e20 636c 6173 733d 2273 3222 ".. │ │ │ │ +0002b0f0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +0002b110: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ +0002b120: 5f5f 696e 6974 5f5f 3c2f 7370 616e 3e3c __init__< │ │ │ │ +0002b130: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0002b140: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, *expressions< │ │ │ │ +0002b1b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0002b1d0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2a span class="o">* │ │ │ │ +0002b1e0: 2a3c 2f73 7061 6e3e 3c73 7061 6e20 636c *extra:. │ │ │ │ -0002b220: 2020 2020 2020 2020 203c 7370 616e 2063 raise ValueErro │ │ │ │ -0002b260: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r( │ │ │ │ -0002b280: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0002b290: 203c 7370 616e 2063 6c61 7373 3d22 7332 "< │ │ │ │ -0002b2b0: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -0002b2c0: 2573 3c2f 7370 616e 3e3c 7370 616e 2063 %s requi │ │ │ │ -0002b2e0: 7265 7320 6174 206c 6561 7374 206f 6e65 res at least one │ │ │ │ -0002b2f0: 2065 7870 7265 7373 696f 6e2e 2671 756f expression.&quo │ │ │ │ -0002b300: 743b 3c2f 7370 616e 3e20 3c73 7061 6e20 t; % self< │ │ │ │ -0002b340: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0002b350: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __class_ │ │ │ │ -0002b370: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c _. │ │ │ │ -0002b390: 3c73 7061 6e20 636c 6173 733d 2276 6d22 __name__ │ │ │ │ -0002b3b0: 0a20 2020 2020 2020 2020 2020 203c 7370 . ). s │ │ │ │ -0002b3f0: 7570 6572 3c2f 7370 616e 3e3c 7370 616e uper().__i │ │ │ │ -0002b440: 6e69 745f 5f3c 2f73 7061 6e3e 3c73 7061 nit__(
*expr │ │ │ │ -0002b490: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73 essions,< │ │ │ │ -0002b4b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ** │ │ │ │ -0002b4d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0002b4e0: 6578 7472 613c 2f73 7061 6e3e 3c73 7061 extra).. def
__str__
(sel │ │ │ │ -0002b570: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f):. return │ │ │ │ -0002b5b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self
.arg_ │ │ │ │ -0002b600: 6a6f 696e 6572 3c2f 7370 616e 3e3c 7370 joiner.join │ │ │ │ -0002b640: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002b650: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (str(arg) fo │ │ │ │ -0002b6d0: 723c 2f73 7061 6e3e 203c 7370 616e 2063 r arg in < │ │ │ │ -0002b710: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -0002b720: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.source_expres │ │ │ │ -0002b760: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061 sions).. def
as_sqlite< │ │ │ │ -0002b7c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -0002b7f0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, compiler, conne │ │ │ │ -0002b860: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction, **ex │ │ │ │ -0002b8b0: 7472 615f 636f 6e74 6578 743c 2f73 7061 tra_context):. │ │ │ │ -0002b8e0: 2020 2020 3c73 7061 6e20 636c 6173 733d # Casting t │ │ │ │ -0002b900: 6f20 6e75 6d65 7269 6320 6973 2075 6e6e o numeric is unn │ │ │ │ -0002b910: 6563 6573 7361 7279 2e3c 2f73 7061 6e3e ecessary. │ │ │ │ -0002b920: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -0002b940: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.as_sq │ │ │ │ -0002b990: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l( │ │ │ │ -0002b9b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0002b9c0: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ -0002b9d0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0002b9e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ -0002ba00: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on, **extra │ │ │ │ -0002ba50: 5f63 6f6e 7465 7874 3c2f 7370 616e 3e3c _context< │ │ │ │ -0002ba60: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0002ba70: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -0002ba90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c get_gro │ │ │ │ -0002bab0: 7570 5f62 795f 636f 6c73 3c2f 7370 616e up_by_cols(self):. │ │ │ │ -0002bb10: 2020 2020 2020 203c 7370 616e 2063 6c61 group_by_ │ │ │ │ -0002bb30: 636f 6c73 3c2f 7370 616e 3e20 3c73 7061 cols = []. │ │ │ │ -0002bb70: 2020 2020 2020 203c 7370 616e 2063 6c61 for partition in s │ │ │ │ -0002bbe0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.get_source_exp │ │ │ │ -0002bc20: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c ressions< │ │ │ │ -0002bc30: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002bc40: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -0002bc50: 2020 2020 2020 3c73 7061 6e20 636c 6173 group_by_c │ │ │ │ -0002bc70: 6f6c 733c 2f73 7061 6e3e 3c73 7061 6e20 ols.extend< │ │ │ │ -0002bcb0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002bcc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 partition │ │ │ │ -0002bce0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0002bd00: 7370 616e 2063 6c61 7373 3d22 6e22 3e67 span class="n">g │ │ │ │ -0002bd10: 6574 5f67 726f 7570 5f62 795f 636f 6c73 et_group_by_cols │ │ │ │ -0002bd20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ()). return │ │ │ │ -0002bd60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c group_by │ │ │ │ -0002bd80: 5f63 6f6c 733c 2f73 7061 6e3e 0a0a 0a3c _cols...< │ │ │ │ -0002bd90: 7370 616e 2063 6c61 7373 3d22 6b22 3e63 span class="k">c │ │ │ │ -0002bda0: 6c61 7373 3c2f 7370 616e 3e20 3c73 7061 lass Ord │ │ │ │ -0002bdc0: 6572 4279 4c69 7374 3c2f 7370 616e 3e3c erByList< │ │ │ │ -0002bdd0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002bde0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 Func):. │ │ │ │ -0002be20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0002be30: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ -0002be40: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0002be50: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = " │ │ │ │ -0002be70: 4f52 4445 5220 4259 203c 2f73 7061 6e3e ORDER BY │ │ │ │ -0002be80: 3c73 7061 6e20 636c 6173 733d 2273 6922 %(expressions)s │ │ │ │ -0002bea0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ".. def __init__< │ │ │ │ -0002bf00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -0002bf30: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, *expre │ │ │ │ -0002bf80: 7373 696f 6e73 3c2f 7370 616e 3e3c 7370 ssions, **< │ │ │ │ -0002bfc0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -0002bfd0: 7874 7261 3c2f 7370 616e 3e3c 7370 616e xtra):. exp │ │ │ │ -0002c010: 7265 7373 696f 6e73 3c2f 7370 616e 3e20 ressions │ │ │ │ +0002b210: 2270 223e 293a 3c2f 7370 616e 3e0a 2020 "p">):. │ │ │ │ +0002b220: 2020 2020 2020 3c73 7061 6e20 636c 6173 if │ │ │ │ +0002b240: 3c73 7061 6e20 636c 6173 733d 226f 7722 not expr │ │ │ │ +0002b270: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73 essions:< │ │ │ │ +0002b290: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0002b2a0: 2020 203c 7370 616e 2063 6c61 7373 3d22 raise │ │ │ │ +0002b2c0: 3c73 7061 6e20 636c 6173 733d 226e 6522 ValueError(. │ │ │ │ +0002b300: 2020 2020 2020 2020 2020 203c 7370 616e &quo │ │ │ │ +0002b320: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;%s requires at │ │ │ │ +0002b360: 206c 6561 7374 206f 6e65 2065 7870 7265 least one expre │ │ │ │ +0002b370: 7373 696f 6e2e 2671 756f 743b 3c2f 7370 ssion." % se │ │ │ │ +0002b3b0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.__class__.__nam │ │ │ │ +0002b420: 655f 5f3c 2f73 7061 6e3e 0a20 2020 2020 e__. │ │ │ │ +0002b430: 2020 2020 2020 203c 7370 616e 2063 6c61 ). │ │ │ │ +0002b450: 2020 2020 2020 2020 3c73 7061 6e20 636c super().< │ │ │ │ +0002b4a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>__init__< │ │ │ │ +0002b4c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(*< │ │ │ │ +0002b4f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>expression │ │ │ │ +0002b510: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s, │ │ │ │ +0002b530: 203c 7370 616e 2063 6c61 7373 3d22 6f22 **extra< │ │ │ │ +0002b560: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).. │ │ │ │ +0002b580: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +0002b5a0: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ +0002b5b0: 5f5f 7374 725f 5f3c 2f73 7061 6e3e 3c73 __str__(< │ │ │ │ +0002b5d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self):. │ │ │ │ +0002b610: 2020 2020 3c73 7061 6e20 636c 6173 733d return self.< │ │ │ │ +0002b660: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>arg_joiner │ │ │ │ +0002b680: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0002b6a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6a span class="n">j │ │ │ │ +0002b6b0: 6f69 6e3c 2f73 7061 6e3e 3c73 7061 6e20 oin(str(arg< │ │ │ │ +0002b720: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0002b730: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c for arg i │ │ │ │ +0002b780: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n self.sou │ │ │ │ +0002b7d0: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ +0002b7e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).. │ │ │ │ +0002b800: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +0002b820: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ +0002b830: 6173 5f73 716c 6974 653c 2f73 7061 6e3e as_sqlite │ │ │ │ +0002b840: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002b850: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self, com │ │ │ │ +0002b8a0: 7069 6c65 723c 2f73 7061 6e3e 3c73 7061 piler, connection< │ │ │ │ +0002b8e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0002b900: 7370 616e 2063 6c61 7373 3d22 6f22 3e2a span class="o">* │ │ │ │ +0002b910: 2a3c 2f73 7061 6e3e 3c73 7061 6e20 636c *extra_co │ │ │ │ +0002b930: 6e74 6578 743c 2f73 7061 6e3e 3c73 7061 ntext):. # │ │ │ │ +0002b970: 2043 6173 7469 6e67 2074 6f20 6e75 6d65 Casting to nume │ │ │ │ +0002b980: 7269 6320 6973 2075 6e6e 6563 6573 7361 ric is unnecessa │ │ │ │ +0002b990: 7279 2e3c 2f73 7061 6e3e 0a20 2020 2020 ry.. │ │ │ │ +0002b9a0: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ +0002b9c0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.as_sql(compil │ │ │ │ +0002ba40: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er, connection, **extra_conte │ │ │ │ +0002bad0: 7874 3c2f 7370 616e 3e3c 7370 616e 2063 xt).. def get_group_by_ │ │ │ │ +0002bb30: 636f 6c73 3c2f 7370 616e 3e3c 7370 616e cols(self< │ │ │ │ +0002bb70: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0002bb80: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0002bb90: 203c 7370 616e 2063 6c61 7373 3d22 6e22 group_by_cols = < │ │ │ │ +0002bbd0: 7370 616e 2063 6c61 7373 3d22 7022 3e5b span class="p">[ │ │ │ │ +0002bbe0: 5d3c 2f73 7061 6e3e 0a20 2020 2020 2020 ]. │ │ │ │ +0002bbf0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 for part │ │ │ │ +0002bc20: 6974 696f 6e3c 2f73 7061 6e3e 203c 7370 ition in │ │ │ │ +0002bc40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.get_ │ │ │ │ +0002bc90: 736f 7572 6365 5f65 7870 7265 7373 696f source_expressio │ │ │ │ +0002bca0: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063 ns():. │ │ │ │ +0002bcd0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0002bce0: 6772 6f75 705f 6279 5f63 6f6c 733c 2f73 group_by_cols.exte │ │ │ │ +0002bd20: 6e64 3c2f 7370 616e 3e3c 7370 616e 2063 nd(partition.get_gro │ │ │ │ +0002bd90: 7570 5f62 795f 636f 6c73 3c2f 7370 616e up_by_cols()). │ │ │ │ +0002bdc0: 2020 2020 3c73 7061 6e20 636c 6173 733d return group_by_cols< │ │ │ │ +0002be00: 2f73 7061 6e3e 0a0a 0a3c 7370 616e 2063 /span>...class OrderByLi │ │ │ │ +0002be40: 7374 3c2f 7370 616e 3e3c 7370 616e 2063 st(Func):. templa │ │ │ │ +0002beb0: 7465 3c2f 7370 616e 3e20 3c73 7061 6e20 te = "ORDER │ │ │ │ +0002bef0: 4259 203c 2f73 7061 6e3e 3c73 7061 6e20 BY %(exp │ │ │ │ +0002bf10: 7265 7373 696f 6e73 2973 3c2f 7370 616e ressions)s". │ │ │ │ +0002bf40: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ +0002bf60: 3c73 7061 6e20 636c 6173 733d 2266 6d22 __init__ │ │ │ │ +0002bf80: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002bf90: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self, *expressions │ │ │ │ +0002c000: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ 0002c020: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0002c030: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = (. (< │ │ │ │ -0002c070: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0002c080: 2020 2020 2020 203c 7370 616e 2063 6c61 OrderBy(F(exp │ │ │ │ -0002c100: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r[ │ │ │ │ -0002c120: 3c73 7061 6e20 636c 6173 733d 226d 6922 1:]), descending< │ │ │ │ -0002c170: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=T │ │ │ │ -0002c1a0: 7275 653c 2f73 7061 6e3e 3c73 7061 6e20 rue). │ │ │ │ -0002c1d0: 2020 203c 7370 616e 2063 6c61 7373 3d22 if is │ │ │ │ -0002c200: 696e 7374 616e 6365 3c2f 7370 616e 3e3c instance< │ │ │ │ -0002c210: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002c220: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 expr, str< │ │ │ │ -0002c270: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>) < │ │ │ │ -0002c290: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -0002c2a0: 616e 643c 2f73 7061 6e3e 203c 7370 616e and expr< │ │ │ │ -0002c2c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>[0 │ │ │ │ -0002c2f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ] │ │ │ │ -0002c310: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0002c320: 3d3d 3c2f 7370 616e 3e20 3c73 7061 6e20 == " │ │ │ │ -0002c340: 3b2d 2671 756f 743b 3c2f 7370 616e 3e0a ;-". │ │ │ │ -0002c350: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0002c360: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0002c370: 656c 7365 3c2f 7370 616e 3e20 3c73 7061 else expr │ │ │ │ -0002c390: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0002c3a0: 2020 2020 3c73 7061 6e20 636c 6173 733d ). │ │ │ │ -0002c3c0: 2020 2020 2020 2020 203c 7370 616e 2063 for expr │ │ │ │ -0002c400: 3c73 7061 6e20 636c 6173 733d 226f 7722 in expre │ │ │ │ -0002c430: 7373 696f 6e73 3c2f 7370 616e 3e0a 2020 ssions. │ │ │ │ -0002c440: 2020 2020 2020 3c73 7061 6e20 636c 6173 ). │ │ │ │ -0002c460: 2020 2020 2020 203c 7370 616e 2063 6c61 super().__init__(*expressions │ │ │ │ -0002c520: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0002c540: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0002c550: 2a2a 3c2f 7370 616e 3e3c 7370 616e 2063 **extra).. │ │ │ │ -0002c590: 2020 203c 7370 616e 2063 6c61 7373 3d22 def a │ │ │ │ -0002c5c0: 735f 7371 6c3c 2f73 7061 6e3e 3c73 7061 s_sql(self │ │ │ │ -0002c600: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002c610: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , *args, **kw │ │ │ │ -0002c690: 6172 6773 3c2f 7370 616e 3e3c 7370 616e args):. if< │ │ │ │ -0002c6d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> not self< │ │ │ │ -0002c710: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0002c720: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 source_ex │ │ │ │ -0002c740: 7072 6573 7369 6f6e 733c 2f73 7061 6e3e pressions │ │ │ │ -0002c750: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002c760: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -0002c770: 2020 2020 203c 7370 616e 2063 6c61 7373 return "" │ │ │ │ -0002c7b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0002c7d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002c7e0: 2829 3c2f 7370 616e 3e0a 2020 2020 2020 (). │ │ │ │ -0002c7f0: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ -0002c810: 3c73 7061 6e20 636c 6173 733d 226e 6222 super()< │ │ │ │ -0002c840: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.as │ │ │ │ -0002c870: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e _sql(*args< │ │ │ │ -0002c8c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002c8e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2a span class="o">* │ │ │ │ -0002c8f0: 2a3c 2f73 7061 6e3e 3c73 7061 6e20 636c *kwargs).. │ │ │ │ -0002c930: 2020 203c 7370 616e 2063 6c61 7373 3d22 def g │ │ │ │ -0002c960: 6574 5f67 726f 7570 5f62 795f 636f 6c73 et_group_by_cols │ │ │ │ -0002c970: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -0002c990: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -0002c9a0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. gro │ │ │ │ +0002c030: 2a2a 3c2f 7370 616e 3e3c 7370 616e 2063 **extra):. │ │ │ │ +0002c070: 2020 2020 2020 203c 7370 616e 2063 6c61 expressio │ │ │ │ +0002c090: 6e73 3c2f 7370 616e 3e20 3c73 7061 6e20 ns = (. │ │ │ │ +0002c0d0: 2020 2020 2020 2020 3c73 7061 6e20 636c ( │ │ │ │ +0002c0f0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ +0002c100: 203c 7370 616e 2063 6c61 7373 3d22 6e22 OrderBy< │ │ │ │ +0002c120: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0002c130: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 F< │ │ │ │ +0002c150: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0002c160: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 expr[1:]), < │ │ │ │ +0002c1d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ +0002c1e0: 6573 6365 6e64 696e 673c 2f73 7061 6e3e escending │ │ │ │ +0002c1f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002c200: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =True). │ │ │ │ +0002c240: 2020 2020 2020 2020 2020 2020 203c 7370 if< │ │ │ │ +0002c260: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> isinstan │ │ │ │ +0002c280: 6365 3c2f 7370 616e 3e3c 7370 616e 2063 ce(expr, str │ │ │ │ +0002c2f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002c300: 293c 2f73 7061 6e3e 203c 7370 616e 2063 ) and expr │ │ │ │ +0002c340: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002c350: 5b3c 2f73 7061 6e3e 3c73 7061 6e20 636c [0] == "-&quo │ │ │ │ +0002c3c0: 743b 3c2f 7370 616e 3e0a 2020 2020 2020 t;. │ │ │ │ +0002c3d0: 2020 2020 2020 2020 2020 3c73 7061 6e20 else expr. )< │ │ │ │ +0002c430: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0002c440: 2020 203c 7370 616e 2063 6c61 7373 3d22 for ex │ │ │ │ +0002c470: 7072 3c2f 7370 616e 3e20 3c73 7061 6e20 pr in expressions │ │ │ │ +0002c4b0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0002c4c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002c4d0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +0002c4e0: 203c 7370 616e 2063 6c61 7373 3d22 6e62 super() │ │ │ │ +0002c510: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0002c530: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ +0002c540: 5f5f 696e 6974 5f5f 3c2f 7370 616e 3e3c __init__< │ │ │ │ +0002c550: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0002c560: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 *< │ │ │ │ +0002c580: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ +0002c590: 7870 7265 7373 696f 6e73 3c2f 7370 616e xpressions, **extra< │ │ │ │ +0002c5f0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0002c600: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +0002c620: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c as_sql< │ │ │ │ +0002c640: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0002c670: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, *args< │ │ │ │ +0002c6c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0002c6e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2a span class="o">* │ │ │ │ +0002c6f0: 2a3c 2f73 7061 6e3e 3c73 7061 6e20 636c *kwargs):. │ │ │ │ +0002c730: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ +0002c750: 203c 7370 616e 2063 6c61 7373 3d22 6f77 not se │ │ │ │ +0002c780: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.source_expressi │ │ │ │ +0002c7c0: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20 ons:. < │ │ │ │ +0002c7f0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +0002c800: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn &q │ │ │ │ +0002c820: 756f 743b 2671 756f 743b 3c2f 7370 616e uot;", (). retu │ │ │ │ +0002c880: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn super │ │ │ │ +0002c8a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 () │ │ │ │ +0002c8c0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002c8d0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .as_sql(*args │ │ │ │ +0002c940: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002c950: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , **kwargs< │ │ │ │ +0002c990: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0002c9a0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +0002c9c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c get_gro │ │ │ │ 0002c9e0: 7570 5f62 795f 636f 6c73 3c2f 7370 616e up_by_cols = []. for │ │ │ │ -0002ca40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c order_by │ │ │ │ -0002ca60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c in self< │ │ │ │ -0002caa0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0002cab0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 get_sourc │ │ │ │ -0002cad0: 655f 6578 7072 6573 7369 6f6e 733c 2f73 e_expressions():. │ │ │ │ -0002cb00: 2020 2020 2020 2020 2020 203c 7370 616e group │ │ │ │ -0002cb20: 5f62 795f 636f 6c73 3c2f 7370 616e 3e3c _by_cols< │ │ │ │ -0002cb30: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0002cb40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 extend(orde │ │ │ │ -0002cb90: 725f 6279 3c2f 7370 616e 3e3c 7370 616e r_by.get_group_by_ │ │ │ │ -0002cbd0: 636f 6c73 3c2f 7370 616e 3e3c 7370 616e cols()). re │ │ │ │ -0002cc10: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn grou │ │ │ │ -0002cc30: 705f 6279 5f63 6f6c 733c 2f73 7061 6e3e p_by_cols │ │ │ │ -0002cc40: 0a0a 0a3c 6469 7620 636c 6173 733d 2276 ...
.[d │ │ │ │ -0002ccf0: 6f63 735d 3c2f 613e 0a3c 7370 616e 2063 ocs].@decon │ │ │ │ -0002cd10: 7374 7275 6374 6962 6c65 3c2f 7370 616e structible(path=&qu │ │ │ │ -0002cd80: 6f74 3b64 6a61 6e67 6f2e 6462 2e6d 6f64 ot;django.db.mod │ │ │ │ -0002cd90: 656c 732e 4578 7072 6573 7369 6f6e 5772 els.ExpressionWr │ │ │ │ -0002cda0: 6170 7065 7226 7175 6f74 3b3c 2f73 7061 apper").class │ │ │ │ -0002cde0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c Express │ │ │ │ -0002ce00: 696f 6e57 7261 7070 6572 3c2f 7370 616e ionWrapper(SQLiteN │ │ │ │ -0002ce40: 756d 6572 6963 4d69 7869 6e3c 2f73 7061 umericMixin, Expre │ │ │ │ -0002ce80: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion):. ""&q │ │ │ │ -0002cee0: 756f 743b 3c2f 7370 616e 3e0a 3c73 7061 uot;. │ │ │ │ -0002cf00: 2041 6e20 6578 7072 6573 7369 6f6e 2074 An expression t │ │ │ │ -0002cf10: 6861 7420 6361 6e20 7772 6170 2061 6e6f hat can wrap ano │ │ │ │ -0002cf20: 7468 6572 2065 7870 7265 7373 696f 6e20 ther expression │ │ │ │ -0002cf30: 736f 2074 6861 7420 6974 2063 616e 2070 so that it can p │ │ │ │ -0002cf40: 726f 7669 6465 3c2f 7370 616e 3e0a 3c73 rovide. │ │ │ │ -0002cf60: 2020 2065 7874 7261 2063 6f6e 7465 7874 extra context │ │ │ │ -0002cf70: 2074 6f20 7468 6520 696e 6e65 7220 6578 to the inner ex │ │ │ │ -0002cf80: 7072 6573 7369 6f6e 2c20 7375 6368 2061 pression, such a │ │ │ │ -0002cf90: 7320 7468 6520 6f75 7470 7574 5f66 6965 s the output_fie │ │ │ │ -0002cfa0: 6c64 2e3c 2f73 7061 6e3e 0a3c 7370 616e ld.. │ │ │ │ -0002cfc0: 2671 756f 743b 2671 756f 743b 2671 756f ""&quo │ │ │ │ -0002cfd0: 743b 3c2f 7370 616e 3e0a 0a20 2020 203c t;.. < │ │ │ │ -0002cfe0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -0002cff0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef __ini │ │ │ │ -0002d010: 745f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 t__(self,< │ │ │ │ -0002d060: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> expressio │ │ │ │ -0002d080: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n, │ │ │ │ -0002d0a0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 output_field):. │ │ │ │ -0002d0e0: 2020 2020 2020 3c73 7061 6e20 636c 6173 super().__init__(outp │ │ │ │ -0002d180: 7574 5f66 6965 6c64 3c2f 7370 616e 3e3c ut_field< │ │ │ │ -0002d190: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -0002d1a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 output_fi │ │ │ │ -0002d1c0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld). self │ │ │ │ -0002d200: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0002d220: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -0002d230: 7870 7265 7373 696f 6e3c 2f73 7061 6e3e xpression │ │ │ │ -0002d240: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = expres │ │ │ │ -0002d270: 7369 6f6e 3c2f 7370 616e 3e0a 0a20 2020 sion.. │ │ │ │ -0002d280: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def set │ │ │ │ -0002d2b0: 5f73 6f75 7263 655f 6578 7072 6573 7369 _source_expressi │ │ │ │ -0002d2c0: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20 ons(self,< │ │ │ │ -0002d310: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> exprs):. │ │ │ │ -0002d350: 2020 2020 203c 7370 616e 2063 6c61 7373 self.express │ │ │ │ -0002d3a0: 696f 6e3c 2f73 7061 6e3e 203c 7370 616e ion = exprs │ │ │ │ -0002d3e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002d3f0: 5b3c 2f73 7061 6e3e 3c73 7061 6e20 636c [0].. < │ │ │ │ -0002d430: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -0002d440: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef get_s │ │ │ │ -0002d460: 6f75 7263 655f 6578 7072 6573 7369 6f6e ource_expression │ │ │ │ -0002d470: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s( │ │ │ │ -0002d490: 3c73 7061 6e20 636c 6173 733d 2262 7022 self):. re │ │ │ │ -0002d4e0: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn [self │ │ │ │ -0002d520: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0002d530: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .expressi │ │ │ │ -0002d550: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on].. def get_group_by_ │ │ │ │ -0002d5b0: 636f 6c73 3c2f 7370 616e 3e3c 7370 616e cols(self< │ │ │ │ -0002d5f0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0002d600: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -0002d610: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if isin │ │ │ │ -0002d640: 7374 616e 6365 3c2f 7370 616e 3e3c 7370 stance(self.express │ │ │ │ -0002d6b0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion, Expression):. │ │ │ │ -0002d710: 2020 2020 2020 2020 2020 3c73 7061 6e20 expres │ │ │ │ -0002d730: 7369 6f6e 3c2f 7370 616e 3e20 3c73 7061 sion = self.express │ │ │ │ -0002d7a0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion.copy()< │ │ │ │ -0002d7f0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0002d800: 2020 203c 7370 616e 2063 6c61 7373 3d22 expression.outp │ │ │ │ -0002d850: 7574 5f66 6965 6c64 3c2f 7370 616e 3e20 ut_field │ │ │ │ -0002d860: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0002d870: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = self.out │ │ │ │ -0002d8c0: 7075 745f 6669 656c 643c 2f73 7061 6e3e put_field │ │ │ │ -0002d8d0: 0a20 2020 2020 2020 2020 2020 203c 7370 . ret │ │ │ │ -0002d8f0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn expre │ │ │ │ -0002d910: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion.get_group_by │ │ │ │ -0002d950: 5f63 6f6c 733c 2f73 7061 6e3e 3c73 7061 _cols(). # │ │ │ │ -0002d990: 2046 6f72 206e 6f6e 2d65 7870 7265 7373 For non-express │ │ │ │ -0002d9a0: 696f 6e73 2065 2e67 2e20 616e 2053 514c ions e.g. an SQL │ │ │ │ -0002d9b0: 2057 4845 5245 2063 6c61 7573 652c 2074 WHERE clause, t │ │ │ │ -0002d9c0: 6865 2065 6e74 6972 653c 2f73 7061 6e3e he entire │ │ │ │ -0002d9d0: 0a20 2020 2020 2020 203c 7370 616e 2063 . # `exp │ │ │ │ -0002d9f0: 7265 7373 696f 6e60 206d 7573 7420 6265 ression` must be │ │ │ │ -0002da00: 2069 6e63 6c75 6465 6420 696e 2074 6865 included in the │ │ │ │ -0002da10: 2047 524f 5550 2042 5920 636c 6175 7365 GROUP BY clause │ │ │ │ -0002da20: 2e3c 2f73 7061 6e3e 0a20 2020 2020 2020 .. │ │ │ │ -0002da30: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -0002da50: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -0002da60: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().get │ │ │ │ -0002dab0: 5f67 726f 7570 5f62 795f 636f 6c73 3c2f _group_by_cols().. │ │ │ │ -0002dae0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -0002db00: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ -0002db10: 6173 5f73 716c 3c2f 7370 616e 3e3c 7370 as_sql(self, compil │ │ │ │ -0002db80: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er, connection):. │ │ │ │ -0002dbe0: 2020 2020 203c 7370 616e 2063 6c61 7373 return compiler.compil │ │ │ │ -0002dc50: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -0002dc70: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.expression).. │ │ │ │ -0002dce0: 2020 203c 7370 616e 2063 6c61 7373 3d22 def _ │ │ │ │ -0002dd10: 5f72 6570 725f 5f3c 2f73 7061 6e3e 3c73 _repr__(< │ │ │ │ -0002dd30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self):. │ │ │ │ -0002dd70: 2020 2020 3c73 7061 6e20 636c 6173 733d return " │ │ │ │ -0002ddb0: 3c73 7061 6e20 636c 6173 733d 2273 6922 {}({})& │ │ │ │ -0002de10: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;.format(self.__ │ │ │ │ -0002deb0: 636c 6173 735f 5f3c 2f73 7061 6e3e 3c73 class__.< │ │ │ │ -0002ded0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>__name__< │ │ │ │ -0002def0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002df10: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -0002df20: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.expression)....class NegatedExpre │ │ │ │ -0002dfc0: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion(ExpressionWr │ │ │ │ -0002e000: 6170 7065 723c 2f73 7061 6e3e 3c73 7061 apper):. ""&q │ │ │ │ -0002e060: 756f 743b 5468 6520 6c6f 6769 6361 6c20 uot;The logical │ │ │ │ -0002e070: 6e65 6761 7469 6f6e 206f 6620 6120 636f negation of a co │ │ │ │ -0002e080: 6e64 6974 696f 6e61 6c20 6578 7072 6573 nditional expres │ │ │ │ -0002e090: 7369 6f6e 2e26 7175 6f74 3b26 7175 6f74 sion."" │ │ │ │ -0002e0a0: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 0a0a ;".. │ │ │ │ -0002e0b0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -0002e0d0: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ -0002e0e0: 5f5f 696e 6974 5f5f 3c2f 7370 616e 3e3c __init__< │ │ │ │ -0002e0f0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002e100: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, expr │ │ │ │ -0002e150: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession):< │ │ │ │ -0002e170: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -0002e180: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -0002e190: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().__ │ │ │ │ -0002e1e0: 696e 6974 5f5f 3c2f 7370 616e 3e3c 7370 init__(expression< │ │ │ │ -0002e220: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002e240: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -0002e250: 7574 7075 745f 6669 656c 643c 2f73 7061 utput_field=fields │ │ │ │ -0002e290: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0002e2b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e42 span class="n">B │ │ │ │ -0002e2c0: 6f6f 6c65 616e 4669 656c 643c 2f73 7061 ooleanField()).. │ │ │ │ -0002e2f0: 2020 3c73 7061 6e20 636c 6173 733d 226b def __ │ │ │ │ -0002e320: 696e 7665 7274 5f5f 3c2f 7370 616e 3e3c invert__< │ │ │ │ -0002e330: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002e340: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self):. │ │ │ │ -0002e380: 2020 2020 203c 7370 616e 2063 6c61 7373 return self< │ │ │ │ -0002e3c0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0002e3d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 expressio │ │ │ │ -0002e3f0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ -0002e410: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0002e420: 636f 7079 3c2f 7370 616e 3e3c 7370 616e copy().. def as_sql(self │ │ │ │ -0002e4b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0002e4d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0002e4e0: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ -0002e4f0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0002e500: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ -0002e520: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on):. try:. │ │ │ │ -0002e580: 2020 2020 2020 2020 2020 3c73 7061 6e20 sql, par │ │ │ │ -0002e5d0: 616d 733c 2f73 7061 6e3e 203c 7370 616e ams = super().as_sql< │ │ │ │ -0002e660: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002e670: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 compiler< │ │ │ │ -0002e690: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002e6b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -0002e6c0: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ -0002e6d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002e6e0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -0002e6f0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 except < │ │ │ │ -0002e710: 7370 616e 2063 6c61 7373 3d22 6e22 3e45 span class="n">E │ │ │ │ -0002e720: 6d70 7479 5265 7375 6c74 5365 743c 2f73 mptyResultSet:. │ │ │ │ -0002e750: 2020 2020 2020 2020 203c 7370 616e 2063 feature │ │ │ │ -0002e770: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = compiler.connect │ │ │ │ -0002e7e0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion.features. if │ │ │ │ -0002e840: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c not features.suppo │ │ │ │ -0002e8b0: 7274 735f 626f 6f6c 6561 6e5f 6578 7072 rts_boolean_expr │ │ │ │ -0002e8c0: 5f69 6e5f 7365 6c65 6374 5f63 6c61 7573 _in_select_claus │ │ │ │ -0002e8d0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e: │ │ │ │ -0002e8f0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0002e900: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -0002e920: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -0002e930: 2671 756f 743b 313d 3126 7175 6f74 3b3c "1=1"< │ │ │ │ -0002e940: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002e960: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002e970: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -0002e980: 2020 2020 203c 7370 616e 2063 6c61 7373 return compiler.compil │ │ │ │ -0002e9f0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -0002ea10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0002ea20: 5661 6c75 653c 2f73 7061 6e3e 3c73 7061 Value(True │ │ │ │ -0002ea60: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002ea70: 2929 3c2f 7370 616e 3e0a 2020 2020 2020 )). │ │ │ │ -0002ea80: 2020 3c73 7061 6e20 636c 6173 733d 226e ops = compiler.con │ │ │ │ -0002eb00: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection.< │ │ │ │ -0002eb20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>ops │ │ │ │ -0002eb40: 0a20 2020 2020 2020 203c 7370 616e 2063 . # Some │ │ │ │ -0002eb60: 2064 6174 6162 6173 6520 6261 636b 656e database backen │ │ │ │ -0002eb70: 6473 2028 652e 672e 204f 7261 636c 6529 ds (e.g. Oracle) │ │ │ │ -0002eb80: 2064 6f6e 2623 3339 3b74 2061 6c6c 6f77 don't allow │ │ │ │ -0002eb90: 2045 5849 5354 5328 2920 616e 6420 6669 EXISTS() and fi │ │ │ │ -0002eba0: 6c74 6572 733c 2f73 7061 6e3e 0a20 2020 lters. │ │ │ │ -0002ebb0: 2020 2020 203c 7370 616e 2063 6c61 7373 # to be co │ │ │ │ -0002ebd0: 6d70 6172 6564 2074 6f20 616e 6f74 6865 mpared to anothe │ │ │ │ -0002ebe0: 7220 6578 7072 6573 7369 6f6e 2075 6e6c r expression unl │ │ │ │ -0002ebf0: 6573 7320 7468 6579 2623 3339 3b72 6520 ess they're │ │ │ │ -0002ec00: 7772 6170 7065 6420 696e 2061 2043 4153 wrapped in a CAS │ │ │ │ -0002ec10: 453c 2f73 7061 6e3e 0a20 2020 2020 2020 E. │ │ │ │ -0002ec20: 203c 7370 616e 2063 6c61 7373 3d22 6331 # WHEN. │ │ │ │ -0002ec40: 0a20 2020 2020 2020 203c 7370 616e 2063 . if not < │ │ │ │ -0002ec80: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -0002ec90: 7073 3c2f 7370 616e 3e3c 7370 616e 2063 ps.conditional_exp │ │ │ │ -0002ecd0: 7265 7373 696f 6e5f 7375 7070 6f72 7465 ression_supporte │ │ │ │ -0002ece0: 645f 696e 5f77 6865 7265 5f63 6c61 7573 d_in_where_claus │ │ │ │ -0002ecf0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -0002ed10: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.expression):. │ │ │ │ -0002ed80: 2020 2020 2020 2020 2020 203c 7370 616e retur │ │ │ │ -0002eda0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n f"CASE WH │ │ │ │ -0002ede0: 454e 203c 2f73 7061 6e3e 3c73 7061 6e20 EN {sql}< │ │ │ │ -0002ee30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span> = 0 THEN │ │ │ │ -0002ee50: 2031 2045 4c53 4520 3020 454e 4426 7175 1 ELSE 0 END&qu │ │ │ │ -0002ee60: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;, params │ │ │ │ -0002eea0: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -0002eec0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> f │ │ │ │ -0002eee0: 3c73 7061 6e20 636c 6173 733d 2273 3222 "NOT {sql}& │ │ │ │ -0002ef60: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;, params.. def resolve_expr │ │ │ │ -0002efe0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession(. s │ │ │ │ -0002f020: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, query< │ │ │ │ -0002f060: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -0002f070: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 None, allo │ │ │ │ -0002f0c0: 775f 6a6f 696e 733c 2f73 7061 6e3e 3c73 w_joins=< │ │ │ │ -0002f0e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>True, reuse │ │ │ │ -0002f130: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 =< │ │ │ │ -0002f150: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ -0002f160: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e None, summarize=Fal │ │ │ │ -0002f1d0: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se, for_save=False< │ │ │ │ -0002f240: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. ):. res │ │ │ │ -0002f280: 6f6c 7665 643c 2f73 7061 6e3e 203c 7370 olved = super().resolve_expr │ │ │ │ -0002f310: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession(. │ │ │ │ -0002f340: 2020 3c73 7061 6e20 636c 6173 733d 226e query,< │ │ │ │ -0002f370: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> allow_joi │ │ │ │ -0002f390: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063 ns, reuse,< │ │ │ │ -0002f3e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> summarize │ │ │ │ -0002f400: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0002f420: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0002f430: 666f 725f 7361 7665 3c2f 7370 616e 3e0a for_save. │ │ │ │ -0002f440: 2020 2020 2020 2020 3c73 7061 6e20 636c ) │ │ │ │ -0002f460: 0a20 2020 2020 2020 203c 7370 616e 2063 . if not < │ │ │ │ -0002f4a0: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -0002f4b0: 6765 7461 7474 723c 2f73 7061 6e3e 3c73 getattr(< │ │ │ │ -0002f4d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>resolved.exp │ │ │ │ -0002f520: 7265 7373 696f 6e3c 2f73 7061 6e3e 3c73 ression,< │ │ │ │ -0002f540: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "co │ │ │ │ -0002f560: 6e64 6974 696f 6e61 6c26 7175 6f74 3b3c nditional"< │ │ │ │ -0002f570: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002f590: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ -0002f5a0: 4661 6c73 653c 2f73 7061 6e3e 3c73 7061 False):. │ │ │ │ -0002f5d0: 2020 3c73 7061 6e20 636c 6173 733d 226b raise < │ │ │ │ -0002f5f0: 7370 616e 2063 6c61 7373 3d22 6e65 223e span class="ne"> │ │ │ │ -0002f600: 5479 7065 4572 726f 723c 2f73 7061 6e3e TypeError │ │ │ │ -0002f610: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002f620: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c ("C │ │ │ │ -0002f640: 616e 6e6f 7420 6e65 6761 7465 206e 6f6e annot negate non │ │ │ │ -0002f650: 2d63 6f6e 6469 7469 6f6e 616c 2065 7870 -conditional exp │ │ │ │ -0002f660: 7265 7373 696f 6e73 2e26 7175 6f74 3b3c ressions."< │ │ │ │ -0002f670: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ -0002f690: 2020 2020 2020 203c 7370 616e 2063 6c61 return resolved.. def select_for │ │ │ │ -0002f710: 6d61 743c 2f73 7061 6e3e 3c73 7061 6e20 mat(self,< │ │ │ │ -0002f760: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> compiler< │ │ │ │ -0002f780: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -0002f7a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -0002f7b0: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql, params< │ │ │ │ -0002f7f0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0002f800: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -0002f810: 203c 7370 616e 2063 6c61 7373 3d22 6331 # Wrap boolean │ │ │ │ -0002f830: 2065 7870 7265 7373 696f 6e73 2077 6974 expressions wit │ │ │ │ -0002f840: 6820 6120 4341 5345 2057 4845 4e20 6578 h a CASE WHEN ex │ │ │ │ -0002f850: 7072 6573 7369 6f6e 2069 6620 6120 6461 pression if a da │ │ │ │ -0002f860: 7461 6261 7365 3c2f 7370 616e 3e0a 2020 tabase. │ │ │ │ -0002f870: 2020 2020 2020 3c73 7061 6e20 636c 6173 # backend │ │ │ │ -0002f890: 2028 652e 672e 204f 7261 636c 6529 2064 (e.g. Oracle) d │ │ │ │ -0002f8a0: 6f65 736e 2623 3339 3b74 2073 7570 706f oesn't suppo │ │ │ │ -0002f8b0: 7274 2062 6f6f 6c65 616e 2065 7870 7265 rt boolean expre │ │ │ │ -0002f8c0: 7373 696f 6e20 696e 2053 454c 4543 5420 ssion in SELECT │ │ │ │ -0002f8d0: 6f72 3c2f 7370 616e 3e0a 2020 2020 2020 or. │ │ │ │ -0002f8e0: 2020 3c73 7061 6e20 636c 6173 733d 2263 # GROUP BY li │ │ │ │ -0002f900: 7374 2e3c 2f73 7061 6e3e 0a20 2020 2020 st.. │ │ │ │ -0002f910: 2020 203c 7370 616e 2063 6c61 7373 3d22 expression_su │ │ │ │ -0002f930: 7070 6f72 7465 645f 696e 5f77 6865 7265 pported_in_where │ │ │ │ -0002f940: 5f63 6c61 7573 653c 2f73 7061 6e3e 203c _clause < │ │ │ │ -0002f950: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -0002f960: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c ( │ │ │ │ -0002f980: 0a20 2020 2020 2020 2020 2020 203c 7370 . com │ │ │ │ -0002f9a0: 7069 6c65 723c 2f73 7061 6e3e 3c73 7061 piler.connection.ops │ │ │ │ -0002fa10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0002fa30: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -0002fa40: 6f6e 6469 7469 6f6e 616c 5f65 7870 7265 onditional_expre │ │ │ │ -0002fa50: 7373 696f 6e5f 7375 7070 6f72 7465 645f ssion_supported_ │ │ │ │ -0002fa60: 696e 5f77 6865 7265 5f63 6c61 7573 653c in_where_clause< │ │ │ │ -0002fa70: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -0002fa80: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0002fa90: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0002faa0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0002fab0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if (. < │ │ │ │ -0002fae0: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -0002faf0: 6e6f 743c 2f73 7061 6e3e 203c 7370 616e not compi │ │ │ │ -0002fb10: 6c65 723c 2f73 7061 6e3e 3c73 7061 6e20 ler.connection.featu │ │ │ │ -0002fb80: 7265 733c 2f73 7061 6e3e 3c73 7061 6e20 res.supports_boole │ │ │ │ -0002fbc0: 616e 5f65 7870 725f 696e 5f73 656c 6563 an_expr_in_selec │ │ │ │ -0002fbd0: 745f 636c 6175 7365 3c2f 7370 616e 3e0a t_clause. │ │ │ │ -0002fbe0: 2020 2020 2020 2020 2020 2020 3c73 7061 # A │ │ │ │ -0002fc00: 766f 6964 2064 6f75 626c 6520 7772 6170 void double wrap │ │ │ │ -0002fc10: 7069 6e67 2e3c 2f73 7061 6e3e 0a20 2020 ping.. │ │ │ │ -0002fc20: 2020 2020 2020 2020 203c 7370 616e 2063 and expression_ │ │ │ │ -0002fc60: 7375 7070 6f72 7465 645f 696e 5f77 6865 supported_in_whe │ │ │ │ -0002fc70: 7265 5f63 6c61 7573 653c 2f73 7061 6e3e re_clause │ │ │ │ -0002fc80: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0002fc90: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self.expr │ │ │ │ -0002fce0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession). ): │ │ │ │ -0002fd20: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0002fd30: 2020 2020 3c73 7061 6e20 636c 6173 733d sql < │ │ │ │ -0002fd50: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -0002fd60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c "C │ │ │ │ -0002fd80: 4153 4520 5748 454e 203c 2f73 7061 6e3e ASE WHEN │ │ │ │ -0002fd90: 3c73 7061 6e20 636c 6173 733d 2273 6922 {} THEN │ │ │ │ -0002fdc0: 2031 2045 4c53 4520 3020 454e 4426 7175 1 ELSE 0 END&qu │ │ │ │ -0002fdd0: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;.format< │ │ │ │ -0002fe10: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0002fe20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 sql). │ │ │ │ -0002fe60: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ -0002fe80: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0002fe90: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql, params │ │ │ │ -0002fed0: 0a0a 0a3c 6469 7620 636c 6173 733d 2276 ...
. │ │ │ │ -0002ff70: 5b64 6f63 735d 3c2f 613e 0a3c 7370 616e [docs].@dec │ │ │ │ -0002ff90: 6f6e 7374 7275 6374 6962 6c65 3c2f 7370 onstructible(path< │ │ │ │ -0002ffd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=& │ │ │ │ -00030000: 7175 6f74 3b64 6a61 6e67 6f2e 6462 2e6d quot;django.db.m │ │ │ │ -00030010: 6f64 656c 732e 5768 656e 2671 756f 743b odels.When" │ │ │ │ +0002c9f0: 3e3c 7370 616e 2063 6c61 7373 3d22 7022 >(self):. │ │ │ │ +0002ca40: 2020 2020 2020 203c 7370 616e 2063 6c61 group_by_ │ │ │ │ +0002ca60: 636f 6c73 3c2f 7370 616e 3e20 3c73 7061 cols = []. │ │ │ │ +0002caa0: 2020 2020 2020 203c 7370 616e 2063 6c61 for order_by in se │ │ │ │ +0002cb10: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.get_source_expr │ │ │ │ +0002cb50: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73 essions() │ │ │ │ +0002cb70: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0002cb80: 2020 2020 203c 7370 616e 2063 6c61 7373 group_by_co │ │ │ │ +0002cba0: 6c73 3c2f 7370 616e 3e3c 7370 616e 2063 ls.extend(< │ │ │ │ +0002cbf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>order_by.get │ │ │ │ +0002cc40: 5f67 726f 7570 5f62 795f 636f 6c73 3c2f _group_by_cols()). │ │ │ │ +0002cc70: 2020 2020 2020 2020 3c73 7061 6e20 636c return group_by_c │ │ │ │ +0002ccb0: 6f6c 733c 2f73 7061 6e3e 0a0a 0a3c 6469 ols... │ │ │ │ +0002ccf0: 0a3c 6120 636c 6173 733d 2276 6965 7763 .[documen │ │ │ │ +0002cd70: 7469 5d3c 2f61 3e0a 3c73 7061 6e20 636c ti].@decons │ │ │ │ +0002cd90: 7472 7563 7469 626c 653c 2f73 7061 6e3e tructible │ │ │ │ +0002cda0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002cdb0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (path=&quo │ │ │ │ +0002ce00: 743b 646a 616e 676f 2e64 622e 6d6f 6465 t;django.db.mode │ │ │ │ +0002ce10: 6c73 2e45 7870 7265 7373 696f 6e57 7261 ls.ExpressionWra │ │ │ │ +0002ce20: 7070 6572 2671 756f 743b 3c2f 7370 616e pper").class< │ │ │ │ +0002ce60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> Expressi │ │ │ │ +0002ce80: 6f6e 5772 6170 7065 723c 2f73 7061 6e3e onWrapper │ │ │ │ +0002ce90: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002cea0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (SQLiteNu │ │ │ │ +0002cec0: 6d65 7269 634d 6978 696e 3c2f 7370 616e mericMixin, Expres │ │ │ │ +0002cf00: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion):. │ │ │ │ +0002cf40: 3c73 7061 6e20 636c 6173 733d 2273 6422 ""&qu │ │ │ │ +0002cf60: 6f74 3b3c 2f73 7061 6e3e 0a3c 7370 616e ot;. │ │ │ │ +0002cf80: 416e 2065 7870 7265 7373 696f 6e20 7468 An expression th │ │ │ │ +0002cf90: 6174 2063 616e 2077 7261 7020 616e 6f74 at can wrap anot │ │ │ │ +0002cfa0: 6865 7220 6578 7072 6573 7369 6f6e 2073 her expression s │ │ │ │ +0002cfb0: 6f20 7468 6174 2069 7420 6361 6e20 7072 o that it can pr │ │ │ │ +0002cfc0: 6f76 6964 653c 2f73 7061 6e3e 0a3c 7370 ovide. │ │ │ │ +0002cfe0: 2020 6578 7472 6120 636f 6e74 6578 7420 extra context │ │ │ │ +0002cff0: 746f 2074 6865 2069 6e6e 6572 2065 7870 to the inner exp │ │ │ │ +0002d000: 7265 7373 696f 6e2c 2073 7563 6820 6173 ression, such as │ │ │ │ +0002d010: 2074 6865 206f 7574 7075 745f 6669 656c the output_fiel │ │ │ │ +0002d020: 642e 3c2f 7370 616e 3e0a 3c73 7061 6e20 d.. & │ │ │ │ +0002d040: 7175 6f74 3b26 7175 6f74 3b26 7175 6f74 quot;"" │ │ │ │ +0002d050: 3b3c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ;.. de │ │ │ │ +0002d070: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f __init │ │ │ │ +0002d090: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __(self, expression │ │ │ │ +0002d100: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +0002d120: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0002d130: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field):. │ │ │ │ +0002d160: 2020 2020 203c 7370 616e 2063 6c61 7373 super().__init__(outpu │ │ │ │ +0002d200: 745f 6669 656c 643c 2f73 7061 6e3e 3c73 t_field=< │ │ │ │ +0002d220: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>output_fie │ │ │ │ +0002d240: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld). self< │ │ │ │ +0002d280: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ex │ │ │ │ +0002d2b0: 7072 6573 7369 6f6e 3c2f 7370 616e 3e20 pression │ │ │ │ +0002d2c0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002d2d0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = express │ │ │ │ +0002d2f0: 696f 6e3c 2f73 7061 6e3e 0a0a 2020 2020 ion.. │ │ │ │ +0002d300: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0002d310: 6465 663c 2f73 7061 6e3e 203c 7370 616e def set_ │ │ │ │ +0002d330: 736f 7572 6365 5f65 7870 7265 7373 696f source_expressio │ │ │ │ +0002d340: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063 ns(self, exprs):. │ │ │ │ +0002d3d0: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +0002d3f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002d400: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .expressi │ │ │ │ +0002d420: 6f6e 3c2f 7370 616e 3e20 3c73 7061 6e20 on = exprs< │ │ │ │ +0002d460: 7370 616e 2063 6c61 7373 3d22 7022 3e5b span class="p">[ │ │ │ │ +0002d470: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 0 │ │ │ │ +0002d490: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002d4a0: 5d3c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ].. de │ │ │ │ +0002d4c0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f get_so │ │ │ │ +0002d4e0: 7572 6365 5f65 7870 7265 7373 696f 6e73 urce_expressions │ │ │ │ +0002d4f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0002d510: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0002d520: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. ret │ │ │ │ +0002d560: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn [self< │ │ │ │ +0002d5a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0002d5b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 expressio │ │ │ │ +0002d5d0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n] │ │ │ │ +0002d5f0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ +0002d610: 203c 7370 616e 2063 6c61 7373 3d22 6e66 get_group_by_c │ │ │ │ +0002d630: 6f6c 733c 2f73 7061 6e3e 3c73 7061 6e20 ols(self): │ │ │ │ +0002d680: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0002d690: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0002d6a0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if isins │ │ │ │ +0002d6c0: 7461 6e63 653c 2f73 7061 6e3e 3c73 7061 tance(self │ │ │ │ +0002d700: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002d710: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .expressi │ │ │ │ +0002d730: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on, Expression):. │ │ │ │ +0002d790: 2020 2020 2020 2020 203c 7370 616e 2063 express │ │ │ │ +0002d7b0: 696f 6e3c 2f73 7061 6e3e 203c 7370 616e ion = self │ │ │ │ +0002d7f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002d800: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .expressi │ │ │ │ +0002d820: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on.copy(). │ │ │ │ +0002d880: 2020 3c73 7061 6e20 636c 6173 733d 226e expression.outpu │ │ │ │ +0002d8d0: 745f 6669 656c 643c 2f73 7061 6e3e 203c t_field < │ │ │ │ +0002d8e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +0002d8f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.outp │ │ │ │ +0002d940: 7574 5f66 6965 6c64 3c2f 7370 616e 3e0a ut_field. │ │ │ │ +0002d950: 2020 2020 2020 2020 2020 2020 3c73 7061 retu │ │ │ │ +0002d970: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn expres │ │ │ │ +0002d990: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion.get_group_by_ │ │ │ │ +0002d9d0: 636f 6c73 3c2f 7370 616e 3e3c 7370 616e cols(). # │ │ │ │ +0002da10: 466f 7220 6e6f 6e2d 6578 7072 6573 7369 For non-expressi │ │ │ │ +0002da20: 6f6e 7320 652e 672e 2061 6e20 5351 4c20 ons e.g. an SQL │ │ │ │ +0002da30: 5748 4552 4520 636c 6175 7365 2c20 7468 WHERE clause, th │ │ │ │ +0002da40: 6520 656e 7469 7265 3c2f 7370 616e 3e0a e entire. │ │ │ │ +0002da50: 2020 2020 2020 2020 3c73 7061 6e20 636c # `expr │ │ │ │ +0002da70: 6573 7369 6f6e 6020 6d75 7374 2062 6520 ession` must be │ │ │ │ +0002da80: 696e 636c 7564 6564 2069 6e20 7468 6520 included in the │ │ │ │ +0002da90: 4752 4f55 5020 4259 2063 6c61 7573 652e GROUP BY clause. │ │ │ │ +0002daa0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0002dab0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0002dac0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return s │ │ │ │ +0002dae0: 7570 6572 3c2f 7370 616e 3e3c 7370 616e uper().get_ │ │ │ │ +0002db30: 6772 6f75 705f 6279 5f63 6f6c 733c 2f73 group_by_cols().. │ │ │ │ +0002db60: 2020 203c 7370 616e 2063 6c61 7373 3d22 def a │ │ │ │ +0002db90: 735f 7371 6c3c 2f73 7061 6e3e 3c73 7061 s_sql(self │ │ │ │ +0002dbd0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002dbe0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , compile │ │ │ │ +0002dc00: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r, │ │ │ │ +0002dc20: 203c 7370 616e 2063 6c61 7373 3d22 6e22 connection):. │ │ │ │ +0002dc60: 2020 2020 3c73 7061 6e20 636c 6173 733d return compiler.compile │ │ │ │ +0002dcd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0002dcf0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0002dd00: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.expression).. │ │ │ │ +0002dd60: 2020 3c73 7061 6e20 636c 6173 733d 226b def __ │ │ │ │ +0002dd90: 7265 7072 5f5f 3c2f 7370 616e 3e3c 7370 repr__(self):. │ │ │ │ +0002ddf0: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ +0002de10: 203c 7370 616e 2063 6c61 7373 3d22 7332 "< │ │ │ │ +0002de30: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ +0002de40: 7b7d 3c2f 7370 616e 3e3c 7370 616e 2063 {}({})&q │ │ │ │ +0002de90: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;.format │ │ │ │ +0002ded0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002dee0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self.__c │ │ │ │ +0002df30: 6c61 7373 5f5f 3c2f 7370 616e 3e3c 7370 lass__.__name__, s │ │ │ │ +0002dfa0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.expression)
....class NegatedExpres │ │ │ │ +0002e040: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion(ExpressionWra │ │ │ │ +0002e080: 7070 6572 3c2f 7370 616e 3e3c 7370 616e pper):. │ │ │ │ +0002e0c0: 3c73 7061 6e20 636c 6173 733d 2273 6422 ""&qu │ │ │ │ +0002e0e0: 6f74 3b54 6865 206c 6f67 6963 616c 206e ot;The logical n │ │ │ │ +0002e0f0: 6567 6174 696f 6e20 6f66 2061 2063 6f6e egation of a con │ │ │ │ +0002e100: 6469 7469 6f6e 616c 2065 7870 7265 7373 ditional express │ │ │ │ +0002e110: 696f 6e2e 2671 756f 743b 2671 756f 743b ion."" │ │ │ │ +0002e120: 2671 756f 743b 3c2f 7370 616e 3e0a 0a20 ".. │ │ │ │ +0002e130: 2020 203c 7370 616e 2063 6c61 7373 3d22 def _ │ │ │ │ +0002e160: 5f69 6e69 745f 5f3c 2f73 7061 6e3e 3c73 _init__(< │ │ │ │ +0002e180: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self, expre │ │ │ │ +0002e1d0: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion):. s │ │ │ │ +0002e210: 7570 6572 3c2f 7370 616e 3e3c 7370 616e uper().__i │ │ │ │ +0002e260: 6e69 745f 5f3c 2f73 7061 6e3e 3c73 7061 nit__(expression, ou │ │ │ │ +0002e2d0: 7470 7574 5f66 6965 6c64 3c2f 7370 616e tput_field=fields< │ │ │ │ +0002e310: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Bo │ │ │ │ +0002e340: 6f6c 6561 6e46 6965 6c64 3c2f 7370 616e oleanField()).. │ │ │ │ +0002e370: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def __i │ │ │ │ +0002e3a0: 6e76 6572 745f 5f3c 2f73 7061 6e3e 3c73 nvert__(< │ │ │ │ +0002e3c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self):. │ │ │ │ +0002e400: 2020 2020 3c73 7061 6e20 636c 6173 733d return self.< │ │ │ │ +0002e450: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>expression │ │ │ │ +0002e470: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0002e490: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0002e4a0: 6f70 793c 2f73 7061 6e3e 3c73 7061 6e20 opy().. def as_sql(self< │ │ │ │ +0002e530: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0002e550: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0002e560: 6f6d 7069 6c65 723c 2f73 7061 6e3e 3c73 ompiler,< │ │ │ │ +0002e580: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> connectio │ │ │ │ +0002e5a0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n):. try:. │ │ │ │ +0002e600: 2020 2020 2020 2020 203c 7370 616e 2063 sql, para │ │ │ │ +0002e650: 6d73 3c2f 7370 616e 3e20 3c73 7061 6e20 ms = super │ │ │ │ +0002e690: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002e6a0: 2829 3c2f 7370 616e 3e3c 7370 616e 2063 ().as_sql(< │ │ │ │ +0002e6f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>compiler, co │ │ │ │ +0002e740: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ +0002e750: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0002e760: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0002e770: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0002e780: 6578 6365 7074 3c2f 7370 616e 3e20 3c73 except Em │ │ │ │ +0002e7a0: 7074 7952 6573 756c 7453 6574 3c2f 7370 ptyResultSet:. │ │ │ │ +0002e7d0: 2020 2020 2020 2020 3c73 7061 6e20 636c features │ │ │ │ +0002e7f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +0002e810: 203c 7370 616e 2063 6c61 7373 3d22 6e22 compiler │ │ │ │ +0002e830: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002e840: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .connecti │ │ │ │ +0002e860: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on.features │ │ │ │ +0002e8a0: 0a20 2020 2020 2020 2020 2020 203c 7370 . if< │ │ │ │ +0002e8c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> not features.suppor │ │ │ │ +0002e930: 7473 5f62 6f6f 6c65 616e 5f65 7870 725f ts_boolean_expr_ │ │ │ │ +0002e940: 696e 5f73 656c 6563 745f 636c 6175 7365 in_select_clause │ │ │ │ +0002e950: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +0002e970: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +0002e980: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0002e990: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return & │ │ │ │ +0002e9b0: 7175 6f74 3b31 3d31 2671 756f 743b 3c2f quot;1=1", () │ │ │ │ +0002e9f0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0002ea00: 2020 2020 3c73 7061 6e20 636c 6173 733d return compiler.compile │ │ │ │ +0002ea70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0002ea90: 7370 616e 2063 6c61 7373 3d22 6e22 3e56 span class="n">V │ │ │ │ +0002eaa0: 616c 7565 3c2f 7370 616e 3e3c 7370 616e alue(True< │ │ │ │ +0002eae0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0002eaf0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +0002eb00: 203c 7370 616e 2063 6c61 7373 3d22 6e22 ops = compiler.conn │ │ │ │ +0002eb80: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection.ops. │ │ │ │ +0002ebc0: 2020 2020 2020 2020 3c73 7061 6e20 636c # Some │ │ │ │ +0002ebe0: 6461 7461 6261 7365 2062 6163 6b65 6e64 database backend │ │ │ │ +0002ebf0: 7320 2865 2e67 2e20 4f72 6163 6c65 2920 s (e.g. Oracle) │ │ │ │ +0002ec00: 646f 6e26 2333 393b 7420 616c 6c6f 7720 don't allow │ │ │ │ +0002ec10: 4558 4953 5453 2829 2061 6e64 2066 696c EXISTS() and fil │ │ │ │ +0002ec20: 7465 7273 3c2f 7370 616e 3e0a 2020 2020 ters. │ │ │ │ +0002ec30: 2020 2020 3c73 7061 6e20 636c 6173 733d # to be com │ │ │ │ +0002ec50: 7061 7265 6420 746f 2061 6e6f 7468 6572 pared to another │ │ │ │ +0002ec60: 2065 7870 7265 7373 696f 6e20 756e 6c65 expression unle │ │ │ │ +0002ec70: 7373 2074 6865 7926 2333 393b 7265 2077 ss they're w │ │ │ │ +0002ec80: 7261 7070 6564 2069 6e20 6120 4341 5345 rapped in a CASE │ │ │ │ +0002ec90: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0002eca0: 3c73 7061 6e20 636c 6173 733d 2263 3122 # WHEN.. │ │ │ │ +0002ecc0: 2020 2020 2020 2020 3c73 7061 6e20 636c if not op │ │ │ │ +0002ed10: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +0002ed30: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0002ed40: 636f 6e64 6974 696f 6e61 6c5f 6578 7072 conditional_expr │ │ │ │ +0002ed50: 6573 7369 6f6e 5f73 7570 706f 7274 6564 ession_supported │ │ │ │ +0002ed60: 5f69 6e5f 7768 6572 655f 636c 6175 7365 _in_where_clause │ │ │ │ +0002ed70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0002ed90: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0002eda0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.expression):. │ │ │ │ +0002ee00: 2020 2020 2020 2020 2020 3c73 7061 6e20 return │ │ │ │ +0002ee20: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c f"CASE WHE │ │ │ │ +0002ee60: 4e20 3c2f 7370 616e 3e3c 7370 616e 2063 N {sql} = 0 THEN │ │ │ │ +0002eed0: 3120 454c 5345 2030 2045 4e44 2671 756f 1 ELSE 0 END&quo │ │ │ │ +0002eee0: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;, params. │ │ │ │ +0002ef20: 2020 2020 2020 2020 3c73 7061 6e20 636c return f< │ │ │ │ +0002ef60: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +0002ef70: 2671 756f 743b 4e4f 5420 3c2f 7370 616e "NOT {sql}&q │ │ │ │ +0002efe0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;, params.. def resolve_expre │ │ │ │ +0002f060: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion(. se │ │ │ │ +0002f0a0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf, query=< │ │ │ │ +0002f0f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>None, allow │ │ │ │ +0002f140: 5f6a 6f69 6e73 3c2f 7370 616e 3e3c 7370 _joins=True, reuse< │ │ │ │ +0002f1b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=N │ │ │ │ +0002f1e0: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one, summarize=Fals │ │ │ │ +0002f250: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ +0002f270: 203c 7370 616e 2063 6c61 7373 3d22 6e22 for_save │ │ │ │ +0002f290: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0002f2a0: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =False. ):. reso │ │ │ │ +0002f300: 6c76 6564 3c2f 7370 616e 3e20 3c73 7061 lved = super().resolve_expre │ │ │ │ +0002f390: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion(. │ │ │ │ +0002f3c0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 query, allow_join │ │ │ │ +0002f410: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s, │ │ │ │ +0002f430: 203c 7370 616e 2063 6c61 7373 3d22 6e22 reuse, summarize< │ │ │ │ +0002f480: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0002f4a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +0002f4b0: 6f72 5f73 6176 653c 2f73 7061 6e3e 0a20 or_save. │ │ │ │ +0002f4c0: 2020 2020 2020 203c 7370 616e 2063 6c61 ). │ │ │ │ +0002f4e0: 2020 2020 2020 2020 3c73 7061 6e20 636c if not g │ │ │ │ +0002f530: 6574 6174 7472 3c2f 7370 616e 3e3c 7370 etattr(resolved.expr │ │ │ │ +0002f5a0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession, "con │ │ │ │ +0002f5e0: 6469 7469 6f6e 616c 2671 756f 743b 3c2f ditional", F │ │ │ │ +0002f620: 616c 7365 3c2f 7370 616e 3e3c 7370 616e alse):. │ │ │ │ +0002f650: 203c 7370 616e 2063 6c61 7373 3d22 6b22 raise T │ │ │ │ +0002f680: 7970 6545 7272 6f72 3c2f 7370 616e 3e3c ypeError< │ │ │ │ +0002f690: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0002f6a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 "Ca │ │ │ │ +0002f6c0: 6e6e 6f74 206e 6567 6174 6520 6e6f 6e2d nnot negate non- │ │ │ │ +0002f6d0: 636f 6e64 6974 696f 6e61 6c20 6578 7072 conditional expr │ │ │ │ +0002f6e0: 6573 7369 6f6e 732e 2671 756f 743b 3c2f essions."). │ │ │ │ +0002f710: 2020 2020 2020 3c73 7061 6e20 636c 6173 return resolved.. def select_form │ │ │ │ +0002f790: 6174 3c2f 7370 616e 3e3c 7370 616e 2063 at(self, compiler, sq │ │ │ │ +0002f830: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l, │ │ │ │ +0002f850: 203c 7370 616e 2063 6c61 7373 3d22 6e22 params): │ │ │ │ +0002f880: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0002f890: 3c73 7061 6e20 636c 6173 733d 2263 3122 # Wrap boolean │ │ │ │ +0002f8b0: 6578 7072 6573 7369 6f6e 7320 7769 7468 expressions with │ │ │ │ +0002f8c0: 2061 2043 4153 4520 5748 454e 2065 7870 a CASE WHEN exp │ │ │ │ +0002f8d0: 7265 7373 696f 6e20 6966 2061 2064 6174 ression if a dat │ │ │ │ +0002f8e0: 6162 6173 653c 2f73 7061 6e3e 0a20 2020 abase. │ │ │ │ +0002f8f0: 2020 2020 203c 7370 616e 2063 6c61 7373 # backend │ │ │ │ +0002f910: 2865 2e67 2e20 4f72 6163 6c65 2920 646f (e.g. Oracle) do │ │ │ │ +0002f920: 6573 6e26 2333 393b 7420 7375 7070 6f72 esn't suppor │ │ │ │ +0002f930: 7420 626f 6f6c 6561 6e20 6578 7072 6573 t boolean expres │ │ │ │ +0002f940: 7369 6f6e 2069 6e20 5345 4c45 4354 206f sion in SELECT o │ │ │ │ +0002f950: 723c 2f73 7061 6e3e 0a20 2020 2020 2020 r. │ │ │ │ +0002f960: 203c 7370 616e 2063 6c61 7373 3d22 6331 # GROUP BY lis │ │ │ │ +0002f980: 742e 3c2f 7370 616e 3e0a 2020 2020 2020 t.. │ │ │ │ +0002f990: 2020 3c73 7061 6e20 636c 6173 733d 226e expression_sup │ │ │ │ +0002f9b0: 706f 7274 6564 5f69 6e5f 7768 6572 655f ported_in_where_ │ │ │ │ +0002f9c0: 636c 6175 7365 3c2f 7370 616e 3e20 3c73 clause =< │ │ │ │ +0002f9e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (. │ │ │ │ +0002fa00: 2020 2020 2020 2020 2020 2020 3c73 7061 comp │ │ │ │ +0002fa20: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler.connection.ops< │ │ │ │ +0002fa90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ +0002fac0: 6e64 6974 696f 6e61 6c5f 6578 7072 6573 nditional_expres │ │ │ │ +0002fad0: 7369 6f6e 5f73 7570 706f 7274 6564 5f69 sion_supported_i │ │ │ │ +0002fae0: 6e5f 7768 6572 655f 636c 6175 7365 3c2f n_where_clause. )< │ │ │ │ +0002fb10: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0002fb20: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ +0002fb30: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f (. n │ │ │ │ +0002fb70: 6f74 3c2f 7370 616e 3e20 3c73 7061 6e20 ot compil │ │ │ │ +0002fb90: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er.connection.featur │ │ │ │ +0002fc00: 6573 3c2f 7370 616e 3e3c 7370 616e 2063 es.supports_boolea │ │ │ │ +0002fc40: 6e5f 6578 7072 5f69 6e5f 7365 6c65 6374 n_expr_in_select │ │ │ │ +0002fc50: 5f63 6c61 7573 653c 2f73 7061 6e3e 0a20 _clause. │ │ │ │ +0002fc60: 2020 2020 2020 2020 2020 203c 7370 616e # Av │ │ │ │ +0002fc80: 6f69 6420 646f 7562 6c65 2077 7261 7070 oid double wrapp │ │ │ │ +0002fc90: 696e 672e 3c2f 7370 616e 3e0a 2020 2020 ing.. │ │ │ │ +0002fca0: 2020 2020 2020 2020 3c73 7061 6e20 636c and expression_s │ │ │ │ +0002fce0: 7570 706f 7274 6564 5f69 6e5f 7768 6572 upported_in_wher │ │ │ │ +0002fcf0: 655f 636c 6175 7365 3c2f 7370 616e 3e3c e_clause< │ │ │ │ +0002fd00: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0002fd10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.expre │ │ │ │ +0002fd60: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion). ):< │ │ │ │ +0002fda0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0002fdb0: 2020 203c 7370 616e 2063 6c61 7373 3d22 sql =< │ │ │ │ +0002fde0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "CA │ │ │ │ +0002fe00: 5345 2057 4845 4e20 3c2f 7370 616e 3e3c SE WHEN < │ │ │ │ +0002fe10: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ +0002fe20: 7b7d 3c2f 7370 616e 3e3c 7370 616e 2063 {} THEN │ │ │ │ +0002fe40: 3120 454c 5345 2030 2045 4e44 2671 756f 1 ELSE 0 END&quo │ │ │ │ +0002fe50: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;.format(< │ │ │ │ +0002fea0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>sql │ │ │ │ +0002fec0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0002fed0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +0002fee0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +0002ff00: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ +0002ff10: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql, params. │ │ │ │ +0002ff50: 0a0a 3c64 6976 2063 6c61 7373 3d22 7669 ..
.[ │ │ │ │ +0002fff0: 646f 6375 6d65 6e74 695d 3c2f 613e 0a3c documenti].< │ │ │ │ +00030000: 7370 616e 2063 6c61 7373 3d22 6e64 223e span class="nd"> │ │ │ │ +00030010: 4064 6563 6f6e 7374 7275 6374 6962 6c65 @deconstructible │ │ │ │ 00030020: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00030040: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00030050: 636c 6173 733c 2f73 7061 6e3e 203c 7370 class Wh │ │ │ │ -00030070: 656e 3c2f 7370 616e 3e3c 7370 616e 2063 en(Expression):. │ │ │ │ -000300d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000300e0: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ -000300f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00030100: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = " │ │ │ │ -00030120: 5748 454e 203c 2f73 7061 6e3e 3c73 7061 WHEN %(c │ │ │ │ -00030140: 6f6e 6469 7469 6f6e 2973 3c2f 7370 616e ondition)s THEN < │ │ │ │ -00030170: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -00030180: 2528 7265 7375 6c74 2973 3c2f 7370 616e %(result)s". │ │ │ │ -000301b0: 2020 2020 3c73 7061 6e20 636c 6173 733d # This isn& │ │ │ │ -000301d0: 2333 393b 7420 6120 636f 6d70 6c65 7465 #39;t a complete │ │ │ │ -000301e0: 2063 6f6e 6469 7469 6f6e 616c 2065 7870 conditional exp │ │ │ │ -000301f0: 7265 7373 696f 6e2c 206d 7573 7420 6265 ression, must be │ │ │ │ -00030200: 2075 7365 6420 696e 2043 6173 6528 292e used in Case(). │ │ │ │ -00030210: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . cond │ │ │ │ -00030230: 6974 696f 6e61 6c3c 2f73 7061 6e3e 203c itional < │ │ │ │ -00030240: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00030250: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c False.. def __init__< │ │ │ │ -000302b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -000302e0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, condition=None │ │ │ │ -00030350: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00030370: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00030380: 7468 656e 3c2f 7370 616e 3e3c 7370 616e then=None< │ │ │ │ -000303c0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -000303d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c **lookups< │ │ │ │ -00030410: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00030420: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00030430: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if looku │ │ │ │ -00030460: 7073 3c2f 7370 616e 3e3c 7370 616e 2063 ps:. if │ │ │ │ -000304a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c conditio │ │ │ │ -000304c0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n is None │ │ │ │ -00030500: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00030510: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00030520: 2020 2020 2020 2020 203c 7370 616e 2063 conditi │ │ │ │ -00030540: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on, lookups │ │ │ │ -00030580: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = Q(**lookups), None │ │ │ │ -00030630: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00030640: 2020 2020 3c73 7061 6e20 636c 6173 733d elif │ │ │ │ -00030660: 3c73 7061 6e20 636c 6173 733d 226e 6222 getattr< │ │ │ │ -00030680: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00030690: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 condition │ │ │ │ -000306b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -000306d0: 3c73 7061 6e20 636c 6173 733d 2273 3222 "condition │ │ │ │ -000306f0: 616c 2671 756f 743b 3c2f 7370 616e 3e3c al"< │ │ │ │ -00030700: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00030710: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c False):. │ │ │ │ -00030750: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ -00030760: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00030770: 6f6e 6469 7469 6f6e 3c2f 7370 616e 3e3c ondition< │ │ │ │ -00030780: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00030790: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c lookups< │ │ │ │ -000307b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -000307d0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000307e0: 513c 2f73 7061 6e3e 3c73 7061 6e20 636c Q( │ │ │ │ -00030800: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00030810: 636f 6e64 6974 696f 6e3c 2f73 7061 6e3e condition │ │ │ │ -00030820: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00030830: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , **lookups │ │ │ │ -00030870: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00030880: 292c 3c2f 7370 616e 3e20 3c73 7061 6e20 ), None< │ │ │ │ -000308a0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -000308b0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ -000308c0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f conditi │ │ │ │ -000308e0: 6f6e 3c2f 7370 616e 3e20 3c73 7061 6e20 on is None or no │ │ │ │ -00030950: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t getatt │ │ │ │ -00030970: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r( │ │ │ │ -00030990: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000309a0: 636f 6e64 6974 696f 6e3c 2f73 7061 6e3e condition │ │ │ │ -000309b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000309c0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , " │ │ │ │ -000309e0: 636f 6e64 6974 696f 6e61 6c26 7175 6f74 conditional" │ │ │ │ -000309f0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;, │ │ │ │ -00030a10: 203c 7370 616e 2063 6c61 7373 3d22 6b63 False)< │ │ │ │ -00030a40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> or lookups │ │ │ │ -00030a80: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00030a90: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00030aa0: 2020 2020 203c 7370 616e 2063 6c61 7373 raise TypeError(. │ │ │ │ -00030b00: 2020 2020 2020 2020 2020 2020 3c73 7061 &qu │ │ │ │ -00030b20: 6f74 3b57 6865 6e28 2920 7375 7070 6f72 ot;When() suppor │ │ │ │ -00030b30: 7473 2061 2051 206f 626a 6563 742c 2061 ts a Q object, a │ │ │ │ -00030b40: 2062 6f6f 6c65 616e 2065 7870 7265 7373 boolean express │ │ │ │ -00030b50: 696f 6e2c 206f 7220 6c6f 6f6b 7570 7320 ion, or lookups │ │ │ │ -00030b60: 2671 756f 743b 3c2f 7370 616e 3e0a 2020 ". │ │ │ │ -00030b70: 2020 2020 2020 2020 2020 2020 2020 3c73 & │ │ │ │ -00030b90: 7175 6f74 3b61 7320 6120 636f 6e64 6974 quot;as a condit │ │ │ │ -00030ba0: 696f 6e2e 2671 756f 743b 3c2f 7370 616e ion.". )< │ │ │ │ -00030bd0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00030be0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ -00030bf0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f isinst │ │ │ │ -00030c10: 616e 6365 3c2f 7370 616e 3e3c 7370 616e ance(condition, Q) an │ │ │ │ -00030cb0: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d not condition:. │ │ │ │ -00030d10: 2020 2020 2020 2020 2020 3c73 7061 6e20 raise< │ │ │ │ -00030d30: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ValueErr │ │ │ │ -00030d50: 6f72 3c2f 7370 616e 3e3c 7370 616e 2063 or("An empty │ │ │ │ -00030d90: 2051 2829 2063 616e 2623 3339 3b74 2062 Q() can't b │ │ │ │ -00030da0: 6520 7573 6564 2061 7320 6120 5768 656e e used as a When │ │ │ │ -00030db0: 2829 2063 6f6e 6469 7469 6f6e 2e26 7175 () condition.&qu │ │ │ │ -00030dc0: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;). supe │ │ │ │ -00030e00: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r().__init │ │ │ │ -00030e50: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __(output_field=Non │ │ │ │ -00030ec0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e) │ │ │ │ -00030ee0: 0a20 2020 2020 2020 203c 7370 616e 2063 . self.con │ │ │ │ -00030f30: 6469 7469 6f6e 3c2f 7370 616e 3e20 3c73 dition =< │ │ │ │ -00030f50: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> condition │ │ │ │ -00030f70: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00030f80: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.result = self │ │ │ │ -00031000: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00031020: 7370 616e 2063 6c61 7373 3d22 6e22 3e5f span class="n">_ │ │ │ │ -00031030: 7061 7273 655f 6578 7072 6573 7369 6f6e parse_expression │ │ │ │ -00031040: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s( │ │ │ │ -00031060: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00031070: 7468 656e 3c2f 7370 616e 3e3c 7370 616e then)[0].. def __str__(se │ │ │ │ -00031130: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf):. retur │ │ │ │ -00031170: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n " │ │ │ │ -00031190: 5748 454e 203c 2f73 7061 6e3e 3c73 7061 WHEN %r< │ │ │ │ -000311b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span> THEN %r& │ │ │ │ -00031200: 7175 6f74 3b3c 2f73 7061 6e3e 203c 7370 quot; % (s │ │ │ │ -00031250: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.condition, self │ │ │ │ -000312c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000312e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ -000312f0: 6573 756c 743c 2f73 7061 6e3e 3c73 7061 esult).. def __repr__(se │ │ │ │ -00031380: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf):. retur │ │ │ │ -000313c0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n " │ │ │ │ -000313e0: 266c 743b 3c2f 7370 616e 3e3c 7370 616e <%s: < │ │ │ │ -00031420: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -00031430: 2573 3c2f 7370 616e 3e3c 7370 616e 2063 %s>&q │ │ │ │ -00031450: 756f 743b 3c2f 7370 616e 3e20 3c73 7061 uot; % (se │ │ │ │ -000314a0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.__class__.__nam │ │ │ │ -00031510: 655f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 e__, self< │ │ │ │ -00031550: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00031560: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -00031580: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c get_sou │ │ │ │ -000315a0: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ -000315b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -000315e0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. retu │ │ │ │ -00031620: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn [self.< │ │ │ │ -00031670: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>condition< │ │ │ │ -00031690: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -000316b0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -000316c0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.result │ │ │ │ -00031700: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00031710: 5d3c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ].. de │ │ │ │ -00031730: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f set_so │ │ │ │ -00031750: 7572 6365 5f65 7870 7265 7373 696f 6e73 urce_expressions │ │ │ │ +00030030: 7373 3d22 7022 3e28 3c2f 7370 616e 3e3c ss="p">(< │ │ │ │ +00030040: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ +00030050: 6174 683c 2f73 7061 6e3e 3c73 7061 6e20 ath="django. │ │ │ │ +00030090: 6462 2e6d 6f64 656c 732e 5768 656e 2671 db.models.When&q │ │ │ │ +000300a0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;).class │ │ │ │ +000300e0: 203c 7370 616e 2063 6c61 7373 3d22 6e63 When(Expression< │ │ │ │ +00030130: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ +00030150: 2020 2020 3c73 7061 6e20 636c 6173 733d template = &q │ │ │ │ +000301a0: 756f 743b 5748 454e 203c 2f73 7061 6e3e uot;WHEN │ │ │ │ +000301b0: 3c73 7061 6e20 636c 6173 733d 2273 6922 %(condition)s THEN %(result)s". # This │ │ │ │ +00030250: 6973 6e26 2333 393b 7420 6120 636f 6d70 isn't a comp │ │ │ │ +00030260: 6c65 7465 2063 6f6e 6469 7469 6f6e 616c lete conditional │ │ │ │ +00030270: 2065 7870 7265 7373 696f 6e2c 206d 7573 expression, mus │ │ │ │ +00030280: 7420 6265 2075 7365 6420 696e 2043 6173 t be used in Cas │ │ │ │ +00030290: 6528 292e 3c2f 7370 616e 3e0a 2020 2020 e().. │ │ │ │ +000302a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000302b0: 636f 6e64 6974 696f 6e61 6c3c 2f73 7061 conditional = Fal │ │ │ │ +000302f0: 7365 3c2f 7370 616e 3e0a 0a20 2020 203c se.. < │ │ │ │ +00030300: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +00030310: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef __ini │ │ │ │ +00030330: 745f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 t__(self,< │ │ │ │ +00030380: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> condition │ │ │ │ +000303a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 =< │ │ │ │ +000303c0: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ +000303d0: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e None, then< │ │ │ │ +00030410: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00030420: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 None, **lookups):. │ │ │ │ +000304b0: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +000304d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6c span class="n">l │ │ │ │ +000304e0: 6f6f 6b75 7073 3c2f 7370 616e 3e3c 7370 ookups:. │ │ │ │ +00030510: 2020 3c73 7061 6e20 636c 6173 733d 226b if cond │ │ │ │ +00030540: 6974 696f 6e3c 2f73 7061 6e3e 203c 7370 ition is │ │ │ │ +00030560: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c None:. │ │ │ │ +000305a0: 2020 2020 2020 2020 2020 2020 203c 7370 con │ │ │ │ +000305c0: 6469 7469 6f6e 3c2f 7370 616e 3e3c 7370 dition, lookups = Q< │ │ │ │ +00030630: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(** │ │ │ │ +00030660: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 lookups), < │ │ │ │ +000306a0: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ +000306b0: 4e6f 6e65 3c2f 7370 616e 3e0a 2020 2020 None. │ │ │ │ +000306c0: 2020 2020 2020 2020 3c73 7061 6e20 636c elif getattr(condi │ │ │ │ +00030730: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion, "condi │ │ │ │ +00030770: 7469 6f6e 616c 2671 756f 743b 3c2f 7370 tional", Fal │ │ │ │ +000307b0: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se):. │ │ │ │ +000307e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 condition, look │ │ │ │ +00030830: 7570 733c 2f73 7061 6e3e 203c 7370 616e ups = Q(condition, **< │ │ │ │ +000308d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>lookups), N │ │ │ │ +00030920: 6f6e 653c 2f73 7061 6e3e 0a20 2020 2020 one. │ │ │ │ +00030930: 2020 203c 7370 616e 2063 6c61 7373 3d22 if con │ │ │ │ +00030960: 6469 7469 6f6e 3c2f 7370 616e 3e20 3c73 dition i │ │ │ │ +00030980: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s None or │ │ │ │ +000309c0: 203c 7370 616e 2063 6c61 7373 3d22 6f77 not ge │ │ │ │ +000309f0: 7461 7474 723c 2f73 7061 6e3e 3c73 7061 tattr(condition, &q │ │ │ │ +00030a60: 756f 743b 636f 6e64 6974 696f 6e61 6c26 uot;conditional& │ │ │ │ +00030a70: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;, False) or lookups:. │ │ │ │ +00030b20: 2020 2020 2020 2020 203c 7370 616e 2063 raise TypeError │ │ │ │ +00030b60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (. │ │ │ │ +00030b80: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00030b90: 3c73 7061 6e20 636c 6173 733d 2273 3222 "When() su │ │ │ │ +00030bb0: 7070 6f72 7473 2061 2051 206f 626a 6563 pports a Q objec │ │ │ │ +00030bc0: 742c 2061 2062 6f6f 6c65 616e 2065 7870 t, a boolean exp │ │ │ │ +00030bd0: 7265 7373 696f 6e2c 206f 7220 6c6f 6f6b ression, or look │ │ │ │ +00030be0: 7570 7320 2671 756f 743b 3c2f 7370 616e ups ". │ │ │ │ +00030c00: 2020 3c73 7061 6e20 636c 6173 733d 2273 "as a co │ │ │ │ +00030c20: 6e64 6974 696f 6e2e 2671 756f 743b 3c2f ndition.". │ │ │ │ +00030c40: 2020 3c73 7061 6e20 636c 6173 733d 2270 ). │ │ │ │ +00030c60: 2020 203c 7370 616e 2063 6c61 7373 3d22 if is │ │ │ │ +00030c90: 696e 7374 616e 6365 3c2f 7370 616e 3e3c instance< │ │ │ │ +00030ca0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00030cb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 condition │ │ │ │ +00030cd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00030cf0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00030d00: 513c 2f73 7061 6e3e 3c73 7061 6e20 636c Q) │ │ │ │ +00030d20: 203c 7370 616e 2063 6c61 7373 3d22 6f77 and no │ │ │ │ +00030d50: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t conditi │ │ │ │ +00030d70: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on:. ra │ │ │ │ +00030db0: 6973 653c 2f73 7061 6e3e 203c 7370 616e ise Valu │ │ │ │ +00030dd0: 6545 7272 6f72 3c2f 7370 616e 3e3c 7370 eError("An e │ │ │ │ +00030e10: 6d70 7479 2051 2829 2063 616e 2623 3339 mpty Q() can' │ │ │ │ +00030e20: 3b74 2062 6520 7573 6564 2061 7320 6120 ;t be used as a │ │ │ │ +00030e30: 5768 656e 2829 2063 6f6e 6469 7469 6f6e When() condition │ │ │ │ +00030e40: 2e26 7175 6f74 3b3c 2f73 7061 6e3e 3c73 .")< │ │ │ │ +00030e60: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00030e70: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +00030e80: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().__ │ │ │ │ +00030ed0: 696e 6974 5f5f 3c2f 7370 616e 3e3c 7370 init__(output_fiel │ │ │ │ +00030f10: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d= │ │ │ │ +00030f30: 3c73 7061 6e20 636c 6173 733d 226b 6322 None). se │ │ │ │ +00030f80: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.condition = condi │ │ │ │ +00030ff0: 7469 6f6e 3c2f 7370 616e 3e0a 2020 2020 tion. │ │ │ │ +00031000: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +00031020: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00031030: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .result = < │ │ │ │ +00031070: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00031080: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self._parse_expres │ │ │ │ +000310c0: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061 sions(then< │ │ │ │ +00031100: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00031110: 5b3c 2f73 7061 6e3e 3c73 7061 6e20 636c [0].. < │ │ │ │ +00031150: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +00031160: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef __str │ │ │ │ +00031180: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __(self):< │ │ │ │ +000311d0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +000311e0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +000311f0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn &q │ │ │ │ +00031210: 756f 743b 5748 454e 203c 2f73 7061 6e3e uot;WHEN │ │ │ │ +00031220: 3c73 7061 6e20 636c 6173 733d 2273 6922 %r THEN │ │ │ │ +00031250: 203c 2f73 7061 6e3e 3c73 7061 6e20 636c %r" │ │ │ │ +00031290: 203c 7370 616e 2063 6c61 7373 3d22 6f22 % (self.< │ │ │ │ +000312f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>condition< │ │ │ │ +00031310: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00031330: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00031340: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.result │ │ │ │ +00031380: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00031390: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ).. de │ │ │ │ +000313b0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f __repr │ │ │ │ +000313d0: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __(self):< │ │ │ │ +00031420: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00031430: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +00031440: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn &q │ │ │ │ +00031460: 756f 743b 266c 743b 3c2f 7370 616e 3e3c uot;<< │ │ │ │ +00031470: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ +00031480: 2573 3c2f 7370 616e 3e3c 7370 616e 2063 %s: %s&g │ │ │ │ +000314d0: 743b 2671 756f 743b 3c2f 7370 616e 3e20 t;" │ │ │ │ +000314e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000314f0: 253c 2f73 7061 6e3e 203c 7370 616e 2063 % (self.__class__< │ │ │ │ +00031560: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ +00031590: 5f6e 616d 655f 5f3c 2f73 7061 6e3e 3c73 _name__,< │ │ │ │ +000315b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self).. │ │ │ │ +000315f0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def get │ │ │ │ +00031620: 5f73 6f75 7263 655f 6578 7072 6573 7369 _source_expressi │ │ │ │ +00031630: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20 ons(self): │ │ │ │ +00031680: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00031690: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +000316a0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return [< │ │ │ │ +000316c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.condit │ │ │ │ +00031710: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion, self< │ │ │ │ +00031750: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ 00031760: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00031780: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00031790: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self, exprs │ │ │ │ -000317d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000317e0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -000317f0: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ -00031820: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>condition< │ │ │ │ -00031840: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00031860: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00031870: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.result │ │ │ │ -000318b0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = exprs< │ │ │ │ -000318e0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ -00031900: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> get_sour │ │ │ │ -00031920: 6365 5f66 6965 6c64 733c 2f73 7061 6e3e ce_fields │ │ │ │ -00031930: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00031940: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ -00031980: 2020 2020 2020 3c73 7061 6e20 636c 6173 # We' │ │ │ │ -000319a0: 7265 206f 6e6c 7920 696e 7465 7265 7374 re only interest │ │ │ │ -000319b0: 6564 2069 6e20 7468 6520 6669 656c 6473 ed in the fields │ │ │ │ -000319c0: 206f 6620 7468 6520 7265 7375 6c74 2065 of the result e │ │ │ │ -000319d0: 7870 7265 7373 696f 6e73 2e3c 2f73 7061 xpressions.. retur │ │ │ │ -00031a00: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n [self.result._outpu │ │ │ │ -00031aa0: 745f 6669 656c 645f 6f72 5f6e 6f6e 653c t_field_or_none< │ │ │ │ -00031ab0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>].. │ │ │ │ -00031ad0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -00031af0: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ -00031b00: 7265 736f 6c76 655f 6578 7072 6573 7369 resolve_expressi │ │ │ │ -00031b10: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on(. self< │ │ │ │ -00031b50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00031b70: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ -00031b80: 7565 7279 3c2f 7370 616e 3e3c 7370 616e uery=None< │ │ │ │ -00031bc0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00031bd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c allow_jo │ │ │ │ -00031bf0: 696e 733c 2f73 7061 6e3e 3c73 7061 6e20 ins=True,< │ │ │ │ -00031c40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> reuse=None │ │ │ │ -00031c90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00031cb0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00031cc0: 7375 6d6d 6172 697a 653c 2f73 7061 6e3e summarize │ │ │ │ -00031cd0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00031ce0: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =False, fo │ │ │ │ -00031d30: 725f 7361 7665 3c2f 7370 616e 3e3c 7370 r_save=False. ): │ │ │ │ -00031d90: 0a20 2020 2020 2020 203c 7370 616e 2063 . c = self │ │ │ │ -00031de0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00031e00: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00031e10: 6f70 793c 2f73 7061 6e3e 3c73 7061 6e20 opy(). c.is_s │ │ │ │ -00031e80: 756d 6d61 7279 3c2f 7370 616e 3e20 3c73 ummary =< │ │ │ │ -00031ea0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> summarize │ │ │ │ -00031ec0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00031ed0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00031ee0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if hasat │ │ │ │ -00031f00: 7472 3c2f 7370 616e 3e3c 7370 616e 2063 tr(c.condition, " │ │ │ │ -00031fa0: 3b72 6573 6f6c 7665 5f65 7870 7265 7373 ;resolve_express │ │ │ │ -00031fb0: 696f 6e26 7175 6f74 3b3c 2f73 7061 6e3e ion" │ │ │ │ -00031fc0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00031fd0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -00031fe0: 2020 2020 2020 3c73 7061 6e20 636c 6173 c.< │ │ │ │ -00032010: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>condition< │ │ │ │ -00032030: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -00032050: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00032060: 633c 2f73 7061 6e3e 3c73 7061 6e20 636c c. │ │ │ │ -00032080: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00032090: 636f 6e64 6974 696f 6e3c 2f73 7061 6e3e condition │ │ │ │ -000320a0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000320b0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .resolve_ │ │ │ │ -000320d0: 6578 7072 6573 7369 6f6e 3c2f 7370 616e expression(. │ │ │ │ -00032100: 2020 2020 2020 2020 2020 3c73 7061 6e20 query< │ │ │ │ -00032120: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00032140: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -00032150: 6c6c 6f77 5f6a 6f69 6e73 3c2f 7370 616e llow_joins, reuse< │ │ │ │ -00032190: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -000321b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -000321c0: 756d 6d61 7269 7a65 3c2f 7370 616e 3e3c ummarize< │ │ │ │ -000321d0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -000321e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c False. │ │ │ │ -00032210: 2020 3c73 7061 6e20 636c 6173 733d 2270 ). │ │ │ │ -00032230: 2020 203c 7370 616e 2063 6c61 7373 3d22 c.result │ │ │ │ -00032280: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = c.result │ │ │ │ +00031770: 7373 3d22 6e22 3e72 6573 756c 743c 2f73 ss="n">result].. │ │ │ │ +000317a0: 2020 3c73 7061 6e20 636c 6173 733d 226b def se │ │ │ │ +000317d0: 745f 736f 7572 6365 5f65 7870 7265 7373 t_source_express │ │ │ │ +000317e0: 696f 6e73 3c2f 7370 616e 3e3c 7370 616e ions(self< │ │ │ │ +00031820: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00031830: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c exprs):. │ │ │ │ +00031870: 2020 2020 2020 3c73 7061 6e20 636c 6173 self.condit │ │ │ │ +000318c0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion, self< │ │ │ │ +00031900: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00031910: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 result = ex │ │ │ │ +00031960: 7072 733c 2f73 7061 6e3e 0a0a 2020 2020 prs.. │ │ │ │ +00031970: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00031980: 6465 663c 2f73 7061 6e3e 203c 7370 616e def get_ │ │ │ │ +000319a0: 736f 7572 6365 5f66 6965 6c64 733c 2f73 source_fields(sel │ │ │ │ +000319e0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f):. # We& │ │ │ │ +00031a20: 2333 393b 7265 206f 6e6c 7920 696e 7465 #39;re only inte │ │ │ │ +00031a30: 7265 7374 6564 2069 6e20 7468 6520 6669 rested in the fi │ │ │ │ +00031a40: 656c 6473 206f 6620 7468 6520 7265 7375 elds of the resu │ │ │ │ +00031a50: 6c74 2065 7870 7265 7373 696f 6e73 2e3c lt expressions.< │ │ │ │ +00031a60: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00031a70: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +00031a80: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn [self.result< │ │ │ │ +00031af0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._o │ │ │ │ +00031b20: 7574 7075 745f 6669 656c 645f 6f72 5f6e utput_field_or_n │ │ │ │ +00031b30: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one].. def resolve_expr │ │ │ │ +00031b90: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession(. s │ │ │ │ +00031bd0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, query< │ │ │ │ +00031c10: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00031c20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 None, allo │ │ │ │ +00031c70: 775f 6a6f 696e 733c 2f73 7061 6e3e 3c73 w_joins=< │ │ │ │ +00031c90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>True, reuse │ │ │ │ +00031ce0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 =< │ │ │ │ +00031d00: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ +00031d10: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e None, summarize=Fal │ │ │ │ +00031d80: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se, for_save=False< │ │ │ │ +00031df0: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. ):. c = < │ │ │ │ +00031e50: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00031e60: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.copy() │ │ │ │ +00031eb0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00031ec0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00031ed0: 633c 2f73 7061 6e3e 3c73 7061 6e20 636c c. │ │ │ │ +00031ef0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00031f00: 6973 5f73 756d 6d61 7279 3c2f 7370 616e is_summary = summa │ │ │ │ +00031f40: 7269 7a65 3c2f 7370 616e 3e0a 2020 2020 rize. │ │ │ │ +00031f50: 2020 2020 3c73 7061 6e20 636c 6173 733d if h │ │ │ │ +00031f80: 6173 6174 7472 3c2f 7370 616e 3e3c 7370 asattr(c.condition, & │ │ │ │ +00032020: 7175 6f74 3b72 6573 6f6c 7665 5f65 7870 quot;resolve_exp │ │ │ │ +00032030: 7265 7373 696f 6e26 7175 6f74 3b3c 2f73 ression"):. │ │ │ │ +00032060: 2020 2020 2020 2020 2020 3c73 7061 6e20 c.condit │ │ │ │ +000320b0: 696f 6e3c 2f73 7061 6e3e 203c 7370 616e ion = c.condition.reso │ │ │ │ +00032150: 6c76 655f 6578 7072 6573 7369 6f6e 3c2f lve_expression(. │ │ │ │ +00032180: 2020 2020 2020 2020 2020 2020 2020 3c73 qu │ │ │ │ +000321a0: 6572 793c 2f73 7061 6e3e 3c73 7061 6e20 ery, allow_joins, re │ │ │ │ +00032210: 7573 653c 2f73 7061 6e3e 3c73 7061 6e20 use, summarize, Fal │ │ │ │ +00032280: 7365 3c2f 7370 616e 3e0a 2020 2020 2020 se. │ │ │ │ +00032290: 2020 2020 2020 3c73 7061 6e20 636c 6173 ). │ │ │ │ +000322b0: 2020 2020 2020 203c 7370 616e 2063 6c61 c< │ │ │ │ +000322d0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ 000322e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00032300: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ -00032310: 6573 6f6c 7665 5f65 7870 7265 7373 696f esolve_expressio │ │ │ │ -00032320: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n( │ │ │ │ -00032340: 0a20 2020 2020 2020 2020 2020 203c 7370 . que │ │ │ │ -00032360: 7279 3c2f 7370 616e 3e3c 7370 616e 2063 ry, allow_joins, reu │ │ │ │ -000323d0: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se, summarize, for_s │ │ │ │ -00032440: 6176 653c 2f73 7061 6e3e 0a20 2020 2020 ave. │ │ │ │ -00032450: 2020 203c 7370 616e 2063 6c61 7373 3d22 ). │ │ │ │ -00032470: 2020 2020 3c73 7061 6e20 636c 6173 733d return c.. │ │ │ │ -000324b0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -000324c0: 6465 663c 2f73 7061 6e3e 203c 7370 616e def as_s │ │ │ │ -000324e0: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql(self, compiler, co │ │ │ │ -00032580: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ -00032590: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -000325a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c template │ │ │ │ -000325c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 =< │ │ │ │ -000325e0: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ -000325f0: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e None, **ext │ │ │ │ -00032640: 7261 5f63 6f6e 7465 7874 3c2f 7370 616e ra_context):. │ │ │ │ -00032670: 2020 203c 7370 616e 2063 6c61 7373 3d22 connection.ops< │ │ │ │ -000326c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ch │ │ │ │ -000326f0: 6563 6b5f 6578 7072 6573 7369 6f6e 5f73 eck_expression_s │ │ │ │ -00032700: 7570 706f 7274 3c2f 7370 616e 3e3c 7370 upport(self). │ │ │ │ -00032760: 2020 3c73 7061 6e20 636c 6173 733d 226e template_param │ │ │ │ -00032780: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = extra_context< │ │ │ │ -000327c0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -000327d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -000327e0: 716c 5f70 6172 616d 733c 2f73 7061 6e3e ql_params │ │ │ │ -000327f0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = []. cond │ │ │ │ -00032840: 6974 696f 6e5f 7371 6c3c 2f73 7061 6e3e ition_sql │ │ │ │ -00032850: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00032860: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , conditi │ │ │ │ -00032880: 6f6e 5f70 6172 616d 733c 2f73 7061 6e3e on_params │ │ │ │ -00032890: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = compil │ │ │ │ -000328c0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er.compile< │ │ │ │ -00032900: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00032910: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.condi │ │ │ │ -00032960: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion). temp │ │ │ │ -000329a0: 6c61 7465 5f70 6172 616d 733c 2f73 7061 late_params[" │ │ │ │ -000329e0: 3b63 6f6e 6469 7469 6f6e 2671 756f 743b ;condition" │ │ │ │ -000329f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ] │ │ │ │ -00032a10: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00032a20: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = conditi │ │ │ │ -00032a40: 6f6e 5f73 716c 3c2f 7370 616e 3e0a 2020 on_sql. │ │ │ │ -00032a50: 2020 2020 2020 3c73 7061 6e20 636c 6173 result_sql │ │ │ │ -00032a70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00032a90: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00032aa0: 7265 7375 6c74 5f70 6172 616d 733c 2f73 result_params = co │ │ │ │ -00032ae0: 6d70 696c 6572 3c2f 7370 616e 3e3c 7370 mpiler.compile(self │ │ │ │ -00032b50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00032b70: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ -00032b80: 6573 756c 743c 2f73 7061 6e3e 3c73 7061 esult). tem │ │ │ │ -00032bc0: 706c 6174 655f 7061 7261 6d73 3c2f 7370 plate_params[&quo │ │ │ │ -00032c00: 743b 7265 7375 6c74 2671 756f 743b 3c2f t;result"] =< │ │ │ │ -00032c40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> result_sq │ │ │ │ -00032c60: 6c3c 2f73 7061 6e3e 0a20 2020 2020 2020 l. │ │ │ │ -00032c70: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ -00032c90: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = templa │ │ │ │ -00032cc0: 7465 3c2f 7370 616e 3e20 3c73 7061 6e20 te or self.templat │ │ │ │ -00032d30: 653c 2f73 7061 6e3e 0a20 2020 2020 2020 e. │ │ │ │ -00032d40: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -00032d60: 7370 616e 2063 6c61 7373 3d22 6e22 3e74 span class="n">t │ │ │ │ -00032d70: 656d 706c 6174 653c 2f73 7061 6e3e 203c emplate < │ │ │ │ -00032d80: 7370 616e 2063 6c61 7373 3d22 6f22 3e25 span class="o">% │ │ │ │ -00032d90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c template │ │ │ │ -00032db0: 5f70 6172 616d 733c 2f73 7061 6e3e 3c73 _params,< │ │ │ │ -00032dd0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (. │ │ │ │ -00032df0: 2020 2020 2020 2020 2020 2020 3c73 7061 *sql_params,. │ │ │ │ -00032e50: 2020 2020 2020 2020 2020 3c73 7061 6e20 *condition_para │ │ │ │ -00032e90: 6d73 3c2f 7370 616e 3e3c 7370 616e 2063 ms,. *< │ │ │ │ -00032ed0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>result_par │ │ │ │ -00032ef0: 616d 733c 2f73 7061 6e3e 3c73 7061 6e20 ams,. ).. def get_group_b │ │ │ │ -00032f70: 795f 636f 6c73 3c2f 7370 616e 3e3c 7370 y_cols(self):. │ │ │ │ -00032fd0: 2020 203c 7370 616e 2063 6c61 7373 3d22 # This is no │ │ │ │ -00032ff0: 7420 6120 636f 6d70 6c65 7465 2065 7870 t a complete exp │ │ │ │ -00033000: 7265 7373 696f 6e20 616e 6420 6361 6e6e ression and cann │ │ │ │ -00033010: 6f74 2062 6520 7573 6564 2069 6e20 4752 ot be used in GR │ │ │ │ -00033020: 4f55 5020 4259 2e3c 2f73 7061 6e3e 0a20 OUP BY.. │ │ │ │ -00033030: 2020 2020 2020 203c 7370 616e 2063 6c61 cols = []. fo │ │ │ │ -000330a0: 723c 2f73 7061 6e3e 203c 7370 616e 2063 r source< │ │ │ │ -000330c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> in self.< │ │ │ │ -00033110: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>get_source │ │ │ │ -00033130: 5f65 7870 7265 7373 696f 6e73 3c2f 7370 _expressions():. │ │ │ │ -00033160: 2020 2020 2020 2020 2020 3c73 7061 6e20 cols.ext │ │ │ │ -000331b0: 656e 643c 2f73 7061 6e3e 3c73 7061 6e20 end(source< │ │ │ │ -000331f0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00033200: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 get_group │ │ │ │ -00033220: 5f62 795f 636f 6c73 3c2f 7370 616e 3e3c _by_cols< │ │ │ │ -00033230: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00033240: 2929 3c2f 7370 616e 3e0a 2020 2020 2020 )). │ │ │ │ -00033250: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ -00033270: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00033280: 636f 6c73 3c2f 7370 616e 3e3c 2f64 6976 cols
....
.[docs].@d │ │ │ │ -00033350: 6563 6f6e 7374 7275 6374 6962 6c65 3c2f econstructible(pat │ │ │ │ -00033390: 683c 2f73 7061 6e3e 3c73 7061 6e20 636c h= │ │ │ │ -000333b0: 3c73 7061 6e20 636c 6173 733d 2273 3222 "django.db │ │ │ │ -000333d0: 2e6d 6f64 656c 732e 4361 7365 2671 756f .models.Case&quo │ │ │ │ -000333e0: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;).class < │ │ │ │ -00033420: 7370 616e 2063 6c61 7373 3d22 6e63 223e span class="nc"> │ │ │ │ -00033430: 4361 7365 3c2f 7370 616e 3e3c 7370 616e Case(SQLiteNumeric │ │ │ │ -00033470: 4d69 7869 6e3c 2f73 7061 6e3e 3c73 7061 Mixin, Expression< │ │ │ │ -000334b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -000334d0: 3c73 7061 6e20 636c 6173 733d 2277 223e │ │ │ │ -000334e0: 2020 2020 3c2f 7370 616e 3e3c 7370 616e &quo │ │ │ │ -00033500: 743b 2671 756f 743b 2671 756f 743b 3c2f t;"". An SQ │ │ │ │ -00033530: 4c20 7365 6172 6368 6564 2043 4153 4520 L searched CASE │ │ │ │ -00033540: 6578 7072 6573 7369 6f6e 3a3c 2f73 7061 expression:.. CAS │ │ │ │ -00033570: 453c 2f73 7061 6e3e 0a3c 7370 616e 2063 E. │ │ │ │ -00033590: 2020 2020 2020 5748 454e 206e 2026 6774 WHEN n > │ │ │ │ -000335a0: 3b20 303c 2f73 7061 6e3e 0a3c 7370 616e ; 0. │ │ │ │ -000335c0: 2020 2020 2020 2020 2020 2020 5448 454e THEN │ │ │ │ -000335d0: 2026 2333 393b 706f 7369 7469 7665 2623 'positive&# │ │ │ │ -000335e0: 3339 3b3c 2f73 7061 6e3e 0a3c 7370 616e 39;. │ │ │ │ -00033600: 2020 2020 2020 2020 5748 454e 206e 2026 WHEN n & │ │ │ │ -00033610: 6c74 3b20 303c 2f73 7061 6e3e 0a3c 7370 lt; 0. │ │ │ │ -00033630: 2020 2020 2020 2020 2020 2020 2020 5448 TH │ │ │ │ -00033640: 454e 2026 2333 393b 6e65 6761 7469 7665 EN 'negative │ │ │ │ -00033650: 2623 3339 3b3c 2f73 7061 6e3e 0a3c 7370 '. │ │ │ │ -00033670: 2020 2020 2020 2020 2020 454c 5345 2026 ELSE & │ │ │ │ -00033680: 2333 393b 7a65 726f 2623 3339 3b3c 2f73 #39;zero'. EN │ │ │ │ -000336b0: 443c 2f73 7061 6e3e 0a3c 7370 616e 2063 D. &q │ │ │ │ -000336d0: 756f 743b 2671 756f 743b 2671 756f 743b uot;"" │ │ │ │ -000336e0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. tem │ │ │ │ -00033700: 706c 6174 653c 2f73 7061 6e3e 203c 7370 plate = "CAS │ │ │ │ -00033740: 4520 3c2f 7370 616e 3e3c 7370 616e 2063 E %(case │ │ │ │ -00033760: 7329 733c 2f73 7061 6e3e 3c73 7061 6e20 s)s ELSE │ │ │ │ -00033780: 203c 2f73 7061 6e3e 3c73 7061 6e20 636c %(defau │ │ │ │ -000337a0: 6c74 2973 3c2f 7370 616e 3e3c 7370 616e lt)s END │ │ │ │ -000337c0: 2671 756f 743b 3c2f 7370 616e 3e0a 2020 ". │ │ │ │ -000337d0: 2020 3c73 7061 6e20 636c 6173 733d 226e case_joiner = & │ │ │ │ -00033820: 7175 6f74 3b20 2671 756f 743b 3c2f 7370 quot; ".. def __init__(sel │ │ │ │ -000338a0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ -000338c0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 *cases, de │ │ │ │ -00033920: 6661 756c 743c 2f73 7061 6e3e 3c73 7061 fault=None │ │ │ │ -00033960: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00033970: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , output_ │ │ │ │ -00033990: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field=None │ │ │ │ -000339d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000339e0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , **extra): │ │ │ │ -00033a30: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00033a40: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00033a50: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if not all(isinst │ │ │ │ -00033ac0: 616e 6365 3c2f 7370 616e 3e3c 7370 616e ance(case,< │ │ │ │ -00033b10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> When) for case in cas │ │ │ │ -00033bb0: 6573 3c2f 7370 616e 3e3c 7370 616e 2063 es):. < │ │ │ │ -00033be0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ -00033bf0: 6169 7365 3c2f 7370 616e 3e20 3c73 7061 aise Typ │ │ │ │ -00033c10: 6545 7272 6f72 3c2f 7370 616e 3e3c 7370 eError("Posi │ │ │ │ -00033c50: 7469 6f6e 616c 2061 7267 756d 656e 7473 tional arguments │ │ │ │ -00033c60: 206d 7573 7420 616c 6c20 6265 2057 6865 must all be Whe │ │ │ │ -00033c70: 6e20 6f62 6a65 6374 732e 2671 756f 743b n objects." │ │ │ │ -00033c80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00033ca0: 2020 2020 2020 2020 3c73 7061 6e20 636c super().< │ │ │ │ -00033cf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>__init__< │ │ │ │ -00033d10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(ou │ │ │ │ -00033d40: 7470 7574 5f66 6965 6c64 3c2f 7370 616e tput_field). │ │ │ │ -00033d70: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ -00033da0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>cases = lis │ │ │ │ -00033df0: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t( │ │ │ │ -00033e10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00033e20: 6361 7365 733c 2f73 7061 6e3e 3c73 7061 cases). se │ │ │ │ -00033e60: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.default │ │ │ │ -00033ea0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00033eb0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = self._pa │ │ │ │ -00033f00: 7273 655f 6578 7072 6573 7369 6f6e 733c rse_expressions< │ │ │ │ -00033f10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(de │ │ │ │ -00033f40: 6661 756c 743c 2f73 7061 6e3e 3c73 7061 fault)[0]< │ │ │ │ -00033f90: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00033fa0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00033fb0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.extra │ │ │ │ -00033ff0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00034000: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = extra.. def __str__(se │ │ │ │ -00034090: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf):. retur │ │ │ │ -000340d0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n " │ │ │ │ -000340f0: 4341 5345 203c 2f73 7061 6e3e 3c73 7061 CASE %s< │ │ │ │ -00034110: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, ELSE %r< │ │ │ │ -00034150: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -00034160: 2671 756f 743b 3c2f 7370 616e 3e20 3c73 " %< │ │ │ │ -00034180: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (. │ │ │ │ -000341a0: 2020 2020 2020 2020 2020 2020 3c73 7061 &qu │ │ │ │ -000341c0: 6f74 3b2c 2026 7175 6f74 3b3c 2f73 7061 ot;, ".join(st │ │ │ │ -00034230: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r( │ │ │ │ -00034250: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00034260: 633c 2f73 7061 6e3e 3c73 7061 6e20 636c c) │ │ │ │ -00034280: 203c 7370 616e 2063 6c61 7373 3d22 6b22 for c in │ │ │ │ -000342d0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.cases │ │ │ │ -00034320: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00034330: 292c 3c2f 7370 616e 3e0a 2020 2020 2020 ),. │ │ │ │ -00034340: 2020 2020 2020 3c73 7061 6e20 636c 6173 self.defaul │ │ │ │ -00034390: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t, │ │ │ │ -000343b0: 0a20 2020 2020 2020 203c 7370 616e 2063 . ).. def __repr__(self< │ │ │ │ -00034440: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -00034460: 2020 2020 2020 2020 3c73 7061 6e20 636c return "< │ │ │ │ -000344a0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;%s: %s< │ │ │ │ -000344f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>>" │ │ │ │ -00034510: 3b3c 2f73 7061 6e3e 203c 7370 616e 2063 ; % (self< │ │ │ │ -00034560: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ -00034590: 5f63 6c61 7373 5f5f 3c2f 7370 616e 3e3c _class__< │ │ │ │ -000345a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000345b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __name__ │ │ │ │ -000345d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -000345f0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self).. def get_source │ │ │ │ -00034660: 5f65 7870 7265 7373 696f 6e73 3c2f 7370 _expressions(self │ │ │ │ -000346a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -000346c0: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -000346e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.cases │ │ │ │ -00034730: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c + │ │ │ │ -00034750: 203c 7370 616e 2063 6c61 7373 3d22 7022 [self.def │ │ │ │ -000347b0: 6175 6c74 3c2f 7370 616e 3e3c 7370 616e ault].. def set_source_ │ │ │ │ -00034810: 6578 7072 6573 7369 6f6e 733c 2f73 7061 expressions(self< │ │ │ │ -00034850: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00034870: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -00034880: 7870 7273 3c2f 7370 616e 3e3c 7370 616e xprs):. *self.cases, s │ │ │ │ -00034940: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.default │ │ │ │ -00034980: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = exprs< │ │ │ │ -000349b0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ -000349d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> resolve_ │ │ │ │ -000349f0: 6578 7072 6573 7369 6f6e 3c2f 7370 616e expression(. │ │ │ │ -00034a20: 2020 3c73 7061 6e20 636c 6173 733d 2262 self,< │ │ │ │ -00034a50: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> query=None │ │ │ │ -00034aa0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00034ac0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00034ad0: 616c 6c6f 775f 6a6f 696e 733c 2f73 7061 allow_joins=True< │ │ │ │ -00034b10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00034b30: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ -00034b40: 6575 7365 3c2f 7370 616e 3e3c 7370 616e euse=None< │ │ │ │ -00034b80: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00034b90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c summariz │ │ │ │ -00034bb0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e= │ │ │ │ -00034bd0: 3c73 7061 6e20 636c 6173 733d 226b 6322 False, for_save=Fa │ │ │ │ -00034c50: 6c73 653c 2f73 7061 6e3e 0a20 2020 203c lse. < │ │ │ │ -00034c60: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00034c70: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00034c80: 203c 7370 616e 2063 6c61 7373 3d22 6e22 c = self< │ │ │ │ -00034cd0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00034ce0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 copy(). │ │ │ │ -00034d20: 2020 2020 3c73 7061 6e20 636c 6173 733d c.is_summary = < │ │ │ │ -00034d90: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -00034da0: 756d 6d61 7269 7a65 3c2f 7370 616e 3e0a ummarize. │ │ │ │ -00034db0: 2020 2020 2020 2020 3c73 7061 6e20 636c for pos, case in en │ │ │ │ -00034e50: 756d 6572 6174 653c 2f73 7061 6e3e 3c73 umerate(< │ │ │ │ +000322f0: 7373 3d22 6e22 3e72 6573 756c 743c 2f73 ss="n">result = c< │ │ │ │ +00032330: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.re │ │ │ │ +00032360: 7375 6c74 3c2f 7370 616e 3e3c 7370 616e sult.resolve_expre │ │ │ │ +000323a0: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion(. │ │ │ │ +000323d0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 query, allow_join │ │ │ │ +00032420: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s, │ │ │ │ +00032440: 203c 7370 616e 2063 6c61 7373 3d22 6e22 reuse, summarize< │ │ │ │ +00032490: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +000324b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +000324c0: 6f72 5f73 6176 653c 2f73 7061 6e3e 0a20 or_save. │ │ │ │ +000324d0: 2020 2020 2020 203c 7370 616e 2063 6c61 ). │ │ │ │ +000324f0: 2020 2020 2020 2020 3c73 7061 6e20 636c return c.. │ │ │ │ +00032530: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +00032550: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ +00032560: 6173 5f73 716c 3c2f 7370 616e 3e3c 7370 as_sql(self, compil │ │ │ │ +000325d0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er, connection, temp │ │ │ │ +00032640: 6c61 7465 3c2f 7370 616e 3e3c 7370 616e late=None< │ │ │ │ +00032680: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00032690: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c **extra_context):. │ │ │ │ +000326f0: 2020 2020 2020 203c 7370 616e 2063 6c61 connectio │ │ │ │ +00032710: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ +00032730: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00032740: 6f70 733c 2f73 7061 6e3e 3c73 7061 6e20 ops.check_expressi │ │ │ │ +00032780: 6f6e 5f73 7570 706f 7274 3c2f 7370 616e on_support(self). │ │ │ │ +000327e0: 2020 2020 2020 3c73 7061 6e20 636c 6173 template_p │ │ │ │ +00032800: 6172 616d 733c 2f73 7061 6e3e 203c 7370 arams = extra_cont │ │ │ │ +00032840: 6578 743c 2f73 7061 6e3e 0a20 2020 2020 ext. │ │ │ │ +00032850: 2020 203c 7370 616e 2063 6c61 7373 3d22 sql_params = [] │ │ │ │ +000328a0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +000328b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000328c0: 636f 6e64 6974 696f 6e5f 7371 6c3c 2f73 condition_sql, con │ │ │ │ +00032900: 6469 7469 6f6e 5f70 6172 616d 733c 2f73 dition_params = co │ │ │ │ +00032940: 6d70 696c 6572 3c2f 7370 616e 3e3c 7370 mpiler.compile(self │ │ │ │ +000329b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000329d0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +000329e0: 6f6e 6469 7469 6f6e 3c2f 7370 616e 3e3c ondition< │ │ │ │ +000329f0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00032a00: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00032a10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00032a20: 7465 6d70 6c61 7465 5f70 6172 616d 733c template_params< │ │ │ │ +00032a30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>[& │ │ │ │ +00032a60: 7175 6f74 3b63 6f6e 6469 7469 6f6e 2671 quot;condition&q │ │ │ │ +00032a70: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;] = con │ │ │ │ +00032ac0: 6469 7469 6f6e 5f73 716c 3c2f 7370 616e dition_sql. result │ │ │ │ +00032af0: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e _sql, result_param │ │ │ │ +00032b30: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = compiler.compile │ │ │ │ +00032ba0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00032bc0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00032bd0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.result │ │ │ │ +00032c10: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00032c20: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +00032c30: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template_params │ │ │ │ +00032c50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 [< │ │ │ │ +00032c70: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00032c80: 2671 756f 743b 7265 7375 6c74 2671 756f "result&quo │ │ │ │ +00032c90: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;] = resul │ │ │ │ +00032ce0: 745f 7371 6c3c 2f73 7061 6e3e 0a20 2020 t_sql. │ │ │ │ +00032cf0: 2020 2020 203c 7370 616e 2063 6c61 7373 template = te │ │ │ │ +00032d40: 6d70 6c61 7465 3c2f 7370 616e 3e20 3c73 mplate o │ │ │ │ +00032d60: 723c 2f73 7061 6e3e 203c 7370 616e 2063 r self.tem │ │ │ │ +00032db0: 706c 6174 653c 2f73 7061 6e3e 0a20 2020 plate. │ │ │ │ +00032dc0: 2020 2020 203c 7370 616e 2063 6c61 7373 return template % temp │ │ │ │ +00032e30: 6c61 7465 5f70 6172 616d 733c 2f73 7061 late_params, (. │ │ │ │ +00032e80: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00032e90: 2a3c 2f73 7061 6e3e 3c73 7061 6e20 636c *sql_para │ │ │ │ +00032eb0: 6d73 3c2f 7370 616e 3e3c 7370 616e 2063 ms,. *< │ │ │ │ +00032ef0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>condition_ │ │ │ │ +00032f10: 7061 7261 6d73 3c2f 7370 616e 3e3c 7370 params,. │ │ │ │ +00032f40: 2020 3c73 7061 6e20 636c 6173 733d 226f *result │ │ │ │ +00032f70: 5f70 6172 616d 733c 2f73 7061 6e3e 3c73 _params,< │ │ │ │ +00032f90: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00032fa0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00032fb0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +00032fd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c get_gro │ │ │ │ +00032ff0: 7570 5f62 795f 636f 6c73 3c2f 7370 616e up_by_cols(self):. │ │ │ │ +00033050: 2020 2020 2020 203c 7370 616e 2063 6c61 # This i │ │ │ │ +00033070: 7320 6e6f 7420 6120 636f 6d70 6c65 7465 s not a complete │ │ │ │ +00033080: 2065 7870 7265 7373 696f 6e20 616e 6420 expression and │ │ │ │ +00033090: 6361 6e6e 6f74 2062 6520 7573 6564 2069 cannot be used i │ │ │ │ +000330a0: 6e20 4752 4f55 5020 4259 2e3c 2f73 7061 n GROUP BY.. cols< │ │ │ │ +000330d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +000330f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00033100: 5b5d 3c2f 7370 616e 3e0a 2020 2020 2020 []. │ │ │ │ +00033110: 2020 3c73 7061 6e20 636c 6173 733d 226b for sou │ │ │ │ +00033140: 7263 653c 2f73 7061 6e3e 203c 7370 616e rce in self.get_so │ │ │ │ +000331b0: 7572 6365 5f65 7870 7265 7373 696f 6e73 urce_expressions │ │ │ │ +000331c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ():. co │ │ │ │ +00033200: 6c73 3c2f 7370 616e 3e3c 7370 616e 2063 ls.extend(< │ │ │ │ +00033250: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>source.get_g │ │ │ │ +000332a0: 726f 7570 5f62 795f 636f 6c73 3c2f 7370 roup_by_cols()). │ │ │ │ +000332d0: 2020 2020 2020 3c73 7061 6e20 636c 6173 return cols< │ │ │ │ +00033310: 2f64 6976 3e0a 0a0a 0a3c 6469 7620 636c /div>....
. │ │ │ │ +00033340: 3c61 2063 6c61 7373 3d22 7669 6577 636f [documenti │ │ │ │ +000333c0: 5d3c 2f61 3e0a 3c73 7061 6e20 636c 6173 ].@deconstr │ │ │ │ +000333e0: 7563 7469 626c 653c 2f73 7061 6e3e 3c73 uctible(< │ │ │ │ +00033400: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>path=" │ │ │ │ +00033450: 646a 616e 676f 2e64 622e 6d6f 6465 6c73 django.db.models │ │ │ │ +00033460: 2e43 6173 6526 7175 6f74 3b3c 2f73 7061 .Case").class │ │ │ │ +000334a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c Case(SQLi │ │ │ │ +000334f0: 7465 4e75 6d65 7269 634d 6978 696e 3c2f teNumericMixin, Ex │ │ │ │ +00033530: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ +00033540: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00033550: 3a3c 2f73 7061 6e3e 0a3c 7370 616e 2063 :. "" │ │ │ │ +00033590: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 0a3c ;".< │ │ │ │ +000335a0: 7370 616e 2063 6c61 7373 3d22 7364 223e span class="sd"> │ │ │ │ +000335b0: 2020 2020 416e 2053 514c 2073 6561 7263 An SQL searc │ │ │ │ +000335c0: 6865 6420 4341 5345 2065 7870 7265 7373 hed CASE express │ │ │ │ +000335d0: 696f 6e3a 3c2f 7370 616e 3e0a 0a3c 7370 ion:.. │ │ │ │ +000335f0: 2020 2020 2020 4341 5345 3c2f 7370 616e CASE. W │ │ │ │ +00033620: 4845 4e20 6e20 2667 743b 2030 3c2f 7370 HEN n > 0. │ │ │ │ +00033650: 2020 2020 2054 4845 4e20 2623 3339 3b70 THEN 'p │ │ │ │ +00033660: 6f73 6974 6976 6526 2333 393b 3c2f 7370 ositive'. │ │ │ │ +00033690: 2057 4845 4e20 6e20 266c 743b 2030 3c2f WHEN n < 0. │ │ │ │ +000336c0: 2020 2020 2020 2054 4845 4e20 2623 3339 THEN ' │ │ │ │ +000336d0: 3b6e 6567 6174 6976 6526 2333 393b 3c2f ;negative'. │ │ │ │ +00033700: 2020 2045 4c53 4520 2623 3339 3b7a 6572 ELSE 'zer │ │ │ │ +00033710: 6f26 2333 393b 3c2f 7370 616e 3e0a 3c73 o'. │ │ │ │ +00033730: 2020 2020 2020 2045 4e44 3c2f 7370 616e END. "&qu │ │ │ │ +00033760: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e ot;" │ │ │ │ +00033770: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. template = < │ │ │ │ +000337b0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +000337c0: 2671 756f 743b 4341 5345 203c 2f73 7061 "CASE %(cases)s ELSE %(default)s END"< │ │ │ │ +00033850: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. case_ │ │ │ │ +00033870: 6a6f 696e 6572 3c2f 7370 616e 3e20 3c73 joiner =< │ │ │ │ +00033890: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> " & │ │ │ │ +000338b0: 7175 6f74 3b3c 2f73 7061 6e3e 0a0a 2020 quot;.. │ │ │ │ +000338c0: 2020 3c73 7061 6e20 636c 6173 733d 226b def __ │ │ │ │ +000338f0: 696e 6974 5f5f 3c2f 7370 616e 3e3c 7370 init__(self, *cases,< │ │ │ │ +00033990: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> default=No │ │ │ │ +000339e0: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne, output_field=No │ │ │ │ +00033a50: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne, **extra │ │ │ │ +00033aa0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +00033ac0: 0a20 2020 2020 2020 203c 7370 616e 2063 . if not < │ │ │ │ +00033b00: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +00033b10: 616c 6c3c 2f73 7061 6e3e 3c73 7061 6e20 all(isinstance(case │ │ │ │ +00033b80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00033ba0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00033bb0: 5768 656e 3c2f 7370 616e 3e3c 7370 616e When) for < │ │ │ │ +00033bf0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00033c00: 6173 653c 2f73 7061 6e3e 203c 7370 616e ase in cases):. │ │ │ │ +00033c60: 2020 2020 2020 2020 3c73 7061 6e20 636c raise TypeError< │ │ │ │ +00033ca0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(& │ │ │ │ +00033cd0: 7175 6f74 3b50 6f73 6974 696f 6e61 6c20 quot;Positional │ │ │ │ +00033ce0: 6172 6775 6d65 6e74 7320 6d75 7374 2061 arguments must a │ │ │ │ +00033cf0: 6c6c 2062 6520 5768 656e 206f 626a 6563 ll be When objec │ │ │ │ +00033d00: 7473 2e26 7175 6f74 3b3c 2f73 7061 6e3e ts." │ │ │ │ +00033d10: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00033d20: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +00033d30: 203c 7370 616e 2063 6c61 7373 3d22 6e62 super() │ │ │ │ +00033d60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00033d80: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ +00033d90: 5f5f 696e 6974 5f5f 3c2f 7370 616e 3e3c __init__< │ │ │ │ +00033da0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00033db0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 output_fi │ │ │ │ +00033dd0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld). self │ │ │ │ +00033e10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00033e30: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00033e40: 6173 6573 3c2f 7370 616e 3e20 3c73 7061 ases = list(cases). │ │ │ │ +00033ed0: 2020 2020 2020 3c73 7061 6e20 636c 6173 self.defaul │ │ │ │ +00033f20: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t = self.< │ │ │ │ +00033f70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>_parse_exp │ │ │ │ +00033f90: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c ressions< │ │ │ │ +00033fa0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00033fb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 default)[0 │ │ │ │ +00034000: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ]. │ │ │ │ +00034020: 2020 2020 2020 2020 3c73 7061 6e20 636c self.extr │ │ │ │ +00034070: 613c 2f73 7061 6e3e 203c 7370 616e 2063 a = extra.. │ │ │ │ +000340b0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +000340d0: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ +000340e0: 5f5f 7374 725f 5f3c 2f73 7061 6e3e 3c73 __str__(< │ │ │ │ +00034100: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self):. │ │ │ │ +00034140: 2020 2020 3c73 7061 6e20 636c 6173 733d return "CASE %s< │ │ │ │ +000341a0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +000341b0: 2c20 454c 5345 203c 2f73 7061 6e3e 3c73 , ELSE % │ │ │ │ +000341d0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r"< │ │ │ │ +000341f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> % │ │ │ │ +00034210: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00034220: 283c 2f73 7061 6e3e 0a20 2020 2020 2020 (. │ │ │ │ +00034230: 2020 2020 203c 7370 616e 2063 6c61 7373 ", &q │ │ │ │ +00034250: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;.join(< │ │ │ │ +000342a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>str(c) for c i │ │ │ │ +00034350: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n self.cas │ │ │ │ +000343a0: 6573 3c2f 7370 616e 3e3c 7370 616e 2063 es),. < │ │ │ │ +000343d0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +000343e0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.default,. │ │ │ │ +00034440: 2020 3c73 7061 6e20 636c 6173 733d 2270 ).. │ │ │ │ +00034460: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00034470: 6465 663c 2f73 7061 6e3e 203c 7370 616e def __re │ │ │ │ +00034490: 7072 5f5f 3c2f 7370 616e 3e3c 7370 616e pr__(self< │ │ │ │ +000344d0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +000344e0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +000344f0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +00034510: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00034520: 2671 756f 743b 266c 743b 3c2f 7370 616e "<%s: %s< │ │ │ │ +00034580: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00034590: 2667 743b 2671 756f 743b 3c2f 7370 616e >" % (self< │ │ │ │ +000345f0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00034600: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __class_ │ │ │ │ +00034620: 5f3c 2f73 7061 6e3e 3c73 7061 6e20 636c _. │ │ │ │ +00034640: 3c73 7061 6e20 636c 6173 733d 2276 6d22 __name__ │ │ │ │ +00034660: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00034670: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , self).. │ │ │ │ +000346b0: 2020 203c 7370 616e 2063 6c61 7373 3d22 def g │ │ │ │ +000346e0: 6574 5f73 6f75 7263 655f 6578 7072 6573 et_source_expres │ │ │ │ +000346f0: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061 sions(self │ │ │ │ +00034730: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00034740: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +00034750: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ +00034770: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.cases │ │ │ │ +000347c0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 + [self.< │ │ │ │ +00034820: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>default].. │ │ │ │ +00034860: 2020 3c73 7061 6e20 636c 6173 733d 226b def se │ │ │ │ +00034890: 745f 736f 7572 6365 5f65 7870 7265 7373 t_source_express │ │ │ │ +000348a0: 696f 6e73 3c2f 7370 616e 3e3c 7370 616e ions(self< │ │ │ │ +000348e0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +000348f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c exprs):. │ │ │ │ +00034930: 2020 2020 2020 3c73 7061 6e20 636c 6173 *s │ │ │ │ +00034960: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.cases,< │ │ │ │ +000349b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.defau │ │ │ │ +00034a00: 6c74 3c2f 7370 616e 3e20 3c73 7061 6e20 lt = exprs. │ │ │ │ +00034a40: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ +00034a60: 3c73 7061 6e20 636c 6173 733d 226e 6622 resolve_express │ │ │ │ +00034a80: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion(. self │ │ │ │ +00034ac0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00034ae0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00034af0: 7175 6572 793c 2f73 7061 6e3e 3c73 7061 query=None │ │ │ │ +00034b30: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00034b40: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , allow_j │ │ │ │ +00034b60: 6f69 6e73 3c2f 7370 616e 3e3c 7370 616e oins=True< │ │ │ │ +00034ba0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00034bb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c reuse=Non │ │ │ │ +00034c00: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ +00034c20: 203c 7370 616e 2063 6c61 7373 3d22 6e22 summarize=False< │ │ │ │ +00034c70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00034c90: 7370 616e 2063 6c61 7373 3d22 6e22 3e66 span class="n">f │ │ │ │ +00034ca0: 6f72 5f73 6176 653c 2f73 7061 6e3e 3c73 or_save=< │ │ │ │ +00034cc0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>False. ):. c = sel │ │ │ │ +00034d50: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +00034d70: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00034d80: 636f 7079 3c2f 7370 616e 3e3c 7370 616e copy(). c.is_ │ │ │ │ +00034df0: 7375 6d6d 6172 793c 2f73 7061 6e3e 203c summary < │ │ │ │ +00034e00: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00034e10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c summariz │ │ │ │ +00034e30: 653c 2f73 7061 6e3e 0a20 2020 2020 2020 e. │ │ │ │ +00034e40: 203c 7370 616e 2063 6c61 7373 3d22 6b22 for pos< │ │ │ │ 00034e70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>c.< │ │ │ │ -00034ea0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>cases):. │ │ │ │ -00034ee0: 2020 2020 2020 2020 3c73 7061 6e20 636c c │ │ │ │ -00034f00: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00034f10: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .cases[pos< │ │ │ │ -00034f60: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>] < │ │ │ │ -00034f80: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00034f90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c case.resol │ │ │ │ -00034fe0: 7665 5f65 7870 7265 7373 696f 6e3c 2f73 ve_expression(. │ │ │ │ -00035010: 2020 2020 2020 2020 2020 2020 203c 7370 que │ │ │ │ -00035030: 7279 3c2f 7370 616e 3e3c 7370 616e 2063 ry, allow_joins, reu │ │ │ │ -000350a0: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se, summarize, for_s │ │ │ │ -00035110: 6176 653c 2f73 7061 6e3e 0a20 2020 2020 ave. │ │ │ │ -00035120: 2020 2020 2020 203c 7370 616e 2063 6c61 ). │ │ │ │ -00035140: 2020 2020 2020 2020 3c73 7061 6e20 636c c │ │ │ │ -00035160: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00035170: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .default< │ │ │ │ -00035190: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -000351b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000351c0: 633c 2f73 7061 6e3e 3c73 7061 6e20 636c c. │ │ │ │ -000351e0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000351f0: 6465 6661 756c 743c 2f73 7061 6e3e 3c73 default.< │ │ │ │ -00035210: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>resolve_ex │ │ │ │ -00035230: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ -00035240: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00035250: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00035260: 2020 2020 3c73 7061 6e20 636c 6173 733d query │ │ │ │ -00035280: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00035290: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , allow_j │ │ │ │ -000352b0: 6f69 6e73 3c2f 7370 616e 3e3c 7370 616e oins, reuse │ │ │ │ -000352f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00035300: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , summari │ │ │ │ -00035320: 7a65 3c2f 7370 616e 3e3c 7370 616e 2063 ze, for_save. ). retur │ │ │ │ -000353a0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n c.. def copy(< │ │ │ │ -00035410: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self):. │ │ │ │ -00035450: 2020 2020 3c73 7061 6e20 636c 6173 733d c = super().copy< │ │ │ │ -000354f0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00035500: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -00035510: 203c 7370 616e 2063 6c61 7373 3d22 6e22 c.cases =< │ │ │ │ -00035570: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> c< │ │ │ │ -00035590: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000355a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 cases[:]. │ │ │ │ -000355e0: 2020 2020 2020 3c73 7061 6e20 636c 6173 return c.. │ │ │ │ -00035620: 2020 3c73 7061 6e20 636c 6173 733d 226b def as │ │ │ │ -00035650: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e _sql(. sel │ │ │ │ -00035690: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ -000356b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 compiler │ │ │ │ -000356d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000356e0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , connect │ │ │ │ -00035700: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion, template=None< │ │ │ │ -00035770: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00035790: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -000357a0: 6173 655f 6a6f 696e 6572 3c2f 7370 616e ase_joiner=None, ** │ │ │ │ -00035810: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 extra_con │ │ │ │ -00035830: 7465 7874 3c2f 7370 616e 3e0a 2020 2020 text. │ │ │ │ -00035840: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00035850: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -00035860: 2020 3c73 7061 6e20 636c 6173 733d 226e connection.ops.che │ │ │ │ -000358e0: 636b 5f65 7870 7265 7373 696f 6e5f 7375 ck_expression_su │ │ │ │ -000358f0: 7070 6f72 743c 2f73 7061 6e3e 3c73 7061 pport(self │ │ │ │ -00035930: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00035940: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -00035950: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if not< │ │ │ │ -00035980: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.cases │ │ │ │ -000359d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ -000359f0: 2020 2020 2020 2020 2020 2020 3c73 7061 retu │ │ │ │ -00035a10: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn compil │ │ │ │ -00035a30: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er.compile< │ │ │ │ -00035a70: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00035a80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.defau │ │ │ │ -00035ad0: 6c74 3c2f 7370 616e 3e3c 7370 616e 2063 lt). templa │ │ │ │ -00035b10: 7465 5f70 6172 616d 733c 2f73 7061 6e3e te_params │ │ │ │ -00035b20: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = {**self │ │ │ │ -00035b80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00035ba0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -00035bb0: 7874 7261 3c2f 7370 616e 3e3c 7370 616e xtra, **ext │ │ │ │ -00035c00: 7261 5f63 6f6e 7465 7874 3c2f 7370 616e ra_context}. │ │ │ │ -00035c30: 2020 3c73 7061 6e20 636c 6173 733d 226e case_parts = []< │ │ │ │ -00035c80: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00035c90: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -00035ca0: 716c 5f70 6172 616d 733c 2f73 7061 6e3e ql_params │ │ │ │ -00035cb0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = []. defa │ │ │ │ -00035d00: 756c 745f 7371 6c3c 2f73 7061 6e3e 3c73 ult_sql,< │ │ │ │ -00035d20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> default_p │ │ │ │ -00035d40: 6172 616d 733c 2f73 7061 6e3e 203c 7370 arams = compiler.com │ │ │ │ -00035db0: 7069 6c65 3c2f 7370 616e 3e3c 7370 616e pile(self< │ │ │ │ -00035df0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00035e00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 default). │ │ │ │ -00035e40: 2020 2020 2020 3c73 7061 6e20 636c 6173 for │ │ │ │ -00035e60: 203c 7370 616e 2063 6c61 7373 3d22 6e22 case in │ │ │ │ -00035e90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.case │ │ │ │ -00035ee0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s: │ │ │ │ -00035f00: 0a20 2020 2020 2020 2020 2020 203c 7370 . try │ │ │ │ -00035f20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ -00035f40: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -00035f50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00035f60: 6361 7365 5f73 716c 3c2f 7370 616e 3e3c case_sql< │ │ │ │ -00035f70: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00035f80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c case_par │ │ │ │ -00035fa0: 616d 733c 2f73 7061 6e3e 203c 7370 616e ams = compiler.compi │ │ │ │ -00036010: 6c65 3c2f 7370 616e 3e3c 7370 616e 2063 le(case). │ │ │ │ -00036070: 203c 7370 616e 2063 6c61 7373 3d22 6b22 except < │ │ │ │ -00036090: 7370 616e 2063 6c61 7373 3d22 6e22 3e45 span class="n">E │ │ │ │ -000360a0: 6d70 7479 5265 7375 6c74 5365 743c 2f73 mptyResultSet:. │ │ │ │ -000360d0: 2020 2020 2020 2020 2020 2020 203c 7370 con │ │ │ │ -000360f0: 7469 6e75 653c 2f73 7061 6e3e 0a20 2020 tinue. │ │ │ │ -00036100: 2020 2020 2020 2020 203c 7370 616e 2063 except< │ │ │ │ -00036120: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> FullResul │ │ │ │ -00036140: 7453 6574 3c2f 7370 616e 3e3c 7370 616e tSet:. │ │ │ │ -00036170: 2020 2020 3c73 7061 6e20 636c 6173 733d default_sql< │ │ │ │ -00036190: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -000361b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ -000361c0: 6566 6175 6c74 5f70 6172 616d 733c 2f73 efault_params = co │ │ │ │ -00036200: 6d70 696c 6572 3c2f 7370 616e 3e3c 7370 mpiler.compile(case< │ │ │ │ -00036270: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.re │ │ │ │ -000362a0: 7375 6c74 3c2f 7370 616e 3e3c 7370 616e sult). │ │ │ │ -000362d0: 2020 2020 3c73 7061 6e20 636c 6173 733d break │ │ │ │ -000362f0: 0a20 2020 2020 2020 2020 2020 203c 7370 . cas │ │ │ │ -00036310: 655f 7061 7274 733c 2f73 7061 6e3e 3c73 e_parts.< │ │ │ │ -00036330: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>append(case_ │ │ │ │ -00036380: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql). < │ │ │ │ -000363b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -000363c0: 716c 5f70 6172 616d 733c 2f73 7061 6e3e ql_params │ │ │ │ -000363d0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000363e0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .extend(cas │ │ │ │ -00036430: 655f 7061 7261 6d73 3c2f 7370 616e 3e3c e_params< │ │ │ │ -00036440: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00036450: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00036460: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00036470: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if not case_parts │ │ │ │ -000364b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ -000364d0: 2020 2020 2020 2020 2020 2020 3c73 7061 retu │ │ │ │ -000364f0: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn defaul │ │ │ │ -00036510: 745f 7371 6c3c 2f73 7061 6e3e 3c73 7061 t_sql, default_par │ │ │ │ -00036550: 616d 733c 2f73 7061 6e3e 0a20 2020 2020 ams. │ │ │ │ -00036560: 2020 203c 7370 616e 2063 6c61 7373 3d22 case_joiner = < │ │ │ │ -000365a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -000365b0: 6173 655f 6a6f 696e 6572 3c2f 7370 616e ase_joiner or se │ │ │ │ -000365f0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.case_joiner. temp │ │ │ │ -00036650: 6c61 7465 5f70 6172 616d 733c 2f73 7061 late_params[" │ │ │ │ -00036690: 3b63 6173 6573 2671 756f 743b 3c2f 7370 ;cases"] = case_joiner │ │ │ │ -000366f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00036710: 7370 616e 2063 6c61 7373 3d22 6e22 3e6a span class="n">j │ │ │ │ -00036720: 6f69 6e3c 2f73 7061 6e3e 3c73 7061 6e20 oin(case_parts). │ │ │ │ -00036780: 2020 2020 3c73 7061 6e20 636c 6173 733d template_par │ │ │ │ -000367a0: 616d 733c 2f73 7061 6e3e 3c73 7061 6e20 ams["default │ │ │ │ -000367e0: 2671 756f 743b 3c2f 7370 616e 3e3c 7370 "] = < │ │ │ │ -00036820: 7370 616e 2063 6c61 7373 3d22 6e22 3e64 span class="n">d │ │ │ │ -00036830: 6566 6175 6c74 5f73 716c 3c2f 7370 616e efault_sql. sql_pa │ │ │ │ -00036860: 7261 6d73 3c2f 7370 616e 3e3c 7370 616e rams.extend │ │ │ │ -000368a0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000368b0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (default_ │ │ │ │ -000368d0: 7061 7261 6d73 3c2f 7370 616e 3e3c 7370 params). te │ │ │ │ -00036910: 6d70 6c61 7465 3c2f 7370 616e 3e20 3c73 mplate =< │ │ │ │ -00036930: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> template< │ │ │ │ -00036950: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> or template_param │ │ │ │ -00036990: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ -000369b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000369c0: 6765 743c 2f73 7061 6e3e 3c73 7061 6e20 get("templat │ │ │ │ -00036a00: 6526 7175 6f74 3b3c 2f73 7061 6e3e 3c73 e",< │ │ │ │ -00036a20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.templ │ │ │ │ -00036a70: 6174 653c 2f73 7061 6e3e 3c73 7061 6e20 ate). sql = < │ │ │ │ -00036ad0: 7370 616e 2063 6c61 7373 3d22 6e22 3e74 span class="n">t │ │ │ │ -00036ae0: 656d 706c 6174 653c 2f73 7061 6e3e 203c emplate < │ │ │ │ -00036af0: 7370 616e 2063 6c61 7373 3d22 6f22 3e25 span class="o">% │ │ │ │ -00036b00: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c template │ │ │ │ -00036b20: 5f70 6172 616d 733c 2f73 7061 6e3e 0a20 _params. │ │ │ │ -00036b30: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ -00036b50: 203c 7370 616e 2063 6c61 7373 3d22 6270 self._output_fie │ │ │ │ -00036ba0: 6c64 5f6f 725f 6e6f 6e65 3c2f 7370 616e ld_or_none is no │ │ │ │ -00036be0: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t None:. │ │ │ │ -00036c20: 2020 2020 2020 2020 2020 3c73 7061 6e20 sql = co │ │ │ │ -00036c70: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ -00036c80: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00036c90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ops.unifica │ │ │ │ -00036ce0: 7469 6f6e 5f63 6173 745f 7371 6c3c 2f73 tion_cast_sql(sel │ │ │ │ -00036d20: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00036d40: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00036d50: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field) % sql. │ │ │ │ -00036db0: 2020 2020 2020 2020 3c73 7061 6e20 636c return sql │ │ │ │ -00036df0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00036e00: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , sql_par │ │ │ │ -00036e20: 616d 733c 2f73 7061 6e3e 0a0a 2020 2020 ams.. │ │ │ │ -00036e30: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00036e40: 6465 663c 2f73 7061 6e3e 203c 7370 616e def get_ │ │ │ │ -00036e60: 6772 6f75 705f 6279 5f63 6f6c 733c 2f73 group_by_cols(sel │ │ │ │ -00036ea0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f):. if not │ │ │ │ -00036f00: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.cases │ │ │ │ -00036f50: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00036f60: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00036f70: 2020 2020 203c 7370 616e 2063 6c61 7373 return self< │ │ │ │ -00036fb0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00036fc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 default.get │ │ │ │ -00037010: 5f67 726f 7570 5f62 795f 636f 6c73 3c2f _group_by_cols(). │ │ │ │ -00037040: 2020 2020 2020 203c 7370 616e 2063 6c61 return super().get_group_by_ │ │ │ │ -000370d0: 636f 6c73 3c2f 7370 616e 3e3c 7370 616e cols()
.....[docs].class < │ │ │ │ -000371c0: 7370 616e 2063 6c61 7373 3d22 6e63 223e span class="nc"> │ │ │ │ -000371d0: 5375 6271 7565 7279 3c2f 7370 616e 3e3c Subquery
< │ │ │ │ -000371e0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -000371f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61
BaseExpre │ │ │ │ -00037210: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion,
Combinable< │ │ │ │ -00037250: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -00037270: 3c73 7061 6e20 636c 6173 733d 2277 223e │ │ │ │ -00037280: 2020 2020 3c2f 7370 616e 3e3c 7370 616e &quo │ │ │ │ -000372a0: 743b 2671 756f 743b 2671 756f 743b 3c2f t;"". An ex │ │ │ │ -000372d0: 706c 6963 6974 2073 7562 7175 6572 792e plicit subquery. │ │ │ │ -000372e0: 2049 7420 6d61 7920 636f 6e74 6169 6e20 It may contain │ │ │ │ -000372f0: 4f75 7465 7252 6566 2829 2072 6566 6572 OuterRef() refer │ │ │ │ -00037300: 656e 6365 7320 746f 2074 6865 206f 7574 ences to the out │ │ │ │ -00037310: 6572 3c2f 7370 616e 3e0a 3c73 7061 6e20 er. q │ │ │ │ -00037330: 7565 7279 2077 6869 6368 2077 696c 6c20 uery which will │ │ │ │ -00037340: 6265 2072 6573 6f6c 7665 6420 7768 656e be resolved when │ │ │ │ -00037350: 2069 7420 6973 2061 7070 6c69 6564 2074 it is applied t │ │ │ │ -00037360: 6f20 7468 6174 2071 7565 7279 2e3c 2f73 o that query.
. " │ │ │ │ -00037390: 2671 756f 743b 2671 756f 743b 3c2f 7370 "".. templat │ │ │ │ -000373c0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = "(%(subquery)s)"
. contain │ │ │ │ -00037460: 735f 6167 6772 6567 6174 653c 2f73 7061 s_aggregate = Fal │ │ │ │ -000374a0: 7365 3c2f 7370 616e 3e0a 2020 2020 3c73 se. em │ │ │ │ -000374c0: 7074 795f 7265 7375 6c74 5f73 6574 5f76 pty_result_set_v │ │ │ │ -000374d0: 616c 7565 3c2f 7370 616e 3e20 3c73 7061 alue = None. subquery = < │ │ │ │ -00037550: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ -00037560: 5472 7565 3c2f 7370 616e 3e0a 0a20 2020 True.. │ │ │ │ -00037570: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def __i │ │ │ │ -000375a0: 6e69 745f 5f3c 2f73 7061 6e3e 3c73 7061 nit__(
self │ │ │ │ -000375e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000375f0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , queryse │ │ │ │ -00037610: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t, │ │ │ │ -00037630: 203c 7370 616e 2063 6c61 7373 3d22 6e22 output_field
=Non │ │ │ │ -00037680: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ -000376a0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 **extra< │ │ │ │ -000376d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -000376f0: 2020 2020 2020 2020 3c73 7061 6e20 636c # Allow │ │ │ │ -00037710: 2074 6865 2075 7361 6765 206f 6620 626f the usage of bo │ │ │ │ -00037720: 7468 2051 7565 7279 5365 7420 616e 6420 th QuerySet and │ │ │ │ -00037730: 7371 6c2e 5175 6572 7920 6f62 6a65 6374 sql.Query object │ │ │ │ -00037740: 732e 3c2f 7370 616e 3e0a 2020 2020 2020 s.. │ │ │ │ -00037750: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ -00037780: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>query = get │ │ │ │ -000377d0: 6174 7472 3c2f 7370 616e 3e3c 7370 616e attr(queryset, &quo │ │ │ │ -00037840: 743b 7175 6572 7926 7175 6f74 3b3c 2f73 t;query", que │ │ │ │ -00037880: 7279 7365 743c 2f73 7061 6e3e 3c73 7061 ryset)
.clon │ │ │ │ -000378d0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e(). self< │ │ │ │ -00037910: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.qu │ │ │ │ -00037940: 6572 793c 2f73 7061 6e3e 3c73 7061 6e20 ery.subquery = True │ │ │ │ -000379b0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000379c0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.extra │ │ │ │ -00037a10: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = extra< │ │ │ │ -00037a40: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00037a50: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -00037a60: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().__ │ │ │ │ -00037ab0: 696e 6974 5f5f 3c2f 7370 616e 3e3c 7370 init__(output_fiel │ │ │ │ -00037af0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d) │ │ │ │ -00037b10: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -00037b30: 203c 7370 616e 2063 6c61 7373 3d22 6e66 get_source_exp │ │ │ │ -00037b50: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c ressions< │ │ │ │ -00037b60: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00037b70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self):. │ │ │ │ -00037bb0: 2020 2020 203c 7370 616e 2063 6c61 7373 return [self │ │ │ │ -00037c00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00037c20: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ -00037c30: 7565 7279 3c2f 7370 616e 3e3c 7370 616e uery].. def set_source_ │ │ │ │ -00037c90: 6578 7072 6573 7369 6f6e 733c 2f73 7061 expressions(self< │ │ │ │ -00037cd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00037cf0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -00037d00: 7870 7273 3c2f 7370 616e 3e3c 7370 616e xprs):
. se │ │ │ │ -00037d40: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.query =< │ │ │ │ -00037d90: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> exprs[0].. │ │ │ │ -00037e00: 2020 3c73 7061 6e20 636c 6173 733d 226b def _r │ │ │ │ -00037e30: 6573 6f6c 7665 5f6f 7574 7075 745f 6669 esolve_output_fi │ │ │ │ -00037e40: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld(self): │ │ │ │ -00037e90: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00037ea0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00037eb0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return s │ │ │ │ -00037ed0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.query.< │ │ │ │ -00037f20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>output_fie │ │ │ │ -00037f40: 6c64 3c2f 7370 616e 3e0a 0a20 2020 203c ld.. < │ │ │ │ -00037f50: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -00037f60: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef copy< │ │ │ │ -00037f80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -00037fb0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. clon │ │ │ │ -00037ff0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = super< │ │ │ │ -00038030: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00038040: 293c 2f73 7061 6e3e 3c73 7061 6e20 636c ). │ │ │ │ -00038060: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00038070: 636f 7079 3c2f 7370 616e 3e3c 7370 616e copy(). clo │ │ │ │ -000380b0: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne.query =< │ │ │ │ -00038100: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> clone.query │ │ │ │ -00038150: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00038170: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00038180: 6c6f 6e65 3c2f 7370 616e 3e3c 7370 616e lone(). ret │ │ │ │ -000381c0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn clone │ │ │ │ -000381e0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. @p │ │ │ │ -00038200: 726f 7065 7274 793c 2f73 7061 6e3e 0a20 roperty. │ │ │ │ -00038210: 2020 203c 7370 616e 2063 6c61 7373 3d22 def e │ │ │ │ -00038240: 7874 6572 6e61 6c5f 616c 6961 7365 733c xternal_aliases< │ │ │ │ -00038250: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -00038280: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. retu │ │ │ │ -000382c0: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn self< │ │ │ │ -000382e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.qu │ │ │ │ -00038310: 6572 793c 2f73 7061 6e3e 3c73 7061 6e20 ery.external_alias │ │ │ │ -00038350: 6573 3c2f 7370 616e 3e0a 0a20 2020 203c es.. < │ │ │ │ -00038360: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -00038370: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef get_e │ │ │ │ -00038390: 7874 6572 6e61 6c5f 636f 6c73 3c2f 7370 xternal_cols(self │ │ │ │ -000383d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -000383f0: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -00038410: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.query │ │ │ │ -00038460: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00038480: 7370 616e 2063 6c61 7373 3d22 6e22 3e67 span class="n">g │ │ │ │ -00038490: 6574 5f65 7874 6572 6e61 6c5f 636f 6c73 et_external_cols │ │ │ │ -000384a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 () │ │ │ │ -000384c0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -000384e0: 203c 7370 616e 2063 6c61 7373 3d22 6e66 as_sql< │ │ │ │ -00038500: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00038510: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, comp │ │ │ │ -00038560: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler, connection, < │ │ │ │ +00034e90: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00034ea0: 6173 653c 2f73 7061 6e3e 203c 7370 616e ase in enumerate │ │ │ │ +00034ee0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00034f00: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00034f10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00034f30: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00034f40: 6173 6573 3c2f 7370 616e 3e3c 7370 616e ases):. │ │ │ │ +00034f70: 203c 7370 616e 2063 6c61 7373 3d22 6e22 c.cases[pos< │ │ │ │ +00034ff0: 7370 616e 2063 6c61 7373 3d22 7022 3e5d span class="p">] │ │ │ │ +00035000: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +00035020: 203c 7370 616e 2063 6c61 7373 3d22 6e22 case.resolve_expr │ │ │ │ +00035070: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession(. │ │ │ │ +000350a0: 2020 2020 2020 3c73 7061 6e20 636c 6173 query, allow │ │ │ │ +000350f0: 5f6a 6f69 6e73 3c2f 7370 616e 3e3c 7370 _joins, reuse, summa │ │ │ │ +00035160: 7269 7a65 3c2f 7370 616e 3e3c 7370 616e rize, for_save. │ │ │ │ +000351b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000351c0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +000351d0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 c.default │ │ │ │ +00035220: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00035230: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = c.default │ │ │ │ +00035280: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000352a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e72 span class="n">r │ │ │ │ +000352b0: 6573 6f6c 7665 5f65 7870 7265 7373 696f esolve_expressio │ │ │ │ +000352c0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n( │ │ │ │ +000352e0: 0a20 2020 2020 2020 2020 2020 203c 7370 . que │ │ │ │ +00035300: 7279 3c2f 7370 616e 3e3c 7370 616e 2063 ry, allow_joins, reu │ │ │ │ +00035370: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se, summarize, for_s │ │ │ │ +000353e0: 6176 653c 2f73 7061 6e3e 0a20 2020 2020 ave. │ │ │ │ +000353f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 ). │ │ │ │ +00035410: 2020 2020 3c73 7061 6e20 636c 6173 733d return c.. │ │ │ │ +00035450: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00035460: 6465 663c 2f73 7061 6e3e 203c 7370 616e def copy │ │ │ │ +00035480: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +000354a0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +000354b0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. c = < │ │ │ │ +00035510: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +00035520: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().cop │ │ │ │ +00035570: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y(). c.cases< │ │ │ │ +000355e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00035600: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00035610: 633c 2f73 7061 6e3e 3c73 7061 6e20 636c c. │ │ │ │ +00035630: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00035640: 6361 7365 733c 2f73 7061 6e3e 3c73 7061 cases[:]< │ │ │ │ +00035660: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00035670: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +00035680: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn c.. def as_sql(. │ │ │ │ +00035700: 2020 2020 203c 7370 616e 2063 6c61 7373 self, compil │ │ │ │ +00035750: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er, connection, temp │ │ │ │ +000357c0: 6c61 7465 3c2f 7370 616e 3e3c 7370 616e late=None< │ │ │ │ +00035800: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00035810: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c case_joi │ │ │ │ +00035830: 6e65 723c 2f73 7061 6e3e 3c73 7061 6e20 ner=None,< │ │ │ │ +00035880: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ** │ │ │ │ +000358a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000358b0: 6578 7472 615f 636f 6e74 6578 743c 2f73 extra_context. ):. conne │ │ │ │ +00035900: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction.ops.< │ │ │ │ +00035950: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>check_expr │ │ │ │ +00035970: 6573 7369 6f6e 5f73 7570 706f 7274 3c2f ession_support(se │ │ │ │ +000359b0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf). if not │ │ │ │ +00035a10: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.cases │ │ │ │ +00035a60: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00035a70: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +00035a80: 2020 2020 203c 7370 616e 2063 6c61 7373 return compiler.compil │ │ │ │ +00035af0: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ +00035b10: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.
default). │ │ │ │ +00035b80: 2020 203c 7370 616e 2063 6c61 7373 3d22 template_para │ │ │ │ +00035ba0: 6d73 3c2f 7370 616e 3e20 3c73 7061 6e20 ms = {**
self │ │ │ │ +00035c10: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00035c20: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .extra
, **< │ │ │ │ +00035c70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>extra_cont │ │ │ │ +00035c90: 6578 743c 2f73 7061 6e3e 3c73 7061 6e20 ext}. case_ │ │ │ │ +00035cd0: 7061 7274 733c 2f73 7061 6e3e 203c 7370 parts = []. │ │ │ │ +00035d10: 2020 2020 2020 2020 3c73 7061 6e20 636c sql_para │ │ │ │ +00035d30: 6d73 3c2f 7370 616e 3e20 3c73 7061 6e20 ms = []. │ │ │ │ +00035d70: 2020 2020 203c 7370 616e 2063 6c61 7373 default_sql │ │ │ │ +00035d90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00035db0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00035dc0: 6465 6661 756c 745f 7061 7261 6d73 3c2f default_params = < │ │ │ │ +00035df0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00035e00: 6f6d 7069 6c65 723c 2f73 7061 6e3e 3c73 ompiler.< │ │ │ │ +00035e20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>compile(sel │ │ │ │ +00035e70: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +00035e90: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00035ea0: 6465 6661 756c 743c 2f73 7061 6e3e 3c73 default)< │ │ │ │ +00035ec0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00035ed0: 7370 616e 2063 6c61 7373 3d22 6b22 3e66 span class="k">f │ │ │ │ +00035ee0: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or case in │ │ │ │ +00035f20: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.cases:. │ │ │ │ +00035f90: 2020 2020 2020 3c73 7061 6e20 636c 6173 try │ │ │ │ +00035fb0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00035fc0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +00035fd0: 2020 2020 2020 2020 203c 7370 616e 2063 case_sq │ │ │ │ +00035ff0: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l, │ │ │ │ +00036010: 203c 7370 616e 2063 6c61 7373 3d22 6e22 case_params = com │ │ │ │ +00036060: 7069 6c65 723c 2f73 7061 6e3e 3c73 7061 piler.compile(case). │ │ │ │ +000360f0: 2020 2020 2020 2020 2020 3c73 7061 6e20 except │ │ │ │ +00036110: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c EmptyRes │ │ │ │ +00036130: 756c 7453 6574 3c2f 7370 616e 3e3c 7370 ultSet:. │ │ │ │ +00036160: 2020 2020 2020 3c73 7061 6e20 636c 6173 continue. │ │ │ │ +00036190: 2020 3c73 7061 6e20 636c 6173 733d 226b except │ │ │ │ +000361b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000361c0: 4675 6c6c 5265 7375 6c74 5365 743c 2f73 FullResultSet
:. │ │ │ │ +000361f0: 2020 2020 2020 2020 2020 2020 203c 7370 def │ │ │ │ +00036210: 6175 6c74 5f73 716c 3c2f 7370 616e 3e3c ault_sql< │ │ │ │ +00036220: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00036230: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c default_ │ │ │ │ +00036250: 7061 7261 6d73 3c2f 7370 616e 3e20 3c73 params =< │ │ │ │ +00036270: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> compiler< │ │ │ │ +00036290: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ +000362c0: 6d70 696c 653c 2f73 7061 6e3e 3c73 7061 mpile(case< │ │ │ │ +00036300: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00036310: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 result). │ │ │ │ +00036350: 2020 2020 2020 2020 2020 2020 203c 7370 bre │ │ │ │ +00036370: 616b 3c2f 7370 616e 3e0a 2020 2020 2020 ak. │ │ │ │ +00036380: 2020 2020 2020 3c73 7061 6e20 636c 6173 case_parts │ │ │ │ +000363a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000363c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ +000363d0: 7070 656e 643c 2f73 7061 6e3e 3c73 7061 ppend(
case_sql). │ │ │ │ +00036430: 2020 2020 2020 2020 3c73 7061 6e20 636c sql_para │ │ │ │ +00036450: 6d73 3c2f 7370 616e 3e3c 7370 616e 2063 ms.extend(< │ │ │ │ +000364a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>case_param │ │ │ │ +000364c0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s) │ │ │ │ +000364e0: 0a20 2020 2020 2020 203c 7370 616e 2063 . if not < │ │ │ │ +00036520: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00036530: 6173 655f 7061 7274 733c 2f73 7061 6e3e ase_parts │ │ │ │ +00036540: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00036550: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +00036560: 2020 2020 203c 7370 616e 2063 6c61 7373 return default_sql, de │ │ │ │ +000365d0: 6661 756c 745f 7061 7261 6d73 3c2f 7370 fault_params. case │ │ │ │ +00036600: 5f6a 6f69 6e65 723c 2f73 7061 6e3e 203c _joiner < │ │ │ │ +00036610: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00036620: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c case_joi │ │ │ │ +00036640: 6e65 723c 2f73 7061 6e3e 203c 7370 616e ner or self.case_j │ │ │ │ +000366b0: 6f69 6e65 723c 2f73 7061 6e3e 0a20 2020 oiner. │ │ │ │ +000366c0: 2020 2020 203c 7370 616e 2063 6c61 7373 template_pa │ │ │ │ +000366e0: 7261 6d73 3c2f 7370 616e 3e3c 7370 616e rams["cases& │ │ │ │ +00036720: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;] = ca │ │ │ │ +00036770: 7365 5f6a 6f69 6e65 723c 2f73 7061 6e3e se_joiner │ │ │ │ +00036780: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00036790: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .join(case_ │ │ │ │ +000367e0: 7061 7274 733c 2f73 7061 6e3e 3c73 7061 parts). tem │ │ │ │ +00036820: 706c 6174 655f 7061 7261 6d73 3c2f 7370 plate_params[&quo │ │ │ │ +00036860: 743b 6465 6661 756c 7426 7175 6f74 3b3c t;default"< │ │ │ │ +00036870: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>] < │ │ │ │ +00036890: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +000368a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c default_ │ │ │ │ +000368c0: 7371 6c3c 2f73 7061 6e3e 0a20 2020 2020 sql. │ │ │ │ +000368d0: 2020 203c 7370 616e 2063 6c61 7373 3d22 sql_params.exte │ │ │ │ +00036920: 6e64 3c2f 7370 616e 3e3c 7370 616e 2063 nd(default_params< │ │ │ │ +00036960: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ +00036980: 2020 2020 2020 203c 7370 616e 2063 6c61 template< │ │ │ │ +000369a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +000369c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000369d0: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ +000369e0: 3c73 7061 6e20 636c 6173 733d 226f 7722 or templ │ │ │ │ +00036a10: 6174 655f 7061 7261 6d73 3c2f 7370 616e ate_params.get(&quo │ │ │ │ +00036a80: 743b 7465 6d70 6c61 7465 2671 756f 743b t;template" │ │ │ │ +00036a90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00036ab0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.
template). │ │ │ │ +00036b20: 2020 2020 3c73 7061 6e20 636c 6173 733d sql < │ │ │ │ +00036b40: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00036b50: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c template │ │ │ │ +00036b70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c % │ │ │ │ +00036b90: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template_params │ │ │ │ +00036bb0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00036bc0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00036bd0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if self< │ │ │ │ +00036bf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._o │ │ │ │ +00036c20: 7574 7075 745f 6669 656c 645f 6f72 5f6e utput_field_or_n │ │ │ │ +00036c30: 6f6e 653c 2f73 7061 6e3e 203c 7370 616e one is not None:< │ │ │ │ +00036ca0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00036cb0: 2020 203c 7370 616e 2063 6c61 7373 3d22 sql =< │ │ │ │ +00036ce0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> connectio │ │ │ │ +00036d00: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ +00036d20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00036d30: 6f70 733c 2f73 7061 6e3e 3c73 7061 6e20 ops.unification_ca │ │ │ │ +00036d70: 7374 5f73 716c 3c2f 7370 616e 3e3c 7370 st_sql(self.output_ │ │ │ │ +00036de0: 6669 656c 643c 2f73 7061 6e3e 3c73 7061 field) % sq │ │ │ │ +00036e30: 6c3c 2f73 7061 6e3e 0a20 2020 2020 2020 l. │ │ │ │ +00036e40: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +00036e60: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ +00036e70: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql, sql_params.. def get_group_b │ │ │ │ +00036ef0: 795f 636f 6c73 3c2f 7370 616e 3e3c 7370 y_cols(self):. │ │ │ │ +00036f50: 2020 203c 7370 616e 2063 6c61 7373 3d22 if no │ │ │ │ +00036f80: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t self.cas │ │ │ │ +00036fd0: 6573 3c2f 7370 616e 3e3c 7370 616e 2063 es:. re │ │ │ │ +00037010: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn sel │ │ │ │ +00037030: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +00037050: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00037060: 6465 6661 756c 743c 2f73 7061 6e3e 3c73 default.< │ │ │ │ +00037080: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>get_group_ │ │ │ │ +000370a0: 6279 5f63 6f6c 733c 2f73 7061 6e3e 3c73 by_cols() │ │ │ │ +000370c0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +000370d0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +000370e0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return s │ │ │ │ +00037100: 7570 6572 3c2f 7370 616e 3e3c 7370 616e uper().get_ │ │ │ │ +00037150: 6772 6f75 705f 6279 5f63 6f6c 733c 2f73 group_by_cols()....
. │ │ │ │ +00037220: 5b64 6f63 756d 656e 7469 5d3c 2f61 3e0a [documenti]. │ │ │ │ +00037230: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00037240: 636c 6173 733c 2f73 7061 6e3e 203c 7370 class Su │ │ │ │ +00037260: 6271 7565 7279 3c2f 7370 616e 3e3c 7370 bquery(BaseExpress │ │ │ │ +000372a0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion, Combinable):. │ │ │ │ +00037310: 2020 3c2f 7370 616e 3e3c 7370 616e 2063 " │ │ │ │ +00037330: 2671 756f 743b 2671 756f 743b 3c2f 7370 "". An expl │ │ │ │ +00037360: 6963 6974 2073 7562 7175 6572 792e 2049 icit subquery. I │ │ │ │ +00037370: 7420 6d61 7920 636f 6e74 6169 6e20 4f75 t may contain Ou │ │ │ │ +00037380: 7465 7252 6566 2829 2072 6566 6572 656e terRef() referen │ │ │ │ +00037390: 6365 7320 746f 2074 6865 206f 7574 6572 ces to the outer │ │ │ │ +000373a0: 3c2f 7370 616e 3e0a 3c73 7061 6e20 636c . que │ │ │ │ +000373c0: 7279 2077 6869 6368 2077 696c 6c20 6265 ry which will be │ │ │ │ +000373d0: 2072 6573 6f6c 7665 6420 7768 656e 2069 resolved when i │ │ │ │ +000373e0: 7420 6973 2061 7070 6c69 6564 2074 6f20 t is applied to │ │ │ │ +000373f0: 7468 6174 2071 7565 7279 2e3c 2f73 7061 that query.. "&q │ │ │ │ +00037420: 756f 743b 2671 756f 743b 3c2f 7370 616e uot;".. template< │ │ │ │ +00037450: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00037470: 3c73 7061 6e20 636c 6173 733d 2273 3222 "(< │ │ │ │ +00037490: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ +000374a0: 2528 7375 6271 7565 7279 2973 3c2f 7370 %(subquery)s)". contains_ │ │ │ │ +000374f0: 6167 6772 6567 6174 653c 2f73 7061 6e3e aggregate │ │ │ │ +00037500: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = False │ │ │ │ +00037530: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . empt │ │ │ │ +00037550: 795f 7265 7375 6c74 5f73 6574 5f76 616c y_result_set_val │ │ │ │ +00037560: 7565 3c2f 7370 616e 3e20 3c73 7061 6e20 ue = None. │ │ │ │ +000375a0: 2020 2020 3c73 7061 6e20 636c 6173 733d subquery = Tr │ │ │ │ +000375f0: 7565 3c2f 7370 616e 3e0a 0a20 2020 203c ue.. < │ │ │ │ +00037600: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +00037610: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef __ini │ │ │ │ +00037630: 745f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 t__(self,< │ │ │ │ +00037680: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> queryset< │ │ │ │ +000376a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +000376c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +000376d0: 7574 7075 745f 6669 656c 643c 2f73 7061 utput_field=None< │ │ │ │ +00037710: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00037730: 7370 616e 2063 6c61 7373 3d22 6f22 3e2a span class="o">* │ │ │ │ +00037740: 2a3c 2f73 7061 6e3e 3c73 7061 6e20 636c *extra):. │ │ │ │ +00037780: 2020 2020 2020 3c73 7061 6e20 636c 6173 # Allow t │ │ │ │ +000377a0: 6865 2075 7361 6765 206f 6620 626f 7468 he usage of both │ │ │ │ +000377b0: 2051 7565 7279 5365 7420 616e 6420 7371 QuerySet and sq │ │ │ │ +000377c0: 6c2e 5175 6572 7920 6f62 6a65 6374 732e l.Query objects. │ │ │ │ +000377d0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +000377e0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.query │ │ │ │ +00037830: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = getat │ │ │ │ +00037860: 7472 3c2f 7370 616e 3e3c 7370 616e 2063 tr(queryset │ │ │ │ +000378a0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000378b0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , " │ │ │ │ +000378d0: 7175 6572 7926 7175 6f74 3b3c 2f73 7061 query", query │ │ │ │ +00037910: 7365 743c 2f73 7061 6e3e 3c73 7061 6e20 set).clone< │ │ │ │ +00037960: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(). │ │ │ │ +00037980: 2020 2020 2020 2020 3c73 7061 6e20 636c self.quer │ │ │ │ +000379d0: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y. │ │ │ │ +000379f0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00037a00: 7375 6271 7565 7279 3c2f 7370 616e 3e20 subquery │ │ │ │ +00037a10: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00037a20: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = True. s │ │ │ │ +00037a60: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.extra < │ │ │ │ +00037aa0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00037ab0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c extra. su │ │ │ │ +00037af0: 7065 723c 2f73 7061 6e3e 3c73 7061 6e20 per().__in │ │ │ │ +00037b40: 6974 5f5f 3c2f 7370 616e 3e3c 7370 616e it__(output_field< │ │ │ │ +00037b80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).. │ │ │ │ +00037ba0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +00037bc0: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ +00037bd0: 6765 745f 736f 7572 6365 5f65 7870 7265 get_source_expre │ │ │ │ +00037be0: 7373 696f 6e73 3c2f 7370 616e 3e3c 7370 ssions(self):. │ │ │ │ +00037c40: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ +00037c60: 203c 7370 616e 2063 6c61 7373 3d22 7022 [self.que │ │ │ │ +00037cc0: 7279 3c2f 7370 616e 3e3c 7370 616e 2063 ry].. def set_source_ex │ │ │ │ +00037d20: 7072 6573 7369 6f6e 733c 2f73 7061 6e3e pressions │ │ │ │ +00037d30: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00037d40: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self, exp │ │ │ │ +00037d90: 7273 3c2f 7370 616e 3e3c 7370 616e 2063 rs):. self │ │ │ │ +00037dd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00037df0: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ +00037e00: 7565 7279 3c2f 7370 616e 3e20 3c73 7061 uery = exprs[0].. │ │ │ │ +00037e90: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00037ea0: 6465 663c 2f73 7061 6e3e 203c 7370 616e def _res │ │ │ │ +00037ec0: 6f6c 7665 5f6f 7574 7075 745f 6669 656c olve_output_fiel │ │ │ │ +00037ed0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d( │ │ │ │ +00037ef0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self):. re │ │ │ │ +00037f40: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn sel │ │ │ │ +00037f60: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +00037f80: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00037f90: 7175 6572 793c 2f73 7061 6e3e 3c73 7061 query.output_field │ │ │ │ +00037fd0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +00037ff0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c copy(sel │ │ │ │ +00038040: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f):. clone< │ │ │ │ +00038080: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +000380a0: 3c73 7061 6e20 636c 6173 733d 226e 6222 super()< │ │ │ │ +000380d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ +00038100: 7079 3c2f 7370 616e 3e3c 7370 616e 2063 py(). clone │ │ │ │ +00038140: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00038160: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ +00038170: 7565 7279 3c2f 7370 616e 3e20 3c73 7061 uery = clone.query.clo │ │ │ │ +00038210: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne(). retur │ │ │ │ +00038250: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n clone.. @pro │ │ │ │ +00038290: 7065 7274 793c 2f73 7061 6e3e 0a20 2020 perty. │ │ │ │ +000382a0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def ext │ │ │ │ +000382d0: 6572 6e61 6c5f 616c 6961 7365 733c 2f73 ernal_aliases(sel │ │ │ │ +00038310: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f):. return │ │ │ │ +00038350: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.quer │ │ │ │ +000383a0: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y. │ │ │ │ +000383c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000383d0: 6578 7465 726e 616c 5f61 6c69 6173 6573 external_aliases │ │ │ │ +000383e0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +00038400: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c get_ext │ │ │ │ +00038420: 6572 6e61 6c5f 636f 6c73 3c2f 7370 616e ernal_cols(self):. │ │ │ │ +00038480: 2020 2020 2020 203c 7370 616e 2063 6c61 return self.query.get │ │ │ │ +00038520: 5f65 7874 6572 6e61 6c5f 636f 6c73 3c2f _external_cols().. │ │ │ │ +00038550: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +00038570: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ +00038580: 6173 5f73 716c 3c2f 7370 616e 3e3c 7370 as_sql(, te │ │ │ │ -000385d0: 6d70 6c61 7465 3c2f 7370 616e 3e3c 7370 mplate=None, **extra_context │ │ │ │ -00038660: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -00038680: 0a20 2020 2020 2020 203c 7370 616e 2063 . connect │ │ │ │ -000386a0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion.ops.check_expres │ │ │ │ -00038710: 7369 6f6e 5f73 7570 706f 7274 3c2f 7370 sion_support(self │ │ │ │ -00038750: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00038770: 2020 2020 2020 2020 3c73 7061 6e20 636c template │ │ │ │ -00038790: 5f70 6172 616d 733c 2f73 7061 6e3e 203c _params < │ │ │ │ -000387a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -000387b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c { │ │ │ │ -000387d0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000387e0: 2a2a 3c2f 7370 616e 3e3c 7370 616e 2063 **self.ext │ │ │ │ -00038830: 7261 3c2f 7370 616e 3e3c 7370 616e 2063 ra, **extra │ │ │ │ -00038880: 5f63 6f6e 7465 7874 3c2f 7370 616e 3e3c _context< │ │ │ │ -00038890: 7370 616e 2063 6c61 7373 3d22 7022 3e7d span class="p">} │ │ │ │ -000388a0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -000388b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000388c0: 7375 6271 7565 7279 5f73 716c 3c2f 7370 subquery_sql, sql_ │ │ │ │ -00038900: 7061 7261 6d73 3c2f 7370 616e 3e20 3c73 params =< │ │ │ │ -00038920: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.query │ │ │ │ -00038970: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00038990: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -000389a0: 735f 7371 6c3c 2f73 7061 6e3e 3c73 7061 s_sql(compiler, conn │ │ │ │ -00038a10: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection). te │ │ │ │ -00038a50: 6d70 6c61 7465 5f70 6172 616d 733c 2f73 mplate_params[&qu │ │ │ │ -00038a90: 6f74 3b73 7562 7175 6572 7926 7175 6f74 ot;subquery" │ │ │ │ -00038aa0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;] │ │ │ │ -00038ac0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = subque │ │ │ │ -00038af0: 7279 5f73 716c 3c2f 7370 616e 3e3c 7370 ry_sql[1:< │ │ │ │ -00038b40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>-1 │ │ │ │ -00038b70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ]. │ │ │ │ -00038b90: 0a20 2020 2020 2020 203c 7370 616e 2063 . templat │ │ │ │ -00038bb0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = template or tem │ │ │ │ -00038c20: 706c 6174 655f 7061 7261 6d73 3c2f 7370 plate_params.get(&q │ │ │ │ -00038c90: 756f 743b 7465 6d70 6c61 7465 2671 756f uot;template&quo │ │ │ │ -00038ca0: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;, self.< │ │ │ │ -00038cf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>template). │ │ │ │ -00038d30: 2020 2020 2020 3c73 7061 6e20 636c 6173 sql │ │ │ │ -00038d50: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = templa │ │ │ │ -00038d80: 7465 3c2f 7370 616e 3e20 3c73 7061 6e20 te % template_para │ │ │ │ -00038dc0: 6d73 3c2f 7370 616e 3e0a 2020 2020 2020 ms. │ │ │ │ -00038dd0: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ -00038df0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00038e00: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql, sql_params.. def get_group_ │ │ │ │ -00038e80: 6279 5f63 6f6c 733c 2f73 7061 6e3e 3c73 by_cols(< │ │ │ │ -00038ea0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self):. │ │ │ │ -00038ee0: 2020 2020 3c73 7061 6e20 636c 6173 733d return self.< │ │ │ │ -00038f30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>query.get_gr │ │ │ │ -00038f80: 6f75 705f 6279 5f63 6f6c 733c 2f73 7061 oup_by_cols(wrappe │ │ │ │ -00038fc0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r= │ │ │ │ -00038fe0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self)
.....[docs].cl │ │ │ │ -000390d0: 6173 733c 2f73 7061 6e3e 203c 7370 616e ass Exis │ │ │ │ -000390f0: 7473 3c2f 7370 616e 3e3c 7370 616e 2063 ts(Subquery │ │ │ │ -00039130: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00039140: 293a 3c2f 7370 616e 3e0a 2020 2020 3c73 ):. te │ │ │ │ -00039160: 6d70 6c61 7465 3c2f 7370 616e 3e20 3c73 mplate =< │ │ │ │ -00039180: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "EX │ │ │ │ -000391a0: 4953 5453 283c 2f73 7061 6e3e 3c73 7061 ISTS(%(s │ │ │ │ -000391c0: 7562 7175 6572 7929 733c 2f73 7061 6e3e ubquery)s │ │ │ │ -000391d0: 3c73 7061 6e20 636c 6173 733d 2273 3222 )". │ │ │ │ -000391f0: 2020 2020 3c73 7061 6e20 636c 6173 733d output_field │ │ │ │ -00039210: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -00039230: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ -00039260: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>BooleanFie │ │ │ │ -00039280: 6c64 3c2f 7370 616e 3e3c 7370 616e 2063 ld(). empty_res │ │ │ │ -000392c0: 756c 745f 7365 745f 7661 6c75 653c 2f73 ult_set_value = F │ │ │ │ -00039300: 616c 7365 3c2f 7370 616e 3e0a 0a20 2020 alse.. │ │ │ │ -00039310: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def __i │ │ │ │ -00039340: 6e69 745f 5f3c 2f73 7061 6e3e 3c73 7061 nit__(self │ │ │ │ -00039380: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00039390: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , queryse │ │ │ │ -000393b0: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t, │ │ │ │ -000393d0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 **kwargs │ │ │ │ -00039400: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -00039420: 0a20 2020 2020 2020 203c 7370 616e 2063 . super< │ │ │ │ -00039440: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>()< │ │ │ │ -00039460: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00039470: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __init__ │ │ │ │ -00039490: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -000394b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ -000394c0: 7565 7279 7365 743c 2f73 7061 6e3e 3c73 ueryset,< │ │ │ │ -000394e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ** │ │ │ │ -00039500: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00039510: 6b77 6172 6773 3c2f 7370 616e 3e3c 7370 kwargs). s │ │ │ │ -00039550: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.query < │ │ │ │ -00039590: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -000395a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.quer │ │ │ │ -000395f0: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y. │ │ │ │ -00039610: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00039620: 6578 6973 7473 3c2f 7370 616e 3e3c 7370 exists()< │ │ │ │ -00039640: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ -00039660: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> select_f │ │ │ │ -00039680: 6f72 6d61 743c 2f73 7061 6e3e 3c73 7061 ormat(self │ │ │ │ +000385b0: 3d22 6270 223e 7365 6c66 3c2f 7370 616e ="bp">self, compil │ │ │ │ +000385f0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er, connection, temp │ │ │ │ +00038660: 6c61 7465 3c2f 7370 616e 3e3c 7370 616e late=None< │ │ │ │ +000386a0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +000386b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c **extra_context):. │ │ │ │ +00038710: 2020 2020 2020 203c 7370 616e 2063 6c61 connectio │ │ │ │ +00038730: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ +00038750: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00038760: 6f70 733c 2f73 7061 6e3e 3c73 7061 6e20 ops.check_expressi │ │ │ │ +000387a0: 6f6e 5f73 7570 706f 7274 3c2f 7370 616e on_support(self). │ │ │ │ +00038800: 2020 2020 2020 3c73 7061 6e20 636c 6173 template_p │ │ │ │ +00038820: 6172 616d 733c 2f73 7061 6e3e 203c 7370 arams = {** │ │ │ │ +00038870: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.extra │ │ │ │ +000388c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +000388e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000388f0: 2a2a 3c2f 7370 616e 3e3c 7370 616e 2063 **extra_c │ │ │ │ +00038910: 6f6e 7465 7874 3c2f 7370 616e 3e3c 7370 ontext}. su │ │ │ │ +00038950: 6271 7565 7279 5f73 716c 3c2f 7370 616e bquery_sql, sql_pa │ │ │ │ +00038990: 7261 6d73 3c2f 7370 616e 3e20 3c73 7061 rams = self.query.as_ │ │ │ │ +00038a30: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql(compiler, connec │ │ │ │ +00038aa0: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion). temp │ │ │ │ +00038ae0: 6c61 7465 5f70 6172 616d 733c 2f73 7061 late_params[" │ │ │ │ +00038b20: 3b73 7562 7175 6572 7926 7175 6f74 3b3c ;subquery"< │ │ │ │ +00038b30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>] < │ │ │ │ +00038b50: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00038b60: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c subquery │ │ │ │ +00038b80: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e _sql[1:-1].. │ │ │ │ +00038c20: 2020 2020 2020 203c 7370 616e 2063 6c61 template< │ │ │ │ +00038c40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00038c60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00038c70: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ +00038c80: 3c73 7061 6e20 636c 6173 733d 226f 7722 or templ │ │ │ │ +00038cb0: 6174 655f 7061 7261 6d73 3c2f 7370 616e ate_params.get(&quo │ │ │ │ +00038d20: 743b 7465 6d70 6c61 7465 2671 756f 743b t;template" │ │ │ │ +00038d30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00038d50: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.template). │ │ │ │ +00038dc0: 2020 2020 3c73 7061 6e20 636c 6173 733d sql < │ │ │ │ +00038de0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00038df0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c template │ │ │ │ +00038e10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c % │ │ │ │ +00038e30: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template_params │ │ │ │ +00038e50: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00038e60: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +00038e70: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return sq │ │ │ │ +00038e90: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l, │ │ │ │ +00038eb0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 sql_params.. def get_group_by │ │ │ │ +00038f10: 5f63 6f6c 733c 2f73 7061 6e3e 3c73 7061 _cols(self │ │ │ │ +00038f50: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00038f60: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +00038f70: 2020 3c73 7061 6e20 636c 6173 733d 226b return │ │ │ │ +00038f90: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.query │ │ │ │ +00038fe0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00038ff0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .get_grou │ │ │ │ +00039010: 705f 6279 5f63 6f6c 733c 2f73 7061 6e3e p_by_cols │ │ │ │ +00039020: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00039030: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (wrapper< │ │ │ │ +00039050: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=s │ │ │ │ +00039080: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf)
....
.[documenti] │ │ │ │ +00039150: 0a3c 7370 616e 2063 6c61 7373 3d22 6b22 .class E │ │ │ │ +00039180: 7869 7374 733c 2f73 7061 6e3e 3c73 7061 xists(Subquery):. │ │ │ │ +000391e0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ +00039200: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = " │ │ │ │ +00039230: 3b45 5849 5354 5328 3c2f 7370 616e 3e3c ;EXISTS(< │ │ │ │ +00039240: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ +00039250: 2528 7375 6271 7565 7279 2973 3c2f 7370 %(subquery)s)". output_fi │ │ │ │ +000392a0: 656c 643c 2f73 7061 6e3e 203c 7370 616e eld = fields.Boolean │ │ │ │ +00039310: 4669 656c 643c 2f73 7061 6e3e 3c73 7061 Field(). empty_ │ │ │ │ +00039350: 7265 7375 6c74 5f73 6574 5f76 616c 7565 result_set_value │ │ │ │ +00039360: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +00039380: 203c 7370 616e 2063 6c61 7373 3d22 6b63 False.. │ │ │ │ +000393a0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +000393c0: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ +000393d0: 5f5f 696e 6974 5f5f 3c2f 7370 616e 3e3c __init__< │ │ │ │ +000393e0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +000393f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, quer │ │ │ │ +00039440: 7973 6574 3c2f 7370 616e 3e3c 7370 616e yset, **kwa │ │ │ │ +00039490: 7267 733c 2f73 7061 6e3e 3c73 7061 6e20 rgs):. sup │ │ │ │ +000394d0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er().__ini │ │ │ │ +00039520: 745f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 t__(queryset, **kwargs │ │ │ │ +000395b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000395c0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +000395d0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.query = self │ │ │ │ +00039650: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00039670: 7370 616e 2063 6c61 7373 3d22 6e22 3e71 span class="n">q │ │ │ │ +00039680: 7565 7279 3c2f 7370 616e 3e3c 7370 616e uery.exists │ │ │ │ 000396c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000396d0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , compile │ │ │ │ -000396f0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r, │ │ │ │ -00039710: 203c 7370 616e 2063 6c61 7373 3d22 6e22 sql, params):. │ │ │ │ -00039780: 2020 203c 7370 616e 2063 6c61 7373 3d22 # Wrap EXIST │ │ │ │ -000397a0: 5328 2920 7769 7468 2061 2043 4153 4520 S() with a CASE │ │ │ │ -000397b0: 5748 454e 2065 7870 7265 7373 696f 6e20 WHEN expression │ │ │ │ -000397c0: 6966 2061 2064 6174 6162 6173 6520 6261 if a database ba │ │ │ │ -000397d0: 636b 656e 643c 2f73 7061 6e3e 0a20 2020 ckend. │ │ │ │ -000397e0: 2020 2020 203c 7370 616e 2063 6c61 7373 # (e.g. Or │ │ │ │ -00039800: 6163 6c65 2920 646f 6573 6e26 2333 393b acle) doesn' │ │ │ │ -00039810: 7420 7375 7070 6f72 7420 626f 6f6c 6561 t support boolea │ │ │ │ -00039820: 6e20 6578 7072 6573 7369 6f6e 2069 6e20 n expression in │ │ │ │ -00039830: 5345 4c45 4354 206f 7220 4752 4f55 503c SELECT or GROUP< │ │ │ │ -00039840: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00039850: 7370 616e 2063 6c61 7373 3d22 6331 223e span class="c1"> │ │ │ │ -00039860: 2320 4259 206c 6973 742e 3c2f 7370 616e # BY list.. if not │ │ │ │ -000398b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000398c0: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ -000398d0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000398e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 connectio │ │ │ │ -00039900: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ -00039920: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00039930: 6665 6174 7572 6573 3c2f 7370 616e 3e3c features< │ │ │ │ -00039940: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00039950: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 supports_ │ │ │ │ -00039970: 626f 6f6c 6561 6e5f 6578 7072 5f69 6e5f boolean_expr_in_ │ │ │ │ -00039980: 7365 6c65 6374 5f63 6c61 7573 653c 2f73 select_clause:. │ │ │ │ -000399b0: 2020 2020 2020 2020 203c 7370 616e 2063 sql = &q │ │ │ │ -00039a00: 756f 743b 4341 5345 2057 4845 4e20 3c2f uot;CASE WHEN {}< │ │ │ │ -00039a30: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -00039a40: 2054 4845 4e20 3120 454c 5345 2030 2045 THEN 1 ELSE 0 E │ │ │ │ -00039a50: 4e44 2671 756f 743b 3c2f 7370 616e 3e3c ND"< │ │ │ │ -00039a60: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00039a70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 format(sql< │ │ │ │ -00039ac0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ -00039ae0: 2020 2020 2020 203c 7370 616e 2063 6c61 return sql< │ │ │ │ -00039b20: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00039b30: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c params
....< │ │ │ │ -00039b60: 7370 616e 2063 6c61 7373 3d22 6e64 223e span class="nd"> │ │ │ │ -00039b70: 4064 6563 6f6e 7374 7275 6374 6962 6c65 @deconstructible │ │ │ │ -00039b80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00039ba0: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ -00039bb0: 6174 683c 2f73 7061 6e3e 3c73 7061 6e20 ath="django. │ │ │ │ -00039bf0: 6462 2e6d 6f64 656c 732e 4f72 6465 7242 db.models.OrderB │ │ │ │ -00039c00: 7926 7175 6f74 3b3c 2f73 7061 6e3e 3c73 y")< │ │ │ │ -00039c20: 2f73 7061 6e3e 0a3c 7370 616e 2063 6c61 /span>.class OrderBy(Expre │ │ │ │ -00039c90: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion):. templa │ │ │ │ -00039cd0: 7465 3c2f 7370 616e 3e20 3c73 7061 6e20 te = "%(expression)s │ │ │ │ -00039d30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 │ │ │ │ -00039d50: 3c73 7061 6e20 636c 6173 733d 2273 6922 %(ordering)s". condition │ │ │ │ -00039db0: 616c 3c2f 7370 616e 3e20 3c73 7061 6e20 al = False │ │ │ │ -00039df0: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -00039e10: 203c 7370 616e 2063 6c61 7373 3d22 666d __init__(self, ex │ │ │ │ -00039e90: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ -00039ea0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00039eb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c descendi │ │ │ │ -00039ed0: 6e67 3c2f 7370 616e 3e3c 7370 616e 2063 ng=False,< │ │ │ │ -00039f20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> nulls_fir │ │ │ │ -00039f40: 7374 3c2f 7370 616e 3e3c 7370 616e 2063 st=None, nulls_last │ │ │ │ -00039fb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 =< │ │ │ │ -00039fd0: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ -00039fe0: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e None):. if< │ │ │ │ -0003a020: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> nulls_fir │ │ │ │ -0003a040: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st and nulls_last │ │ │ │ -0003a080: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ -0003a0a0: 2020 2020 2020 2020 2020 2020 3c73 7061 rais │ │ │ │ -0003a0c0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e ValueE │ │ │ │ -0003a0e0: 7272 6f72 3c2f 7370 616e 3e3c 7370 616e rror("nulls_ │ │ │ │ -0003a120: 6669 7273 7420 616e 6420 6e75 6c6c 735f first and nulls_ │ │ │ │ -0003a130: 6c61 7374 2061 7265 206d 7574 7561 6c6c last are mutuall │ │ │ │ -0003a140: 7920 6578 636c 7573 6976 6526 7175 6f74 y exclusive" │ │ │ │ -0003a150: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;) │ │ │ │ -0003a170: 0a20 2020 2020 2020 203c 7370 616e 2063 . if nulls_first is │ │ │ │ -0003a1d0: 203c 7370 616e 2063 6c61 7373 3d22 6b63 False < │ │ │ │ -0003a1f0: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -0003a200: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or nulls_ │ │ │ │ -0003a220: 6c61 7374 3c2f 7370 616e 3e20 3c73 7061 last is< │ │ │ │ -0003a240: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> False:. │ │ │ │ -0003a280: 2020 2020 2020 2020 203c 7370 616e 2063 # When │ │ │ │ -0003a2a0: 2074 6865 2064 6570 7265 6361 7469 6f6e the deprecation │ │ │ │ -0003a2b0: 2065 6e64 732c 2072 6570 6c61 6365 2077 ends, replace w │ │ │ │ -0003a2c0: 6974 683a 3c2f 7370 616e 3e0a 2020 2020 ith:. │ │ │ │ -0003a2d0: 2020 2020 2020 2020 3c73 7061 6e20 636c # raise │ │ │ │ -0003a2f0: 2056 616c 7565 4572 726f 7228 3c2f 7370 ValueError(. │ │ │ │ -0003a310: 3c73 7061 6e20 636c 6173 733d 2263 3122 # "nul │ │ │ │ -0003a330: 6c73 5f66 6972 7374 2061 6e64 206e 756c ls_first and nul │ │ │ │ -0003a340: 6c73 5f6c 6173 7420 7661 6c75 6573 206d ls_last values m │ │ │ │ -0003a350: 7573 7420 6265 2054 7275 6520 6f72 204e ust be True or N │ │ │ │ -0003a360: 6f6e 652e 2671 756f 743b 3c2f 7370 616e one.". # │ │ │ │ -0003a390: 2029 3c2f 7370 616e 3e0a 2020 2020 2020 ). │ │ │ │ -0003a3a0: 2020 2020 2020 3c73 7061 6e20 636c 6173 warnings.war │ │ │ │ -0003a3f0: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n( │ │ │ │ -0003a410: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0003a420: 203c 7370 616e 2063 6c61 7373 3d22 7332 "Passing │ │ │ │ -0003a440: 6e75 6c6c 735f 6669 7273 743d 4661 6c73 nulls_first=Fals │ │ │ │ -0003a450: 6520 6f72 206e 756c 6c73 5f6c 6173 743d e or nulls_last= │ │ │ │ -0003a460: 4661 6c73 6520 6973 2064 6570 7265 6361 False is depreca │ │ │ │ -0003a470: 7465 642c 2075 7365 204e 6f6e 6520 2671 ted, use None &q │ │ │ │ -0003a480: 756f 743b 3c2f 7370 616e 3e0a 2020 2020 uot;. │ │ │ │ -0003a490: 2020 2020 2020 2020 2020 2020 3c73 7061 &qu │ │ │ │ -0003a4b0: 6f74 3b69 6e73 7465 6164 2e26 7175 6f74 ot;instead." │ │ │ │ -0003a4c0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;, │ │ │ │ -0003a4e0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0003a4f0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 RemovedInDjango │ │ │ │ -0003a510: 3530 5761 726e 696e 673c 2f73 7061 6e3e 50Warning │ │ │ │ -0003a520: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0003a530: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ -0003a540: 2020 2020 2020 2020 203c 7370 616e 2063 stackle │ │ │ │ -0003a560: 7665 6c3c 2f73 7061 6e3e 3c73 7061 6e20 vel=2,. │ │ │ │ -0003a5c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0003a5d0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -0003a5e0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self... < │ │ │ │ +000396e0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +000396f0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef selec │ │ │ │ +00039710: 745f 666f 726d 6174 3c2f 7370 616e 3e3c t_format< │ │ │ │ +00039720: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00039730: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, comp │ │ │ │ +00039780: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler, sql,< │ │ │ │ +000397d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> params):. │ │ │ │ +00039810: 2020 2020 2020 3c73 7061 6e20 636c 6173 # Wrap EX │ │ │ │ +00039830: 4953 5453 2829 2077 6974 6820 6120 4341 ISTS() with a CA │ │ │ │ +00039840: 5345 2057 4845 4e20 6578 7072 6573 7369 SE WHEN expressi │ │ │ │ +00039850: 6f6e 2069 6620 6120 6461 7461 6261 7365 on if a database │ │ │ │ +00039860: 2062 6163 6b65 6e64 3c2f 7370 616e 3e0a backend. │ │ │ │ +00039870: 2020 2020 2020 2020 3c73 7061 6e20 636c # (e.g. │ │ │ │ +00039890: 204f 7261 636c 6529 2064 6f65 736e 2623 Oracle) doesn&# │ │ │ │ +000398a0: 3339 3b74 2073 7570 706f 7274 2062 6f6f 39;t support boo │ │ │ │ +000398b0: 6c65 616e 2065 7870 7265 7373 696f 6e20 lean expression │ │ │ │ +000398c0: 696e 2053 454c 4543 5420 6f72 2047 524f in SELECT or GRO │ │ │ │ +000398d0: 5550 3c2f 7370 616e 3e0a 2020 2020 2020 UP. │ │ │ │ +000398e0: 2020 3c73 7061 6e20 636c 6173 733d 2263 # BY list.. if< │ │ │ │ +00039920: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> not compiler.connec │ │ │ │ +00039990: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion.features.suppor │ │ │ │ +00039a00: 7473 5f62 6f6f 6c65 616e 5f65 7870 725f ts_boolean_expr_ │ │ │ │ +00039a10: 696e 5f73 656c 6563 745f 636c 6175 7365 in_select_clause │ │ │ │ +00039a20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +00039a40: 2020 2020 2020 2020 2020 2020 3c73 7061 sql< │ │ │ │ +00039a60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00039a80: 3c73 7061 6e20 636c 6173 733d 2273 3222 "CASE WHEN │ │ │ │ +00039aa0: 203c 2f73 7061 6e3e 3c73 7061 6e20 636c {} THEN 1 ELSE │ │ │ │ +00039ae0: 3020 454e 4426 7175 6f74 3b3c 2f73 7061 0 END".format │ │ │ │ +00039b20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00039b40: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ +00039b50: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql). return │ │ │ │ +00039b90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c sql, param │ │ │ │ +00039be0: 733c 2f73 7061 6e3e 3c2f 6469 763e 0a0a s
.. │ │ │ │ +00039bf0: 0a0a 3c73 7061 6e20 636c 6173 733d 226e ..@deconstructi │ │ │ │ +00039c10: 626c 653c 2f73 7061 6e3e 3c73 7061 6e20 ble(path="djan │ │ │ │ +00039c80: 676f 2e64 622e 6d6f 6465 6c73 2e4f 7264 go.db.models.Ord │ │ │ │ +00039c90: 6572 4279 2671 756f 743b 3c2f 7370 616e erBy").class< │ │ │ │ +00039cd0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> OrderBy< │ │ │ │ +00039cf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(Ex │ │ │ │ +00039d20: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ +00039d30: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00039d40: 3a3c 2f73 7061 6e3e 0a20 2020 203c 7370 :. tem │ │ │ │ +00039d60: 706c 6174 653c 2f73 7061 6e3e 203c 7370 plate = "%(expressio │ │ │ │ +00039dc0: 6e29 733c 2f73 7061 6e3e 3c73 7061 6e20 n)s %(ordering)s │ │ │ │ +00039e00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ". condit │ │ │ │ +00039e40: 696f 6e61 6c3c 2f73 7061 6e3e 203c 7370 ional = False.. def __init__(sel │ │ │ │ +00039ef0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f, │ │ │ │ +00039f10: 203c 7370 616e 2063 6c61 7373 3d22 6e22 expression, desce │ │ │ │ +00039f60: 6e64 696e 673c 2f73 7061 6e3e 3c73 7061 nding=False, nulls_ │ │ │ │ +00039fd0: 6669 7273 743c 2f73 7061 6e3e 3c73 7061 first=None │ │ │ │ +0003a010: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0003a020: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , nulls_l │ │ │ │ +0003a040: 6173 743c 2f73 7061 6e3e 3c73 7061 6e20 ast=None): │ │ │ │ +0003a090: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0003a0a0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0003a0b0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if nulls_ │ │ │ │ +0003a0d0: 6669 7273 743c 2f73 7061 6e3e 203c 7370 first an │ │ │ │ +0003a0f0: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d nulls_l │ │ │ │ +0003a110: 6173 743c 2f73 7061 6e3e 3c73 7061 6e20 ast:. < │ │ │ │ +0003a140: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +0003a150: 6169 7365 3c2f 7370 616e 3e20 3c73 7061 aise Val │ │ │ │ +0003a170: 7565 4572 726f 723c 2f73 7061 6e3e 3c73 ueError(< │ │ │ │ +0003a190: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>"nul │ │ │ │ +0003a1b0: 6c73 5f66 6972 7374 2061 6e64 206e 756c ls_first and nul │ │ │ │ +0003a1c0: 6c73 5f6c 6173 7420 6172 6520 6d75 7475 ls_last are mutu │ │ │ │ +0003a1d0: 616c 6c79 2065 7863 6c75 7369 7665 2671 ally exclusive&q │ │ │ │ +0003a1e0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;). if nulls_firs │ │ │ │ +0003a240: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t is False or nul │ │ │ │ +0003a2b0: 6c73 5f6c 6173 743c 2f73 7061 6e3e 203c ls_last < │ │ │ │ +0003a2c0: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ +0003a2d0: 6973 3c2f 7370 616e 3e20 3c73 7061 6e20 is False │ │ │ │ +0003a2f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +0003a310: 2020 2020 2020 2020 2020 2020 3c73 7061 # W │ │ │ │ +0003a330: 6865 6e20 7468 6520 6465 7072 6563 6174 hen the deprecat │ │ │ │ +0003a340: 696f 6e20 656e 6473 2c20 7265 706c 6163 ion ends, replac │ │ │ │ +0003a350: 6520 7769 7468 3a3c 2f73 7061 6e3e 0a20 e with:. │ │ │ │ +0003a360: 2020 2020 2020 2020 2020 203c 7370 616e # ra │ │ │ │ +0003a380: 6973 6520 5661 6c75 6545 7272 6f72 283c ise ValueError(< │ │ │ │ +0003a390: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0003a3a0: 2020 203c 7370 616e 2063 6c61 7373 3d22 # " │ │ │ │ +0003a3c0: 6e75 6c6c 735f 6669 7273 7420 616e 6420 nulls_first and │ │ │ │ +0003a3d0: 6e75 6c6c 735f 6c61 7374 2076 616c 7565 nulls_last value │ │ │ │ +0003a3e0: 7320 6d75 7374 2062 6520 5472 7565 206f s must be True o │ │ │ │ +0003a3f0: 7220 4e6f 6e65 2e26 7175 6f74 3b3c 2f73 r None.". │ │ │ │ +0003a410: 203c 7370 616e 2063 6c61 7373 3d22 6331 # ). │ │ │ │ +0003a430: 2020 2020 2020 2020 203c 7370 616e 2063 warning │ │ │ │ +0003a450: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +0003a470: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003a480: 7761 726e 3c2f 7370 616e 3e3c 7370 616e warn(. │ │ │ │ +0003a4b0: 2020 2020 3c73 7061 6e20 636c 6173 733d "Passi │ │ │ │ +0003a4d0: 6e67 206e 756c 6c73 5f66 6972 7374 3d46 ng nulls_first=F │ │ │ │ +0003a4e0: 616c 7365 206f 7220 6e75 6c6c 735f 6c61 alse or nulls_la │ │ │ │ +0003a4f0: 7374 3d46 616c 7365 2069 7320 6465 7072 st=False is depr │ │ │ │ +0003a500: 6563 6174 6564 2c20 7573 6520 4e6f 6e65 ecated, use None │ │ │ │ +0003a510: 2026 7175 6f74 3b3c 2f73 7061 6e3e 0a20 ". │ │ │ │ +0003a520: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +0003a530: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +0003a540: 2671 756f 743b 696e 7374 6561 642e 2671 "instead.&q │ │ │ │ +0003a550: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;,. │ │ │ │ +0003a580: 2020 2020 3c73 7061 6e20 636c 6173 733d RemovedInDja │ │ │ │ +0003a5a0: 6e67 6f35 3057 6172 6e69 6e67 3c2f 7370 ngo50Warning,. │ │ │ │ +0003a5d0: 2020 2020 2020 2020 2020 2020 3c73 7061 stac │ │ │ │ +0003a5f0: 6b6c 6576 656c 3c2f 7370 616e 3e3c 7370 klevel=nulls_first │ │ │ │ -0003a630: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -0003a650: 203c 7370 616e 2063 6c61 7373 3d22 6e22 nulls_first. sel │ │ │ │ -0003a690: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -0003a6b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003a6c0: 6e75 6c6c 735f 6c61 7374 3c2f 7370 616e nulls_last = nulls │ │ │ │ -0003a700: 5f6c 6173 743c 2f73 7061 6e3e 0a20 2020 _last. │ │ │ │ -0003a710: 2020 2020 203c 7370 616e 2063 6c61 7373 self.descend │ │ │ │ -0003a760: 696e 673c 2f73 7061 6e3e 203c 7370 616e ing = descending. if │ │ │ │ -0003a7c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c not hasattr(expre │ │ │ │ -0003a830: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion, "reso │ │ │ │ -0003a870: 6c76 655f 6578 7072 6573 7369 6f6e 2671 lve_expression&q │ │ │ │ -0003a880: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;):. │ │ │ │ -0003a8b0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 raise V │ │ │ │ -0003a8e0: 616c 7565 4572 726f 723c 2f73 7061 6e3e alueError │ │ │ │ -0003a8f0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0003a900: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c ("e │ │ │ │ -0003a920: 7870 7265 7373 696f 6e20 6d75 7374 2062 xpression must b │ │ │ │ -0003a930: 6520 616e 2065 7870 7265 7373 696f 6e20 e an expression │ │ │ │ -0003a940: 7479 7065 2671 756f 743b 3c2f 7370 616e type"). │ │ │ │ -0003a970: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ -0003a9a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>expression │ │ │ │ -0003a9c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -0003a9e0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 expression.. def __repr__(self │ │ │ │ -0003aa70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -0003aa90: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -0003aab0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "{}< │ │ │ │ -0003aaf0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -0003ab00: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c ({}, descending= │ │ │ │ -0003ab40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 {})" │ │ │ │ -0003ab80: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003ab90: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .format2,< │ │ │ │ +0003a640: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0003a650: 2020 203c 7370 616e 2063 6c61 7373 3d22 ). │ │ │ │ +0003a670: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +0003a690: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003a6a0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .nulls_fi │ │ │ │ +0003a6c0: 7273 743c 2f73 7061 6e3e 203c 7370 616e rst = nulls_first< │ │ │ │ +0003a700: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0003a710: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003a720: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.nulls_last = nu │ │ │ │ +0003a790: 6c6c 735f 6c61 7374 3c2f 7370 616e 3e0a lls_last. │ │ │ │ +0003a7a0: 2020 2020 2020 2020 3c73 7061 6e20 636c self.desc │ │ │ │ +0003a7f0: 656e 6469 6e67 3c2f 7370 616e 3e20 3c73 ending =< │ │ │ │ +0003a810: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> descendin │ │ │ │ +0003a830: 673c 2f73 7061 6e3e 0a20 2020 2020 2020 g. │ │ │ │ +0003a840: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if not< │ │ │ │ +0003a870: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> hasattr< │ │ │ │ +0003a890: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(ex │ │ │ │ +0003a8c0: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ +0003a8d0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0003a8e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c "r │ │ │ │ +0003a900: 6573 6f6c 7665 5f65 7870 7265 7373 696f esolve_expressio │ │ │ │ +0003a910: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 3c73 n"): │ │ │ │ +0003a930: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0003a940: 2020 2020 3c73 7061 6e20 636c 6173 733d raise │ │ │ │ +0003a960: 203c 7370 616e 2063 6c61 7373 3d22 6e65 ValueError(&quo │ │ │ │ +0003a9b0: 743b 6578 7072 6573 7369 6f6e 206d 7573 t;expression mus │ │ │ │ +0003a9c0: 7420 6265 2061 6e20 6578 7072 6573 7369 t be an expressi │ │ │ │ +0003a9d0: 6f6e 2074 7970 6526 7175 6f74 3b3c 2f73 on type"). │ │ │ │ +0003aa00: 2020 2020 203c 7370 616e 2063 6c61 7373 self.express │ │ │ │ +0003aa50: 696f 6e3c 2f73 7061 6e3e 203c 7370 616e ion = expression.. def __repr__< │ │ │ │ +0003aad0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0003ab00: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. retu │ │ │ │ +0003ab40: 726e 3c2f 7370 616e 3e20 3c73 7061 6e20 rn " │ │ │ │ +0003ab60: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;{}({}(. │ │ │ │ -0003abd0: 2020 2020 2020 2020 2020 3c73 7061 6e20 self< │ │ │ │ -0003abf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ -0003ac20: 5f63 6c61 7373 5f5f 3c2f 7370 616e 3e3c _class__< │ │ │ │ -0003ac30: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0003ac40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 __name__ │ │ │ │ -0003ac60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0003ac80: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.expression, s │ │ │ │ -0003ad00: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.descending. ).. def set_source │ │ │ │ -0003ada0: 5f65 7870 7265 7373 696f 6e73 3c2f 7370 _expressions(self │ │ │ │ -0003ade0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -0003ae00: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003ae10: 6578 7072 733c 2f73 7061 6e3e 3c73 7061 exprs):. s │ │ │ │ -0003ae50: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.expression = exp │ │ │ │ -0003aec0: 7273 3c2f 7370 616e 3e3c 7370 616e 2063 rs[0].. def get_source_e │ │ │ │ -0003af50: 7870 7265 7373 696f 6e73 3c2f 7370 616e xpressions(self):. │ │ │ │ -0003afb0: 2020 2020 2020 203c 7370 616e 2063 6c61 return [se │ │ │ │ -0003b000: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.expression].. │ │ │ │ -0003b060: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0003b070: 6465 663c 2f73 7061 6e3e 203c 7370 616e def as_s │ │ │ │ -0003b090: 716c 3c2f 7370 616e 3e3c 7370 616e 2063 ql(self, compiler, co │ │ │ │ -0003b130: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ -0003b140: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0003b150: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c template │ │ │ │ -0003b170: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 =< │ │ │ │ -0003b190: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ -0003b1a0: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e None, **ext │ │ │ │ -0003b1f0: 7261 5f63 6f6e 7465 7874 3c2f 7370 616e ra_context):. │ │ │ │ -0003b220: 2020 203c 7370 616e 2063 6c61 7373 3d22 template = temp │ │ │ │ -0003b270: 6c61 7465 3c2f 7370 616e 3e20 3c73 7061 late or< │ │ │ │ -0003b290: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.templ │ │ │ │ -0003b2e0: 6174 653c 2f73 7061 6e3e 0a20 2020 2020 ate. │ │ │ │ -0003b2f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 if con │ │ │ │ -0003b320: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection.< │ │ │ │ +0003abc0: 3d22 7332 223e 2c20 6465 7363 656e 6469 ="s2">, descendi │ │ │ │ +0003abd0: 6e67 3d3c 2f73 7061 6e3e 3c73 7061 6e20 ng={})".forma │ │ │ │ +0003ac40: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t( │ │ │ │ +0003ac60: 0a20 2020 2020 2020 2020 2020 203c 7370 . se │ │ │ │ +0003ac80: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.__class__.__nam │ │ │ │ +0003acf0: 655f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 e__, self< │ │ │ │ +0003ad30: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003ad40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 expressio │ │ │ │ +0003ad60: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n, │ │ │ │ +0003ad80: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.descending< │ │ │ │ +0003add0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0003ade0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0003adf0: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +0003ae10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c set_sou │ │ │ │ +0003ae30: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ +0003ae40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0003ae70: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, exprs< │ │ │ │ +0003aeb0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0003aec0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0003aed0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.expression< │ │ │ │ +0003af20: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +0003af40: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003af50: 6578 7072 733c 2f73 7061 6e3e 3c73 7061 exprs[0].. def get_sourc │ │ │ │ +0003afe0: 655f 6578 7072 6573 7369 6f6e 733c 2f73 e_expressions(sel │ │ │ │ +0003b020: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f):. return │ │ │ │ +0003b060: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c [ │ │ │ │ +0003b080: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.expression].. │ │ │ │ +0003b0f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 def a │ │ │ │ +0003b120: 735f 7371 6c3c 2f73 7061 6e3e 3c73 7061 s_sql(self │ │ │ │ +0003b160: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0003b170: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , compile │ │ │ │ +0003b190: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r, │ │ │ │ +0003b1b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 connection, templ │ │ │ │ +0003b200: 6174 653c 2f73 7061 6e3e 3c73 7061 6e20 ate=None,< │ │ │ │ +0003b250: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ** │ │ │ │ +0003b270: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003b280: 6578 7472 615f 636f 6e74 6578 743c 2f73 extra_context):. │ │ │ │ +0003b2b0: 2020 2020 2020 3c73 7061 6e20 636c 6173 template = < │ │ │ │ +0003b2f0: 7370 616e 2063 6c61 7373 3d22 6e22 3e74 span class="n">t │ │ │ │ +0003b300: 656d 706c 6174 653c 2f73 7061 6e3e 203c emplate < │ │ │ │ +0003b310: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ +0003b320: 6f72 3c2f 7370 616e 3e20 3c73 7061 6e20 or self< │ │ │ │ 0003b340: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>features.sup │ │ │ │ -0003b390: 706f 7274 735f 6f72 6465 725f 6279 5f6e ports_order_by_n │ │ │ │ -0003b3a0: 756c 6c73 5f6d 6f64 6966 6965 723c 2f73 ulls_modifier:. │ │ │ │ -0003b3d0: 2020 2020 2020 2020 203c 7370 616e 2063 if self< │ │ │ │ -0003b410: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0003b420: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 nulls_las │ │ │ │ -0003b440: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t: │ │ │ │ -0003b460: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0003b470: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ -0003b490: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = " │ │ │ │ -0003b4c0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;%s NULLS LAST&q │ │ │ │ -0003b500: 756f 743b 3c2f 7370 616e 3e20 3c73 7061 uot; % template. │ │ │ │ -0003b550: 203c 7370 616e 2063 6c61 7373 3d22 6b22 elif se │ │ │ │ -0003b580: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.nulls_first:. │ │ │ │ -0003b5e0: 2020 2020 2020 2020 2020 2020 3c73 7061 temp │ │ │ │ -0003b600: 6c61 7465 3c2f 7370 616e 3e20 3c73 7061 late = "%s N │ │ │ │ -0003b670: 554c 4c53 2046 4952 5354 2671 756f 743b ULLS FIRST" │ │ │ │ -0003b680: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c % │ │ │ │ -0003b6a0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ -0003b6c0: 0a20 2020 2020 2020 203c 7370 616e 2063 . else:. │ │ │ │ -0003b700: 2020 2020 2020 2020 203c 7370 616e 2063 if self< │ │ │ │ -0003b740: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0003b750: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 nulls_las │ │ │ │ -0003b770: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t and not │ │ │ │ -0003b7b0: 203c 7370 616e 2063 6c61 7373 3d22 7022 (. │ │ │ │ -0003b7d0: 2020 2020 2020 2020 2020 3c73 7061 6e20 self< │ │ │ │ -0003b7f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.de │ │ │ │ -0003b820: 7363 656e 6469 6e67 3c2f 7370 616e 3e20 scending │ │ │ │ -0003b830: 3c73 7061 6e20 636c 6173 733d 226f 7722 and conn │ │ │ │ -0003b860: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection.features.orde │ │ │ │ -0003b8d0: 725f 6279 5f6e 756c 6c73 5f66 6972 7374 r_by_nulls_first │ │ │ │ -0003b8e0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0003b8f0: 2020 2020 3c73 7061 6e20 636c 6173 733d ):. │ │ │ │ -0003b910: 2020 2020 2020 2020 2020 2020 2020 3c73 te │ │ │ │ -0003b930: 6d70 6c61 7465 3c2f 7370 616e 3e20 3c73 mplate =< │ │ │ │ -0003b950: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "%%< │ │ │ │ -0003b990: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -0003b9a0: 2865 7870 7265 7373 696f 6e29 7320 4953 (expression)s IS │ │ │ │ -0003b9b0: 204e 554c 4c2c 203c 2f73 7061 6e3e 3c73 NULL, % │ │ │ │ -0003b9d0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s"< │ │ │ │ -0003b9f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> % │ │ │ │ -0003ba10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003ba20: 7465 6d70 6c61 7465 3c2f 7370 616e 3e0a template. │ │ │ │ -0003ba30: 2020 2020 2020 2020 2020 2020 3c73 7061 elif │ │ │ │ -0003ba50: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.null │ │ │ │ -0003baa0: 735f 6669 7273 743c 2f73 7061 6e3e 203c s_first < │ │ │ │ -0003bab0: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -0003bac0: 616e 643c 2f73 7061 6e3e 203c 7370 616e and not< │ │ │ │ -0003bae0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (. │ │ │ │ -0003bb00: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0003bb10: 3c73 7061 6e20 636c 6173 733d 226f 7722 not sel │ │ │ │ -0003bb40: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -0003bb60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003bb70: 6465 7363 656e 6469 6e67 3c2f 7370 616e descending and co │ │ │ │ -0003bbb0: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ -0003bbc0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0003bbd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 features< │ │ │ │ -0003bbf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.or │ │ │ │ -0003bc20: 6465 725f 6279 5f6e 756c 6c73 5f66 6972 der_by_nulls_fir │ │ │ │ -0003bc30: 7374 3c2f 7370 616e 3e0a 2020 2020 2020 st. │ │ │ │ -0003bc40: 2020 2020 2020 3c73 7061 6e20 636c 6173 ):. │ │ │ │ -0003bc60: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0003bc70: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003bc80: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ -0003bc90: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003bca0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = " │ │ │ │ -0003bcc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 %%(expression)s │ │ │ │ -0003bd00: 4953 204e 4f54 204e 554c 4c2c 203c 2f73 IS NOT NULL, %s& │ │ │ │ -0003bd40: 7175 6f74 3b3c 2f73 7061 6e3e 203c 7370 quot; % template. co │ │ │ │ -0003bda0: 6e6e 6563 7469 6f6e 3c2f 7370 616e 3e3c nnection< │ │ │ │ -0003bdb0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0003bdc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ops.check_e │ │ │ │ -0003be10: 7870 7265 7373 696f 6e5f 7375 7070 6f72 xpression_suppor │ │ │ │ -0003be20: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t( │ │ │ │ -0003be40: 3c73 7061 6e20 636c 6173 733d 2262 7022 self). exp │ │ │ │ -0003be90: 7265 7373 696f 6e5f 7371 6c3c 2f73 7061 ression_sql, param │ │ │ │ -0003bed0: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = compiler.compile │ │ │ │ -0003bf40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -0003bf60: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -0003bf70: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.expression). │ │ │ │ -0003bfd0: 2020 2020 203c 7370 616e 2063 6c61 7373 placeholder │ │ │ │ -0003bff0: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = {. │ │ │ │ -0003c030: 2020 2020 2020 203c 7370 616e 2063 6c61 "ex │ │ │ │ -0003c050: 7072 6573 7369 6f6e 2671 756f 743b 3c2f pression": ex │ │ │ │ -0003c090: 7072 6573 7369 6f6e 5f73 716c 3c2f 7370 pression_sql,. │ │ │ │ -0003c0c0: 2020 2020 2020 2020 3c73 7061 6e20 636c "o │ │ │ │ -0003c0e0: 7264 6572 696e 6726 7175 6f74 3b3c 2f73 rdering": &q │ │ │ │ -0003c120: 756f 743b 4445 5343 2671 756f 743b 3c2f uot;DESC" if │ │ │ │ -0003c150: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.descending else "ASC&quo │ │ │ │ -0003c1e0: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;,. ** │ │ │ │ -0003c220: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 extra_con │ │ │ │ -0003c240: 7465 7874 3c2f 7370 616e 3e3c 7370 616e text,. }. par │ │ │ │ -0003c2a0: 616d 733c 2f73 7061 6e3e 203c 7370 616e ams *= template.coun │ │ │ │ -0003c310: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t( │ │ │ │ -0003c330: 3c73 7061 6e20 636c 6173 733d 2273 3222 "% │ │ │ │ -0003c360: 2865 7870 7265 7373 696f 6e29 733c 2f73 (expression)s"). │ │ │ │ -0003c3b0: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ -0003c3d0: 203c 7370 616e 2063 6c61 7373 3d22 7022 (templat │ │ │ │ -0003c400: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e % placeholders).rstrip(), par │ │ │ │ -0003c4c0: 616d 733c 2f73 7061 6e3e 0a0a 2020 2020 ams.. │ │ │ │ -0003c4d0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0003c4e0: 6465 663c 2f73 7061 6e3e 203c 7370 616e def as_o │ │ │ │ -0003c500: 7261 636c 653c 2f73 7061 6e3e 3c73 7061 racle(self │ │ │ │ -0003c540: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0003c550: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , compile │ │ │ │ -0003c570: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r, │ │ │ │ -0003c590: 203c 7370 616e 2063 6c61 7373 3d22 6e22 connection):. │ │ │ │ -0003c5d0: 2020 2020 3c73 7061 6e20 636c 6173 733d # Oracle do │ │ │ │ -0003c5f0: 6573 6e26 2333 393b 7420 616c 6c6f 7720 esn't allow │ │ │ │ -0003c600: 4f52 4445 5220 4259 2045 5849 5354 5328 ORDER BY EXISTS( │ │ │ │ -0003c610: 2920 6f72 2066 696c 7465 7273 2075 6e6c ) or filters unl │ │ │ │ -0003c620: 6573 7320 6974 2623 3339 3b73 2077 7261 ess it's wra │ │ │ │ -0003c630: 7070 6564 3c2f 7370 616e 3e0a 2020 2020 pped. │ │ │ │ -0003c640: 2020 2020 3c73 7061 6e20 636c 6173 733d # in a CASE │ │ │ │ -0003c660: 2057 4845 4e2e 3c2f 7370 616e 3e0a 2020 WHEN.. │ │ │ │ -0003c670: 2020 2020 2020 3c73 7061 6e20 636c 6173 if │ │ │ │ -0003c690: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003c6a0: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection.ops.condi │ │ │ │ -0003c710: 7469 6f6e 616c 5f65 7870 7265 7373 696f tional_expressio │ │ │ │ -0003c720: 6e5f 7375 7070 6f72 7465 645f 696e 5f77 n_supported_in_w │ │ │ │ -0003c730: 6865 7265 5f63 6c61 7573 653c 2f73 7061 here_clause(. │ │ │ │ -0003c760: 2020 2020 2020 203c 7370 616e 2063 6c61 self.expre │ │ │ │ -0003c7b0: 7373 696f 6e3c 2f73 7061 6e3e 0a20 2020 ssion. │ │ │ │ -0003c7c0: 2020 2020 203c 7370 616e 2063 6c61 7373 ):. │ │ │ │ -0003c7e0: 2020 2020 2020 2020 2020 203c 7370 616e copy< │ │ │ │ -0003c800: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -0003c820: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.copy< │ │ │ │ -0003c870: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0003c880: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -0003c890: 2020 2020 203c 7370 616e 2063 6c61 7373 copy │ │ │ │ -0003c8b0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003c8c0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .expressi │ │ │ │ -0003c8e0: 6f6e 3c2f 7370 616e 3e20 3c73 7061 6e20 on = Case(< │ │ │ │ -0003c930: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0003c940: 2020 2020 2020 203c 7370 616e 2063 6c61 When(self< │ │ │ │ -0003c990: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ex │ │ │ │ -0003c9c0: 7072 6573 7369 6f6e 3c2f 7370 616e 3e3c pression< │ │ │ │ -0003c9d0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -0003c9e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c then=True │ │ │ │ -0003ca30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ), │ │ │ │ -0003ca50: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0003ca60: 203c 7370 616e 2063 6c61 7373 3d22 6e22 default< │ │ │ │ -0003ca80: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -0003ca90: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 False,. │ │ │ │ -0003cad0: 2020 2020 2020 2020 203c 7370 616e 2063 ). re │ │ │ │ -0003cb10: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn copy │ │ │ │ -0003cb30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0003cb50: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -0003cb60: 735f 7371 6c3c 2f73 7061 6e3e 3c73 7061 s_sql(compiler, conn │ │ │ │ -0003cbd0: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection). re │ │ │ │ -0003cc10: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn sel │ │ │ │ -0003cc30: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -0003cc50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003cc60: 6173 5f73 716c 3c2f 7370 616e 3e3c 7370 as_sql(compiler, con │ │ │ │ -0003ccd0: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection)< │ │ │ │ -0003ccf0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ -0003cd10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> get_grou │ │ │ │ -0003cd30: 705f 6279 5f63 6f6c 733c 2f73 7061 6e3e p_by_cols │ │ │ │ -0003cd40: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0003cd50: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ -0003cd90: 2020 2020 2020 3c73 7061 6e20 636c 6173 cols = []. for │ │ │ │ -0003ce00: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c source in │ │ │ │ -0003ce40: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.get_source_ │ │ │ │ -0003ce90: 6578 7072 6573 7369 6f6e 733c 2f73 7061 expressions():. │ │ │ │ -0003cec0: 2020 2020 2020 2020 203c 7370 616e 2063 cols.exte │ │ │ │ -0003cf10: 6e64 3c2f 7370 616e 3e3c 7370 616e 2063 nd(source.< │ │ │ │ -0003cf60: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>get_group_ │ │ │ │ -0003cf80: 6279 5f63 6f6c 733c 2f73 7061 6e3e 3c73 by_cols() │ │ │ │ -0003cfa0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -0003cfb0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -0003cfd0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -0003cfe0: 6f6c 733c 2f73 7061 6e3e 0a0a 2020 2020 ols.. │ │ │ │ -0003cff0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0003d000: 6465 663c 2f73 7061 6e3e 203c 7370 616e def reve │ │ │ │ -0003d020: 7273 655f 6f72 6465 7269 6e67 3c2f 7370 rse_ordering(self │ │ │ │ -0003d060: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -0003d080: 0a20 2020 2020 2020 203c 7370 616e 2063 . self.des │ │ │ │ -0003d0d0: 6365 6e64 696e 673c 2f73 7061 6e3e 203c cending < │ │ │ │ -0003d0e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -0003d0f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c not self │ │ │ │ -0003d130: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003d140: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .descendi │ │ │ │ -0003d160: 6e67 3c2f 7370 616e 3e0a 2020 2020 2020 ng. │ │ │ │ -0003d170: 2020 3c73 7061 6e20 636c 6173 733d 226b if sel │ │ │ │ -0003d1a0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -0003d1c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003d1d0: 6e75 6c6c 735f 6669 7273 743c 2f73 7061 nulls_first:. │ │ │ │ -0003d200: 2020 2020 2020 203c 7370 616e 2063 6c61 self.nulls │ │ │ │ -0003d250: 5f6c 6173 743c 2f73 7061 6e3e 203c 7370 _last = True. < │ │ │ │ -0003d2a0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -0003d2b0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.nulls_first = < │ │ │ │ -0003d310: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ -0003d320: 4e6f 6e65 3c2f 7370 616e 3e0a 2020 2020 None. │ │ │ │ -0003d330: 2020 2020 3c73 7061 6e20 636c 6173 733d elif │ │ │ │ -0003d350: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.nulls_last:. │ │ │ │ -0003d3c0: 2020 2020 2020 2020 2020 3c73 7061 6e20 self< │ │ │ │ -0003d3e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.nu │ │ │ │ -0003d410: 6c6c 735f 6669 7273 743c 2f73 7061 6e3e lls_first │ │ │ │ -0003d420: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = True< │ │ │ │ -0003d450: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0003d460: 2020 203c 7370 616e 2063 6c61 7373 3d22 self< │ │ │ │ -0003d480: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0003d490: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 nulls_las │ │ │ │ -0003d4b0: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t = None. │ │ │ │ -0003d4f0: 2020 2020 2020 203c 7370 616e 2063 6c61 return self.. def asc(self):. │ │ │ │ -0003d5c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 self< │ │ │ │ -0003d5e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -0003d5f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 descendin │ │ │ │ -0003d610: 673c 2f73 7061 6e3e 203c 7370 616e 2063 g = False. │ │ │ │ -0003d650: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ -0003d670: 3c73 7061 6e20 636c 6173 733d 226e 6622 desc(self │ │ │ │ -0003d6c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0003d6d0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -0003d6e0: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ -0003d710: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>descending │ │ │ │ -0003d730: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -0003d750: 203c 7370 616e 2063 6c61 7373 3d22 6b63 True... │ │ │ │ -0003d770: 3c64 6976 2063 6c61 7373 3d22 7669 6577
.[docs]. │ │ │ │ -0003d810: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0003d820: 636c 6173 733c 2f73 7061 6e3e 203c 7370 class Wi │ │ │ │ -0003d840: 6e64 6f77 3c2f 7370 616e 3e3c 7370 616e ndow(SQLiteNumeric │ │ │ │ -0003d880: 4d69 7869 6e3c 2f73 7061 6e3e 3c73 7061 Mixin, Expression< │ │ │ │ -0003d8c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -0003d8e0: 2020 2020 3c73 7061 6e20 636c 6173 733d template = &q │ │ │ │ -0003d930: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;%(ex │ │ │ │ -0003d950: 7072 6573 7369 6f6e 2973 3c2f 7370 616e pression)s OVER ( │ │ │ │ -0003d980: 3c73 7061 6e20 636c 6173 733d 2273 6922 %(window)s)". # Althoug │ │ │ │ -0003d9e0: 6820 7468 6520 6d61 696e 2065 7870 7265 h the main expre │ │ │ │ -0003d9f0: 7373 696f 6e20 6d61 7920 6569 7468 6572 ssion may either │ │ │ │ -0003da00: 2062 6520 616e 2061 6767 7265 6761 7465 be an aggregate │ │ │ │ -0003da10: 206f 7220 616e 3c2f 7370 616e 3e0a 2020 or an. │ │ │ │ -0003da20: 2020 3c73 7061 6e20 636c 6173 733d 2263 # expression │ │ │ │ -0003da40: 7769 7468 2061 6e20 6167 6772 6567 6174 with an aggregat │ │ │ │ -0003da50: 6520 6675 6e63 7469 6f6e 2c20 7468 6520 e function, the │ │ │ │ -0003da60: 4752 4f55 5020 4259 2074 6861 7420 7769 GROUP BY that wi │ │ │ │ -0003da70: 6c6c 3c2f 7370 616e 3e0a 2020 2020 3c73 ll. # │ │ │ │ -0003da90: 2062 6520 696e 7472 6f64 7563 6564 2069 be introduced i │ │ │ │ -0003daa0: 6e20 7468 6520 7175 6572 7920 6173 2061 n the query as a │ │ │ │ -0003dab0: 2072 6573 756c 7420 6973 206e 6f74 2064 result is not d │ │ │ │ -0003dac0: 6573 6972 6564 2e3c 2f73 7061 6e3e 0a20 esired.. │ │ │ │ -0003dad0: 2020 203c 7370 616e 2063 6c61 7373 3d22 contains_aggr │ │ │ │ -0003daf0: 6567 6174 653c 2f73 7061 6e3e 203c 7370 egate = False. contains │ │ │ │ -0003db50: 5f6f 7665 725f 636c 6175 7365 3c2f 7370 _over_clause = Tr │ │ │ │ -0003db90: 7565 3c2f 7370 616e 3e0a 0a20 2020 203c ue.. < │ │ │ │ -0003dba0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -0003dbb0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef __ini │ │ │ │ -0003dbd0: 745f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 t__(. self │ │ │ │ -0003dc10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ,. │ │ │ │ -0003dc30: 2020 2020 2020 2020 3c73 7061 6e20 636c expressi │ │ │ │ -0003dc50: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on,. partit │ │ │ │ -0003dc90: 696f 6e5f 6279 3c2f 7370 616e 3e3c 7370 ion_by=None,. │ │ │ │ -0003dcf0: 2020 3c73 7061 6e20 636c 6173 733d 226e order_by=None,. │ │ │ │ -0003dd60: 2020 2020 2020 3c73 7061 6e20 636c 6173 frame=None< │ │ │ │ -0003ddb0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ -0003ddd0: 2020 2020 2020 203c 7370 616e 2063 6c61 output_fi │ │ │ │ -0003ddf0: 656c 643c 2f73 7061 6e3e 3c73 7061 6e20 eld=None,< │ │ │ │ -0003de40: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. ):. se │ │ │ │ -0003de80: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.partition_by = pa │ │ │ │ -0003def0: 7274 6974 696f 6e5f 6279 3c2f 7370 616e rtition_by. self< │ │ │ │ -0003df20: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.or │ │ │ │ -0003df50: 6465 725f 6279 3c2f 7370 616e 3e20 3c73 der_by =< │ │ │ │ -0003df70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> order_by< │ │ │ │ -0003df90: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -0003dfa0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -0003dfb0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.frame │ │ │ │ -0003dff0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003e000: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = frame.. < │ │ │ │ -0003e030: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ -0003e040: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f not getattr(expr │ │ │ │ -0003e0b0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession, "win │ │ │ │ -0003e0f0: 646f 775f 636f 6d70 6174 6962 6c65 2671 dow_compatible&q │ │ │ │ -0003e100: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;, False):. │ │ │ │ -0003e160: 2020 2020 2020 203c 7370 616e 2063 6c61 raise ValueError< │ │ │ │ -0003e1a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(. │ │ │ │ -0003e1c0: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ -0003e1d0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -0003e1e0: 2671 756f 743b 4578 7072 6573 7369 6f6e "Expression │ │ │ │ -0003e1f0: 2026 2333 393b 3c2f 7370 616e 3e3c 7370 '%s │ │ │ │ -0003e210: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ' is │ │ │ │ -0003e230: 6e26 2333 393b 7420 636f 6d70 6174 6962 n't compatib │ │ │ │ -0003e240: 6c65 2077 6974 6820 4f56 4552 2063 6c61 le with OVER cla │ │ │ │ -0003e250: 7573 6573 2e26 7175 6f74 3b3c 2f73 7061 uses.". │ │ │ │ -0003e270: 2020 203c 7370 616e 2063 6c61 7373 3d22 % expr │ │ │ │ -0003e2a0: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession.__class__< │ │ │ │ -0003e2e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._ │ │ │ │ -0003e310: 5f6e 616d 655f 5f3c 2f73 7061 6e3e 0a20 _name__. │ │ │ │ -0003e320: 2020 2020 2020 2020 2020 203c 7370 616e ).. if< │ │ │ │ -0003e360: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.parti │ │ │ │ -0003e3b0: 7469 6f6e 5f62 793c 2f73 7061 6e3e 203c tion_by < │ │ │ │ -0003e3c0: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -0003e3d0: 6973 3c2f 7370 616e 3e20 3c73 7061 6e20 is not None:. │ │ │ │ -0003e430: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ -0003e450: 203c 7370 616e 2063 6c61 7373 3d22 6f77 not is │ │ │ │ -0003e480: 696e 7374 616e 6365 3c2f 7370 616e 3e3c instance< │ │ │ │ -0003e490: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0003e4a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.parti │ │ │ │ -0003e4f0: 7469 6f6e 5f62 793c 2f73 7061 6e3e 3c73 tion_by,< │ │ │ │ -0003e510: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (< │ │ │ │ -0003e530: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -0003e540: 7475 706c 653c 2f73 7061 6e3e 3c73 7061 tuple, list)):. │ │ │ │ -0003e5a0: 2020 2020 2020 2020 2020 2020 3c73 7061 sel │ │ │ │ -0003e5c0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -0003e5e0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003e5f0: 7061 7274 6974 696f 6e5f 6279 3c2f 7370 partition_by = (self.partiti │ │ │ │ -0003e680: 6f6e 5f62 793c 2f73 7061 6e3e 3c73 7061 on_by,). │ │ │ │ -0003e6b0: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ -0003e6e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>partition_ │ │ │ │ -0003e700: 6279 3c2f 7370 616e 3e20 3c73 7061 6e20 by = ExpressionLis │ │ │ │ -0003e740: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t( │ │ │ │ -0003e760: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003e770: 2a3c 2f73 7061 6e3e 3c73 7061 6e20 636c *self.part │ │ │ │ -0003e7c0: 6974 696f 6e5f 6279 3c2f 7370 616e 3e3c ition_by< │ │ │ │ -0003e7d0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -0003e7e0: 3c2f 7370 616e 3e0a 0a20 2020 2020 2020 .. │ │ │ │ -0003e7f0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if self │ │ │ │ -0003e820: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0003e840: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -0003e850: 7264 6572 5f62 793c 2f73 7061 6e3e 203c rder_by < │ │ │ │ -0003e860: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ -0003e870: 6973 3c2f 7370 616e 3e20 3c73 7061 6e20 is not None:. │ │ │ │ -0003e8d0: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ -0003e8f0: 203c 7370 616e 2063 6c61 7373 3d22 6e62 isinstance(self │ │ │ │ -0003e940: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0003e960: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -0003e970: 7264 6572 5f62 793c 2f73 7061 6e3e 3c73 rder_by,< │ │ │ │ -0003e990: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (< │ │ │ │ -0003e9b0: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -0003e9c0: 6c69 7374 3c2f 7370 616e 3e3c 7370 616e list, tuple)):. │ │ │ │ -0003ea20: 2020 2020 2020 2020 2020 2020 3c73 7061 sel │ │ │ │ -0003ea40: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -0003ea60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003ea70: 6f72 6465 725f 6279 3c2f 7370 616e 3e20 order_by │ │ │ │ -0003ea80: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003ea90: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = OrderBy │ │ │ │ -0003eab0: 4c69 7374 3c2f 7370 616e 3e3c 7370 616e List(*self │ │ │ │ -0003eb00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0003eb20: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -0003eb30: 7264 6572 5f62 793c 2f73 7061 6e3e 3c73 rder_by)< │ │ │ │ -0003eb50: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -0003eb60: 2020 203c 7370 616e 2063 6c61 7373 3d22 elif < │ │ │ │ -0003eb80: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ -0003eb90: 6973 696e 7374 616e 6365 3c2f 7370 616e isinstance(self.ord │ │ │ │ -0003ec00: 6572 5f62 793c 2f73 7061 6e3e 3c73 7061 er_by, (Bas │ │ │ │ -0003ec50: 6545 7870 7265 7373 696f 6e3c 2f73 7061 eExpression, str< │ │ │ │ -0003ec90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>)): │ │ │ │ -0003ecb0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ -0003ecc0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.order_by = Or │ │ │ │ -0003ed40: 6465 7242 794c 6973 743c 2f73 7061 6e3e derByList │ │ │ │ -0003ed50: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0003ed60: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self.orde │ │ │ │ -0003edb0: 725f 6279 3c2f 7370 616e 3e3c 7370 616e r_by). │ │ │ │ -0003ede0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0003edf0: 656c 7365 3c2f 7370 616e 3e3c 7370 616e else:. │ │ │ │ -0003ee20: 2020 2020 3c73 7061 6e20 636c 6173 733d raise │ │ │ │ -0003ee40: 203c 7370 616e 2063 6c61 7373 3d22 6e65 ValueError(. │ │ │ │ -0003ee80: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0003ee90: 3c73 7061 6e20 636c 6173 733d 2273 3222 "Window.or │ │ │ │ -0003eeb0: 6465 725f 6279 206d 7573 7420 6265 2065 der_by must be e │ │ │ │ -0003eec0: 6974 6865 7220 6120 7374 7269 6e67 2072 ither a string r │ │ │ │ -0003eed0: 6566 6572 656e 6365 2074 6f20 6120 2671 eference to a &q │ │ │ │ -0003eee0: 756f 743b 3c2f 7370 616e 3e0a 2020 2020 uot;. │ │ │ │ -0003eef0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -0003ef00: 3c73 7061 6e20 636c 6173 733d 2273 3222 "field, an │ │ │ │ -0003ef20: 2065 7870 7265 7373 696f 6e2c 206f 7220 expression, or │ │ │ │ -0003ef30: 6120 6c69 7374 206f 7220 7475 706c 6520 a list or tuple │ │ │ │ -0003ef40: 6f66 2074 6865 6d2e 2671 756f 743b 3c2f of them.". │ │ │ │ -0003ef60: 2020 2020 2020 3c73 7061 6e20 636c 6173 ). │ │ │ │ -0003ef80: 2020 2020 2020 203c 7370 616e 2063 6c61 super().__init__(out │ │ │ │ -0003f020: 7075 745f 6669 656c 643c 2f73 7061 6e3e put_field │ │ │ │ -0003f030: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003f040: 3d3c 2f73 7061 6e3e 3c73 7061 6e20 636c =output_f │ │ │ │ -0003f060: 6965 6c64 3c2f 7370 616e 3e3c 7370 616e ield). sel │ │ │ │ -0003f0a0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -0003f0c0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -0003f0d0: 736f 7572 6365 5f65 7870 7265 7373 696f source_expressio │ │ │ │ -0003f0e0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n = self.< │ │ │ │ -0003f130: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>_parse_exp │ │ │ │ -0003f150: 7265 7373 696f 6e73 3c2f 7370 616e 3e3c ressions< │ │ │ │ -0003f160: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0003f170: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 expressio │ │ │ │ -0003f190: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n)[0].. def _resolve_out │ │ │ │ -0003f220: 7075 745f 6669 656c 643c 2f73 7061 6e3e put_field │ │ │ │ +0003b350: 733d 226f 223e 2e3c 2f73 7061 6e3e 3c73 s="o">.te │ │ │ │ +0003b370: 6d70 6c61 7465 3c2f 7370 616e 3e0a 2020 mplate. │ │ │ │ +0003b380: 2020 2020 2020 3c73 7061 6e20 636c 6173 if │ │ │ │ +0003b3a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003b3b0: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection.feature │ │ │ │ +0003b3f0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +0003b410: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003b420: 7375 7070 6f72 7473 5f6f 7264 6572 5f62 supports_order_b │ │ │ │ +0003b430: 795f 6e75 6c6c 735f 6d6f 6469 6669 6572 y_nulls_modifier │ │ │ │ +0003b440: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +0003b460: 2020 2020 2020 2020 2020 2020 3c73 7061 if self.nulls_ │ │ │ │ +0003b4d0: 6c61 7374 3c2f 7370 616e 3e3c 7370 616e last:. │ │ │ │ +0003b500: 2020 2020 3c73 7061 6e20 636c 6173 733d template = &q │ │ │ │ +0003b550: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;%s NULLS LAS │ │ │ │ +0003b590: 5426 7175 6f74 3b3c 2f73 7061 6e3e 203c T" < │ │ │ │ +0003b5a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e25 span class="o">% │ │ │ │ +0003b5b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c template │ │ │ │ +0003b5d0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0003b5e0: 2020 2020 3c73 7061 6e20 636c 6173 733d elif │ │ │ │ +0003b600: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.nulls_first< │ │ │ │ +0003b650: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>:. │ │ │ │ +0003b670: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +0003b680: 7370 616e 2063 6c61 7373 3d22 6e22 3e74 span class="n">t │ │ │ │ +0003b690: 656d 706c 6174 653c 2f73 7061 6e3e 203c emplate < │ │ │ │ +0003b6a0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +0003b6b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c "< │ │ │ │ +0003b6d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>%s │ │ │ │ +0003b6f0: 3c73 7061 6e20 636c 6173 733d 2273 3222 NULLS FIRST&qu │ │ │ │ +0003b710: 6f74 3b3c 2f73 7061 6e3e 203c 7370 616e ot; % template. else │ │ │ │ +0003b770: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +0003b790: 2020 2020 2020 2020 2020 2020 3c73 7061 if self.nulls_ │ │ │ │ +0003b800: 6c61 7374 3c2f 7370 616e 3e20 3c73 7061 last and │ │ │ │ +0003b820: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c not (. │ │ │ │ +0003b860: 2020 2020 2020 2020 2020 2020 203c 7370 se │ │ │ │ +0003b880: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.descending and < │ │ │ │ +0003b8e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0003b8f0: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ +0003b900: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003b910: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .features │ │ │ │ +0003b930: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0003b950: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +0003b960: 7264 6572 5f62 795f 6e75 6c6c 735f 6669 rder_by_nulls_fi │ │ │ │ +0003b970: 7273 743c 2f73 7061 6e3e 0a20 2020 2020 rst. │ │ │ │ +0003b980: 2020 2020 2020 203c 7370 616e 2063 6c61 ): │ │ │ │ +0003b9a0: 0a20 2020 2020 2020 2020 2020 2020 2020 . │ │ │ │ +0003b9b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ +0003b9d0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = " │ │ │ │ +0003ba00: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;%%(expression)s │ │ │ │ +0003ba40: 2049 5320 4e55 4c4c 2c20 3c2f 7370 616e IS NULL, %s&quo │ │ │ │ +0003ba80: 743b 3c2f 7370 616e 3e20 3c73 7061 6e20 t; % template. < │ │ │ │ +0003bad0: 7370 616e 2063 6c61 7373 3d22 6b22 3e65 span class="k">e │ │ │ │ +0003bae0: 6c69 663c 2f73 7061 6e3e 203c 7370 616e lif self │ │ │ │ +0003bb00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0003bb20: 7370 616e 2063 6c61 7373 3d22 6e22 3e6e span class="n">n │ │ │ │ +0003bb30: 756c 6c73 5f66 6972 7374 3c2f 7370 616e ulls_first and n │ │ │ │ +0003bb70: 6f74 3c2f 7370 616e 3e20 3c73 7061 6e20 ot (. │ │ │ │ +0003bba0: 2020 203c 7370 616e 2063 6c61 7373 3d22 not < │ │ │ │ +0003bbc0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003bbd0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.descending and │ │ │ │ +0003bc30: 203c 7370 616e 2063 6c61 7373 3d22 6e22 connection.featur │ │ │ │ +0003bc80: 6573 3c2f 7370 616e 3e3c 7370 616e 2063 es.order_by_nulls_ │ │ │ │ +0003bcc0: 6669 7273 743c 2f73 7061 6e3e 0a20 2020 first. │ │ │ │ +0003bcd0: 2020 2020 2020 2020 203c 7370 616e 2063 ):. │ │ │ │ +0003bd00: 2020 203c 7370 616e 2063 6c61 7373 3d22 template = &qu │ │ │ │ +0003bd50: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;%%(expression │ │ │ │ +0003bd90: 2973 2049 5320 4e4f 5420 4e55 4c4c 2c20 )s IS NOT NULL, │ │ │ │ +0003bda0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 %s" │ │ │ │ +0003bde0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003bdf0: 253c 2f73 7061 6e3e 203c 7370 616e 2063 % templat │ │ │ │ +0003be10: 653c 2f73 7061 6e3e 0a20 2020 2020 2020 e. │ │ │ │ +0003be20: 203c 7370 616e 2063 6c61 7373 3d22 6e22 connection.ops.chec │ │ │ │ +0003bea0: 6b5f 6578 7072 6573 7369 6f6e 5f73 7570 k_expression_sup │ │ │ │ +0003beb0: 706f 7274 3c2f 7370 616e 3e3c 7370 616e port(self< │ │ │ │ +0003bef0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0003bf00: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0003bf10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003bf20: 6578 7072 6573 7369 6f6e 5f73 716c 3c2f expression_sql, pa │ │ │ │ +0003bf60: 7261 6d73 3c2f 7370 616e 3e20 3c73 7061 rams = compiler.comp │ │ │ │ +0003bfd0: 696c 653c 2f73 7061 6e3e 3c73 7061 6e20 ile(self.< │ │ │ │ +0003c020: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>expression │ │ │ │ +0003c040: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +0003c060: 2020 2020 2020 2020 3c73 7061 6e20 636c placehol │ │ │ │ +0003c080: 6465 7273 3c2f 7370 616e 3e20 3c73 7061 ders = {. │ │ │ │ +0003c0c0: 2020 2020 2020 2020 2020 3c73 7061 6e20 " │ │ │ │ +0003c0e0: 3b65 7870 7265 7373 696f 6e26 7175 6f74 ;expression" │ │ │ │ +0003c0f0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;: │ │ │ │ +0003c110: 203c 7370 616e 2063 6c61 7373 3d22 6e22 expression_sql< │ │ │ │ +0003c130: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ +0003c150: 2020 2020 2020 2020 2020 203c 7370 616e &quo │ │ │ │ +0003c170: 743b 6f72 6465 7269 6e67 2671 756f 743b t;ordering" │ │ │ │ +0003c180: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 : │ │ │ │ +0003c1a0: 3c73 7061 6e20 636c 6173 733d 2273 3222 "DESC" │ │ │ │ +0003c1c0: 3b3c 2f73 7061 6e3e 203c 7370 616e 2063 ; if self< │ │ │ │ +0003c200: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003c210: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 descendin │ │ │ │ +0003c230: 673c 2f73 7061 6e3e 203c 7370 616e 2063 g else "ASC& │ │ │ │ +0003c270: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;,. │ │ │ │ +0003c2a0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 **extra_ │ │ │ │ +0003c2d0: 636f 6e74 6578 743c 2f73 7061 6e3e 3c73 context,< │ │ │ │ +0003c2f0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0003c300: 7370 616e 2063 6c61 7373 3d22 7022 3e7d span class="p">} │ │ │ │ +0003c310: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0003c320: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003c330: 7061 7261 6d73 3c2f 7370 616e 3e20 3c73 params *= │ │ │ │ +0003c350: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c template │ │ │ │ +0003c370: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0003c390: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0003c3a0: 6f75 6e74 3c2f 7370 616e 3e3c 7370 616e ount("%(expression)s │ │ │ │ +0003c400: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 "). │ │ │ │ +0003c440: 2020 2020 2020 3c73 7061 6e20 636c 6173 return (temp │ │ │ │ +0003c490: 6c61 7465 3c2f 7370 616e 3e20 3c73 7061 late % placeholder │ │ │ │ +0003c4d0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s) │ │ │ │ +0003c4f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003c500: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .rstrip(), │ │ │ │ +0003c540: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003c550: 7061 7261 6d73 3c2f 7370 616e 3e0a 0a20 params.. │ │ │ │ +0003c560: 2020 203c 7370 616e 2063 6c61 7373 3d22 def a │ │ │ │ +0003c590: 735f 6f72 6163 6c65 3c2f 7370 616e 3e3c s_oracle< │ │ │ │ +0003c5a0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0003c5b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, comp │ │ │ │ +0003c600: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler, connection):. │ │ │ │ +0003c660: 2020 2020 2020 203c 7370 616e 2063 6c61 # Oracle │ │ │ │ +0003c680: 2064 6f65 736e 2623 3339 3b74 2061 6c6c doesn't all │ │ │ │ +0003c690: 6f77 204f 5244 4552 2042 5920 4558 4953 ow ORDER BY EXIS │ │ │ │ +0003c6a0: 5453 2829 206f 7220 6669 6c74 6572 7320 TS() or filters │ │ │ │ +0003c6b0: 756e 6c65 7373 2069 7426 2333 393b 7320 unless it's │ │ │ │ +0003c6c0: 7772 6170 7065 643c 2f73 7061 6e3e 0a20 wrapped. │ │ │ │ +0003c6d0: 2020 2020 2020 203c 7370 616e 2063 6c61 # in a C │ │ │ │ +0003c6f0: 4153 4520 5748 454e 2e3c 2f73 7061 6e3e ASE WHEN. │ │ │ │ +0003c700: 0a20 2020 2020 2020 203c 7370 616e 2063 . if connection.ops< │ │ │ │ +0003c770: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.co │ │ │ │ +0003c7a0: 6e64 6974 696f 6e61 6c5f 6578 7072 6573 nditional_expres │ │ │ │ +0003c7b0: 7369 6f6e 5f73 7570 706f 7274 6564 5f69 sion_supported_i │ │ │ │ +0003c7c0: 6e5f 7768 6572 655f 636c 6175 7365 3c2f n_where_clause(. │ │ │ │ +0003c7f0: 2020 2020 2020 2020 2020 3c73 7061 6e20 self< │ │ │ │ +0003c810: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ex │ │ │ │ +0003c840: 7072 6573 7369 6f6e 3c2f 7370 616e 3e0a pression. │ │ │ │ +0003c850: 2020 2020 2020 2020 3c73 7061 6e20 636c ):. co │ │ │ │ +0003c890: 7079 3c2f 7370 616e 3e20 3c73 7061 6e20 py = self< │ │ │ │ +0003c8d0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003c8e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 copy(). │ │ │ │ +0003c920: 2020 2020 2020 2020 3c73 7061 6e20 636c copy.expre │ │ │ │ +0003c970: 7373 696f 6e3c 2f73 7061 6e3e 203c 7370 ssion = Case(. │ │ │ │ +0003c9d0: 2020 2020 2020 2020 2020 3c73 7061 6e20 When(se │ │ │ │ +0003ca20: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.expression, then< │ │ │ │ +0003ca90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>=T │ │ │ │ +0003cac0: 7275 653c 2f73 7061 6e3e 3c73 7061 6e20 rue),. │ │ │ │ +0003caf0: 2020 2020 3c73 7061 6e20 636c 6173 733d default=False │ │ │ │ +0003cb40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ,. │ │ │ │ +0003cb60: 2020 2020 2020 2020 2020 2020 3c73 7061 ). │ │ │ │ +0003cb90: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +0003cbb0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0003cbc0: 6f70 793c 2f73 7061 6e3e 3c73 7061 6e20 opy.as_sql< │ │ │ │ +0003cc00: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0003cc10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 compiler< │ │ │ │ +0003cc30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0003cc50: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +0003cc60: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ +0003cc70: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0003cc80: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ +0003cc90: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +0003ccb0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003ccc0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.as_sql │ │ │ │ +0003cd00: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0003cd10: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (compiler │ │ │ │ +0003cd30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +0003cd50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003cd60: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection).. < │ │ │ │ +0003cd90: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +0003cda0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef get_g │ │ │ │ +0003cdc0: 726f 7570 5f62 795f 636f 6c73 3c2f 7370 roup_by_cols(self │ │ │ │ +0003ce00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +0003ce20: 0a20 2020 2020 2020 203c 7370 616e 2063 . cols = [] │ │ │ │ +0003ce70: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0003ce80: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0003ce90: 666f 723c 2f73 7061 6e3e 203c 7370 616e for sourc │ │ │ │ +0003ceb0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e in self │ │ │ │ +0003cef0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003cf00: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .get_sour │ │ │ │ +0003cf20: 6365 5f65 7870 7265 7373 696f 6e73 3c2f ce_expressions():. │ │ │ │ +0003cf50: 2020 2020 2020 2020 2020 2020 3c73 7061 cols │ │ │ │ +0003cf70: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +0003cf90: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ +0003cfa0: 7874 656e 643c 2f73 7061 6e3e 3c73 7061 xtend(source.get_gro │ │ │ │ +0003d010: 7570 5f62 795f 636f 6c73 3c2f 7370 616e up_by_cols()). │ │ │ │ +0003d040: 2020 2020 3c73 7061 6e20 636c 6173 733d return cols.. │ │ │ │ +0003d080: 2020 203c 7370 616e 2063 6c61 7373 3d22 def r │ │ │ │ +0003d0b0: 6576 6572 7365 5f6f 7264 6572 696e 673c everse_ordering< │ │ │ │ +0003d0c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0003d0f0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. sel │ │ │ │ +0003d130: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +0003d150: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003d160: 6465 7363 656e 6469 6e67 3c2f 7370 616e descending = not< │ │ │ │ +0003d1a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.desce │ │ │ │ +0003d1f0: 6e64 696e 673c 2f73 7061 6e3e 0a20 2020 nding. │ │ │ │ +0003d200: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +0003d220: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003d230: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.nulls_first:. │ │ │ │ +0003d290: 2020 2020 2020 2020 2020 3c73 7061 6e20 self< │ │ │ │ +0003d2b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.nu │ │ │ │ +0003d2e0: 6c6c 735f 6c61 7374 3c2f 7370 616e 3e20 lls_last │ │ │ │ +0003d2f0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003d300: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = True. │ │ │ │ +0003d330: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ +0003d360: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>nulls_firs │ │ │ │ +0003d380: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t = None. │ │ │ │ +0003d3c0: 2020 2020 2020 203c 7370 616e 2063 6c61 elif self< │ │ │ │ +0003d400: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003d410: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 nulls_las │ │ │ │ +0003d430: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t: │ │ │ │ +0003d450: 0a20 2020 2020 2020 2020 2020 203c 7370 . se │ │ │ │ +0003d470: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.nulls_first = Tr │ │ │ │ +0003d4e0: 7565 3c2f 7370 616e 3e0a 2020 2020 2020 ue. │ │ │ │ +0003d4f0: 2020 2020 2020 3c73 7061 6e20 636c 6173 self.nulls_ │ │ │ │ +0003d540: 6c61 7374 3c2f 7370 616e 3e20 3c73 7061 last = None. return │ │ │ │ +0003d5a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.. def asc │ │ │ │ +0003d600: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0003d610: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ +0003d650: 2020 2020 2020 3c73 7061 6e20 636c 6173 self.descen │ │ │ │ +0003d6a0: 6469 6e67 3c2f 7370 616e 3e20 3c73 7061 ding = False.. def desc< │ │ │ │ +0003d720: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0003d730: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self):. │ │ │ │ +0003d770: 2020 2020 203c 7370 616e 2063 6c61 7373 self.descend │ │ │ │ +0003d7c0: 696e 673c 2f73 7061 6e3e 203c 7370 616e ing = True │ │ │ │ +0003d800: 0a0a 0a3c 6469 7620 636c 6173 733d 2276 ...
.[documen │ │ │ │ +0003d8a0: 7469 5d3c 2f61 3e0a 3c73 7061 6e20 636c ti].class Window(SQLit │ │ │ │ +0003d910: 654e 756d 6572 6963 4d69 7869 6e3c 2f73 eNumericMixin, Exp │ │ │ │ +0003d950: 7265 7373 696f 6e3c 2f73 7061 6e3e 3c73 ression): │ │ │ │ +0003d970: 3c2f 7370 616e 3e0a 2020 2020 3c73 7061 . temp │ │ │ │ +0003d990: 6c61 7465 3c2f 7370 616e 3e20 3c73 7061 late = "%(expression │ │ │ │ +0003d9f0: 2973 3c2f 7370 616e 3e3c 7370 616e 2063 )s OVER │ │ │ │ +0003da10: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (%(windo │ │ │ │ +0003da30: 7729 733c 2f73 7061 6e3e 3c73 7061 6e20 w)s)&quo │ │ │ │ +0003da50: 743b 3c2f 7370 616e 3e0a 2020 2020 3c73 t;. # │ │ │ │ +0003da70: 2041 6c74 686f 7567 6820 7468 6520 6d61 Although the ma │ │ │ │ +0003da80: 696e 2065 7870 7265 7373 696f 6e20 6d61 in expression ma │ │ │ │ +0003da90: 7920 6569 7468 6572 2062 6520 616e 2061 y either be an a │ │ │ │ +0003daa0: 6767 7265 6761 7465 206f 7220 616e 3c2f ggregate or an. # exp │ │ │ │ +0003dad0: 7265 7373 696f 6e20 7769 7468 2061 6e20 ression with an │ │ │ │ +0003dae0: 6167 6772 6567 6174 6520 6675 6e63 7469 aggregate functi │ │ │ │ +0003daf0: 6f6e 2c20 7468 6520 4752 4f55 5020 4259 on, the GROUP BY │ │ │ │ +0003db00: 2074 6861 7420 7769 6c6c 3c2f 7370 616e that will. # be intr │ │ │ │ +0003db30: 6f64 7563 6564 2069 6e20 7468 6520 7175 oduced in the qu │ │ │ │ +0003db40: 6572 7920 6173 2061 2072 6573 756c 7420 ery as a result │ │ │ │ +0003db50: 6973 206e 6f74 2064 6573 6972 6564 2e3c is not desired.< │ │ │ │ +0003db60: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. conta │ │ │ │ +0003db80: 696e 735f 6167 6772 6567 6174 653c 2f73 ins_aggregate = F │ │ │ │ +0003dbc0: 616c 7365 3c2f 7370 616e 3e0a 2020 2020 alse. │ │ │ │ +0003dbd0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003dbe0: 636f 6e74 6169 6e73 5f6f 7665 725f 636c contains_over_cl │ │ │ │ +0003dbf0: 6175 7365 3c2f 7370 616e 3e20 3c73 7061 ause = True.. def __init__(. │ │ │ │ +0003dc90: 2020 203c 7370 616e 2063 6c61 7373 3d22 self< │ │ │ │ +0003dcb0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +0003dcc0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +0003dcd0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003dce0: 6578 7072 6573 7369 6f6e 3c2f 7370 616e expression,. │ │ │ │ +0003dd10: 2020 3c73 7061 6e20 636c 6173 733d 226e partition_by=No │ │ │ │ +0003dd60: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne,. order_ │ │ │ │ +0003dda0: 6279 3c2f 7370 616e 3e3c 7370 616e 2063 by=None,. fr │ │ │ │ +0003de10: 616d 653c 2f73 7061 6e3e 3c73 7061 6e20 ame=None,< │ │ │ │ +0003de60: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0003de70: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +0003de80: 7574 7075 745f 6669 656c 643c 2f73 7061 utput_field=None< │ │ │ │ +0003dec0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ +0003dee0: 2020 203c 7370 616e 2063 6c61 7373 3d22 ):. │ │ │ │ +0003df00: 2020 2020 203c 7370 616e 2063 6c61 7373 self.partiti │ │ │ │ +0003df50: 6f6e 5f62 793c 2f73 7061 6e3e 203c 7370 on_by = partition_ │ │ │ │ +0003df90: 6279 3c2f 7370 616e 3e0a 2020 2020 2020 by. │ │ │ │ +0003dfa0: 2020 3c73 7061 6e20 636c 6173 733d 2262 self.< │ │ │ │ +0003dfd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>order_by = < │ │ │ │ +0003e010: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +0003e020: 7264 6572 5f62 793c 2f73 7061 6e3e 0a20 rder_by. │ │ │ │ +0003e030: 2020 2020 2020 203c 7370 616e 2063 6c61 self.frame │ │ │ │ +0003e080: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +0003e0a0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 frame.. │ │ │ │ +0003e0c0: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ +0003e0e0: 203c 7370 616e 2063 6c61 7373 3d22 6f77 not ge │ │ │ │ +0003e110: 7461 7474 723c 2f73 7061 6e3e 3c73 7061 tattr(expression, & │ │ │ │ +0003e180: 7175 6f74 3b77 696e 646f 775f 636f 6d70 quot;window_comp │ │ │ │ +0003e190: 6174 6962 6c65 2671 756f 743b 3c2f 7370 atible", Fal │ │ │ │ +0003e1d0: 7365 3c2f 7370 616e 3e3c 7370 616e 2063 se):. < │ │ │ │ +0003e200: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +0003e210: 6169 7365 3c2f 7370 616e 3e20 3c73 7061 aise Val │ │ │ │ +0003e230: 7565 4572 726f 723c 2f73 7061 6e3e 3c73 ueError(< │ │ │ │ +0003e250: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0003e260: 2020 2020 2020 203c 7370 616e 2063 6c61 "Ex │ │ │ │ +0003e280: 7072 6573 7369 6f6e 2026 2333 393b 3c2f pression '%s< │ │ │ │ +0003e2b0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +0003e2c0: 2623 3339 3b20 6973 6e26 2333 393b 7420 ' isn't │ │ │ │ +0003e2d0: 636f 6d70 6174 6962 6c65 2077 6974 6820 compatible with │ │ │ │ +0003e2e0: 4f56 4552 2063 6c61 7573 6573 2e26 7175 OVER clauses.&qu │ │ │ │ +0003e2f0: 6f74 3b3c 2f73 7061 6e3e 0a20 2020 2020 ot;. │ │ │ │ +0003e300: 2020 2020 2020 2020 2020 203c 7370 616e % expression.__ │ │ │ │ +0003e370: 636c 6173 735f 5f3c 2f73 7061 6e3e 3c73 class__.< │ │ │ │ +0003e390: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>__name__< │ │ │ │ +0003e3b0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +0003e3c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 ).. │ │ │ │ +0003e3e0: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ +0003e400: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003e410: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.partition_by< │ │ │ │ +0003e450: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> is not N │ │ │ │ +0003e4a0: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one:. < │ │ │ │ +0003e4d0: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ +0003e4e0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f not isinstance │ │ │ │ +0003e520: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0003e540: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003e550: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.partition_by< │ │ │ │ +0003e590: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0003e5b0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0003e5c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 tuple, li │ │ │ │ +0003e610: 7374 3c2f 7370 616e 3e3c 7370 616e 2063 st)):. │ │ │ │ +0003e640: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +0003e660: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003e670: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .partitio │ │ │ │ +0003e690: 6e5f 6279 3c2f 7370 616e 3e20 3c73 7061 n_by = (se │ │ │ │ +0003e6e0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.partition_by,). │ │ │ │ +0003e740: 2020 2020 2020 2020 2020 3c73 7061 6e20 self< │ │ │ │ +0003e760: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.pa │ │ │ │ +0003e790: 7274 6974 696f 6e5f 6279 3c2f 7370 616e rtition_by = Expre │ │ │ │ +0003e7d0: 7373 696f 6e4c 6973 743c 2f73 7061 6e3e ssionList │ │ │ │ +0003e7e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +0003e7f0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (* │ │ │ │ +0003e810: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.partition_by │ │ │ │ +0003e860: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +0003e880: 0a20 2020 2020 2020 203c 7370 616e 2063 . if self< │ │ │ │ +0003e8c0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003e8d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 order_by< │ │ │ │ +0003e8f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> is not N │ │ │ │ +0003e940: 6f6e 653c 2f73 7061 6e3e 3c73 7061 6e20 one:. < │ │ │ │ +0003e970: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ +0003e980: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f isinst │ │ │ │ +0003e9a0: 616e 6365 3c2f 7370 616e 3e3c 7370 616e ance(self< │ │ │ │ +0003e9e0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003e9f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 order_by< │ │ │ │ +0003ea10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0003ea30: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0003ea40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 list, tup │ │ │ │ +0003ea90: 6c65 3c2f 7370 616e 3e3c 7370 616e 2063 le)):. │ │ │ │ +0003eac0: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +0003eae0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003eaf0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .order_by │ │ │ │ +0003eb10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +0003eb30: 203c 7370 616e 2063 6c61 7373 3d22 6e22 OrderByList(*self< │ │ │ │ +0003eba0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003ebb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 order_by< │ │ │ │ +0003ebd0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ +0003ebf0: 2020 2020 2020 2020 2020 203c 7370 616e elif< │ │ │ │ +0003ec10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> isinstan │ │ │ │ +0003ec30: 6365 3c2f 7370 616e 3e3c 7370 616e 2063 ce(self.order_by, (BaseExpress │ │ │ │ +0003ecf0: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion, str)) │ │ │ │ +0003ed40: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0003ed50: 2020 2020 2020 2020 203c 7370 616e 2063 self.ord │ │ │ │ +0003eda0: 6572 5f62 793c 2f73 7061 6e3e 203c 7370 er_by = OrderByLis │ │ │ │ +0003ede0: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t( │ │ │ │ +0003ee00: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.order_by). │ │ │ │ +0003ee70: 2020 2020 2020 2020 3c73 7061 6e20 636c else:. │ │ │ │ +0003eeb0: 2020 2020 2020 2020 2020 2020 3c73 7061 rais │ │ │ │ +0003eed0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e ValueE │ │ │ │ +0003eef0: 7272 6f72 3c2f 7370 616e 3e3c 7370 616e rror(. │ │ │ │ +0003ef20: 2020 2020 2020 2020 3c73 7061 6e20 636c "W │ │ │ │ +0003ef40: 696e 646f 772e 6f72 6465 725f 6279 206d indow.order_by m │ │ │ │ +0003ef50: 7573 7420 6265 2065 6974 6865 7220 6120 ust be either a │ │ │ │ +0003ef60: 7374 7269 6e67 2072 6566 6572 656e 6365 string reference │ │ │ │ +0003ef70: 2074 6f20 6120 2671 756f 743b 3c2f 7370 to a ". │ │ │ │ +0003ef90: 2020 2020 2020 2020 3c73 7061 6e20 636c "f │ │ │ │ +0003efb0: 6965 6c64 2c20 616e 2065 7870 7265 7373 ield, an express │ │ │ │ +0003efc0: 696f 6e2c 206f 7220 6120 6c69 7374 206f ion, or a list o │ │ │ │ +0003efd0: 7220 7475 706c 6520 6f66 2074 6865 6d2e r tuple of them. │ │ │ │ +0003efe0: 2671 756f 743b 3c2f 7370 616e 3e0a 2020 ". │ │ │ │ +0003eff0: 2020 2020 2020 2020 2020 2020 2020 3c73 )< │ │ │ │ +0003f010: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +0003f020: 7370 616e 2063 6c61 7373 3d22 6e62 223e span class="nb"> │ │ │ │ +0003f030: 7375 7065 723c 2f73 7061 6e3e 3c73 7061 super().__ │ │ │ │ +0003f080: 696e 6974 5f5f 3c2f 7370 616e 3e3c 7370 init__(output_fiel │ │ │ │ +0003f0c0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d= │ │ │ │ +0003f0e0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003f0f0: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field). │ │ │ │ +0003f120: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +0003f140: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +0003f150: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .source_e │ │ │ │ +0003f170: 7870 7265 7373 696f 6e3c 2f73 7061 6e3e xpression │ │ │ │ +0003f180: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = self< │ │ │ │ +0003f1b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>._p │ │ │ │ +0003f1e0: 6172 7365 5f65 7870 7265 7373 696f 6e73 arse_expressions │ │ │ │ +0003f1f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0003f210: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ +0003f220: 7870 7265 7373 696f 6e3c 2f73 7061 6e3e xpression │ │ │ │ 0003f230: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -0003f240: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ -0003f280: 2020 2020 2020 3c73 7061 6e20 636c 6173 return self │ │ │ │ -0003f2c0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003f2d0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .source_e │ │ │ │ -0003f2f0: 7870 7265 7373 696f 6e3c 2f73 7061 6e3e xpression │ │ │ │ -0003f300: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003f310: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .output_f │ │ │ │ -0003f330: 6965 6c64 3c2f 7370 616e 3e0a 0a20 2020 ield.. │ │ │ │ -0003f340: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def get │ │ │ │ -0003f370: 5f73 6f75 7263 655f 6578 7072 6573 7369 _source_expressi │ │ │ │ -0003f380: 6f6e 733c 2f73 7061 6e3e 3c73 7061 6e20 ons(self): │ │ │ │ -0003f3d0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0003f3e0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -0003f3f0: 7265 7475 726e 3c2f 7370 616e 3e20 3c73 return [< │ │ │ │ -0003f410: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.source │ │ │ │ -0003f460: 5f65 7870 7265 7373 696f 6e3c 2f73 7061 _expression, self │ │ │ │ -0003f4a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0003f4c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ -0003f4d0: 6172 7469 7469 6f6e 5f62 793c 2f73 7061 artition_by, self │ │ │ │ -0003f510: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -0003f530: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -0003f540: 7264 6572 5f62 793c 2f73 7061 6e3e 3c73 rder_by,< │ │ │ │ -0003f560: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.frame │ │ │ │ -0003f5b0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ]. │ │ │ │ -0003f5d0: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ -0003f5f0: 3c73 7061 6e20 636c 6173 733d 226e 6622 set_source_expr │ │ │ │ -0003f610: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73 essions(< │ │ │ │ -0003f630: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self, exprs │ │ │ │ -0003f680: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ -0003f6a0: 0a20 2020 2020 2020 203c 7370 616e 2063 . self.sou │ │ │ │ -0003f6f0: 7263 655f 6578 7072 6573 7369 6f6e 3c2f rce_expression, s │ │ │ │ -0003f730: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.partition_by0].. │ │ │ │ +0003f280: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0003f290: 6465 663c 2f73 7061 6e3e 203c 7370 616e def _res │ │ │ │ +0003f2b0: 6f6c 7665 5f6f 7574 7075 745f 6669 656c olve_output_fiel │ │ │ │ +0003f2c0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d( │ │ │ │ +0003f2e0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self):. re │ │ │ │ +0003f330: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn sel │ │ │ │ +0003f350: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +0003f370: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003f380: 736f 7572 6365 5f65 7870 7265 7373 696f source_expressio │ │ │ │ +0003f390: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ +0003f3b0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003f3c0: 6f75 7470 7574 5f66 6965 6c64 3c2f 7370 output_field.. def get_source_ │ │ │ │ +0003f410: 6578 7072 6573 7369 6f6e 733c 2f73 7061 expressions(self< │ │ │ │ +0003f450: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ +0003f470: 2020 2020 2020 2020 3c73 7061 6e20 636c return [s │ │ │ │ +0003f4c0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.source_express │ │ │ │ +0003f500: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion, self< │ │ │ │ +0003f540: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003f550: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 partition │ │ │ │ +0003f570: 5f62 793c 2f73 7061 6e3e 3c73 7061 6e20 _by, self< │ │ │ │ +0003f5b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +0003f5c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 order_by< │ │ │ │ +0003f5e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +0003f600: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003f610: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.frame< │ │ │ │ +0003f650: 7370 616e 2063 6c61 7373 3d22 7022 3e5d span class="p">] │ │ │ │ +0003f660: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ +0003f680: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c set_sou │ │ │ │ +0003f6a0: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ +0003f6b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +0003f6e0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf, exprs< │ │ │ │ +0003f720: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +0003f730: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ +0003f740: 203c 7370 616e 2063 6c61 7373 3d22 6270 self., s │ │ │ │ -0003f7a0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.order_by, self< │ │ │ │ -0003f810: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.fr │ │ │ │ -0003f840: 616d 653c 2f73 7061 6e3e 203c 7370 616e ame = exprs │ │ │ │ -0003f880: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -0003f8a0: 203c 7370 616e 2063 6c61 7373 3d22 6e66 as_sql< │ │ │ │ -0003f8c0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0003f8d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self, comp │ │ │ │ -0003f920: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler, connection, te │ │ │ │ -0003f990: 6d70 6c61 7465 3c2f 7370 616e 3e3c 7370 mplate=None):. │ │ │ │ -0003f9f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 connection.ops< │ │ │ │ -0003fa40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.ch │ │ │ │ -0003fa70: 6563 6b5f 6578 7072 6573 7369 6f6e 5f73 eck_expression_s │ │ │ │ -0003fa80: 7570 706f 7274 3c2f 7370 616e 3e3c 7370 upport(self). │ │ │ │ -0003fae0: 2020 3c73 7061 6e20 636c 6173 733d 226b if not │ │ │ │ -0003fb10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ -0003fb30: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on.features │ │ │ │ -0003fb70: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003fb80: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .supports │ │ │ │ -0003fba0: 5f6f 7665 725f 636c 6175 7365 3c2f 7370 _over_clause:. │ │ │ │ -0003fbd0: 2020 2020 2020 2020 3c73 7061 6e20 636c raise NotSupporte │ │ │ │ -0003fc10: 6445 7272 6f72 3c2f 7370 616e 3e3c 7370 dError("This │ │ │ │ -0003fc50: 2062 6163 6b65 6e64 2064 6f65 7320 6e6f backend does no │ │ │ │ -0003fc60: 7420 7375 7070 6f72 7420 7769 6e64 6f77 t support window │ │ │ │ -0003fc70: 2065 7870 7265 7373 696f 6e73 2e26 7175 expressions.&qu │ │ │ │ -0003fc80: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;). expr_ │ │ │ │ -0003fcc0: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql, params │ │ │ │ -0003fd00: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = compil │ │ │ │ -0003fd30: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er.compile< │ │ │ │ -0003fd70: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -0003fd80: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.sourc │ │ │ │ -0003fdd0: 655f 6578 7072 6573 7369 6f6e 3c2f 7370 e_expression). │ │ │ │ -0003fe00: 2020 2020 3c73 7061 6e20 636c 6173 733d window_sql, wi │ │ │ │ -0003fe50: 6e64 6f77 5f70 6172 616d 733c 2f73 7061 ndow_params = [],< │ │ │ │ -0003fe90: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> () │ │ │ │ -0003feb0: 0a0a 2020 2020 2020 2020 3c73 7061 6e20 .. if self │ │ │ │ -0003fef0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -0003ff00: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .partitio │ │ │ │ -0003ff20: 6e5f 6279 3c2f 7370 616e 3e20 3c73 7061 n_by is< │ │ │ │ -0003ff40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> not None< │ │ │ │ -0003ff80: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ -0003ff90: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -0003ffa0: 2020 2020 3c73 7061 6e20 636c 6173 733d sql_expr, sql_ │ │ │ │ -0003fff0: 7061 7261 6d73 3c2f 7370 616e 3e20 3c73 params =< │ │ │ │ -00040010: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.parti │ │ │ │ -00040060: 7469 6f6e 5f62 793c 2f73 7061 6e3e 3c73 tion_by.< │ │ │ │ -00040080: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>as_sql(. │ │ │ │ -000400c0: 2020 2020 2020 2020 2020 2020 3c73 7061 comp │ │ │ │ -000400e0: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler=compiler,. │ │ │ │ -00040140: 2020 2020 2020 2020 2020 203c 7370 616e conne │ │ │ │ -00040160: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction=connection,. │ │ │ │ -000401c0: 2020 2020 2020 2020 2020 2020 2020 3c73 te │ │ │ │ -000401e0: 6d70 6c61 7465 3c2f 7370 616e 3e3c 7370 mplate="PART │ │ │ │ -00040220: 4954 494f 4e20 4259 203c 2f73 7061 6e3e ITION BY │ │ │ │ -00040230: 3c73 7061 6e20 636c 6173 733d 2273 6922 %(expressions)s │ │ │ │ -00040250: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ",. │ │ │ │ -00040290: 2020 2020 2020 2020 2020 3c73 7061 6e20 ). < │ │ │ │ -000402c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e77 span class="n">w │ │ │ │ -000402d0: 696e 646f 775f 7371 6c3c 2f73 7061 6e3e indow_sql │ │ │ │ -000402e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000402f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .append(sql │ │ │ │ -00040340: 5f65 7870 723c 2f73 7061 6e3e 3c73 7061 _expr). │ │ │ │ -00040370: 203c 7370 616e 2063 6c61 7373 3d22 6e22 window_params += │ │ │ │ -000403b0: 3c73 7061 6e20 636c 6173 733d 226e 6222 tuple(sql_params< │ │ │ │ -00040400: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).. │ │ │ │ -00040420: 2020 2020 2020 2020 3c73 7061 6e20 636c if self.< │ │ │ │ -00040470: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>order_by is │ │ │ │ -000404b0: 203c 7370 616e 2063 6c61 7373 3d22 6f77 not No │ │ │ │ -000404e0: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne:. source_expr │ │ │ │ +0003f790: 6573 7369 6f6e 3c2f 7370 616e 3e3c 7370 ession, self.partit │ │ │ │ +0003f800: 696f 6e5f 6279 3c2f 7370 616e 3e3c 7370 ion_by, self.order_ │ │ │ │ +0003f870: 6279 3c2f 7370 616e 3e3c 7370 616e 2063 by, self.< │ │ │ │ +0003f8c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>frame = expr │ │ │ │ +0003f910: 733c 2f73 7061 6e3e 0a0a 2020 2020 3c73 s.. de │ │ │ │ +0003f930: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f as_sql │ │ │ │ +0003f950: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0003f970: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003f980: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self, compiler, conn │ │ │ │ +0003f9f0: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection, template=No │ │ │ │ +0003fa60: 6e65 3c2f 7370 616e 3e3c 7370 616e 2063 ne):. conne │ │ │ │ +0003faa0: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction.ops.< │ │ │ │ +0003faf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>check_expr │ │ │ │ +0003fb10: 6573 7369 6f6e 5f73 7570 706f 7274 3c2f ession_support(se │ │ │ │ +0003fb50: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf). if not │ │ │ │ +0003fbb0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003fbc0: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection.feature │ │ │ │ +0003fc00: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +0003fc20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003fc30: 7375 7070 6f72 7473 5f6f 7665 725f 636c supports_over_cl │ │ │ │ +0003fc40: 6175 7365 3c2f 7370 616e 3e3c 7370 616e ause:. │ │ │ │ +0003fc70: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +0003fc80: 7261 6973 653c 2f73 7061 6e3e 203c 7370 raise Not │ │ │ │ +0003fca0: 5375 7070 6f72 7465 6445 7272 6f72 3c2f SupportedError(&q │ │ │ │ +0003fce0: 756f 743b 5468 6973 2062 6163 6b65 6e64 uot;This backend │ │ │ │ +0003fcf0: 2064 6f65 7320 6e6f 7420 7375 7070 6f72 does not suppor │ │ │ │ +0003fd00: 7420 7769 6e64 6f77 2065 7870 7265 7373 t window express │ │ │ │ +0003fd10: 696f 6e73 2e26 7175 6f74 3b3c 2f73 7061 ions."). │ │ │ │ +0003fd40: 2020 203c 7370 616e 2063 6c61 7373 3d22 expr_sql, param │ │ │ │ +0003fd90: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = compiler.compile │ │ │ │ +0003fe00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +0003fe20: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +0003fe30: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.source_expres │ │ │ │ +0003fe70: 7369 6f6e 3c2f 7370 616e 3e3c 7370 616e sion). wind │ │ │ │ +0003feb0: 6f77 5f73 716c 3c2f 7370 616e 3e3c 7370 ow_sql, window_par │ │ │ │ +0003fef0: 616d 733c 2f73 7061 6e3e 203c 7370 616e ams = [], < │ │ │ │ +0003ff30: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +0003ff40: 293c 2f73 7061 6e3e 0a0a 2020 2020 2020 ).. │ │ │ │ +0003ff50: 2020 3c73 7061 6e20 636c 6173 733d 226b if sel │ │ │ │ +0003ff80: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +0003ffa0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +0003ffb0: 7061 7274 6974 696f 6e5f 6279 3c2f 7370 partition_by is < │ │ │ │ +0003ffe0: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ +0003fff0: 6e6f 743c 2f73 7061 6e3e 203c 7370 616e not None │ │ │ │ +00040010: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +00040030: 2020 2020 2020 2020 2020 2020 3c73 7061 sql_ │ │ │ │ +00040050: 6578 7072 3c2f 7370 616e 3e3c 7370 616e expr, sql_params = < │ │ │ │ +000400b0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +000400c0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.partition_by< │ │ │ │ +00040100: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.as │ │ │ │ +00040130: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e _sql(. │ │ │ │ +00040160: 2020 2020 3c73 7061 6e20 636c 6173 733d compiler=compi │ │ │ │ +000401b0: 6c65 723c 2f73 7061 6e3e 3c73 7061 6e20 ler,. │ │ │ │ +000401e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 connection=conn │ │ │ │ +00040230: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection,. │ │ │ │ +00040260: 2020 2020 2020 3c73 7061 6e20 636c 6173 template=&q │ │ │ │ +000402b0: 756f 743b 5041 5254 4954 494f 4e20 4259 uot;PARTITION BY │ │ │ │ +000402c0: 203c 2f73 7061 6e3e 3c73 7061 6e20 636c %(expre │ │ │ │ +000402e0: 7373 696f 6e73 2973 3c2f 7370 616e 3e3c ssions)s< │ │ │ │ +000402f0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00040300: 2671 756f 743b 3c2f 7370 616e 3e3c 7370 ",. │ │ │ │ +00040330: 2020 3c73 7061 6e20 636c 6173 733d 2270 ). │ │ │ │ +00040350: 2020 2020 2020 203c 7370 616e 2063 6c61 window_sq │ │ │ │ +00040370: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l. │ │ │ │ +00040390: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000403a0: 6170 7065 6e64 3c2f 7370 616e 3e3c 7370 append(sql_expr). │ │ │ │ +00040400: 2020 2020 2020 2020 203c 7370 616e 2063 window_ │ │ │ │ +00040420: 7061 7261 6d73 3c2f 7370 616e 3e20 3c73 params += │ │ │ │ +00040440: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c tuple(sql │ │ │ │ +00040490: 5f70 6172 616d 733c 2f73 7061 6e3e 3c73 _params)< │ │ │ │ +000404b0: 2f73 7061 6e3e 0a0a 2020 2020 2020 2020 /span>.. │ │ │ │ +000404c0: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ +000404d0: 6966 3c2f 7370 616e 3e20 3c73 7061 6e20 if self< │ │ │ │ +000404f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.or │ │ │ │ -00040520: 6465 725f 7371 6c3c 2f73 7061 6e3e 3c73 der_sql,< │ │ │ │ -00040540: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> order_par │ │ │ │ -00040560: 616d 733c 2f73 7061 6e3e 203c 7370 616e ams = compiler.compi │ │ │ │ -000405d0: 6c65 3c2f 7370 616e 3e3c 7370 616e 2063 le(self.order_by). │ │ │ │ -00040660: 2020 2020 2020 2020 203c 7370 616e 2063 window_ │ │ │ │ -00040680: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql.append< │ │ │ │ -000406c0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -000406d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 order_sql │ │ │ │ -000406f0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -00040710: 2020 2020 2020 2020 2020 2020 3c73 7061 wind │ │ │ │ -00040730: 6f77 5f70 6172 616d 733c 2f73 7061 6e3e ow_params │ │ │ │ -00040740: 203c 7370 616e 2063 6c61 7373 3d22 6f22 += tupl │ │ │ │ -00040770: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ -00040790: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000407a0: 6f72 6465 725f 7061 7261 6d73 3c2f 7370 order_params).. │ │ │ │ -000407d0: 2020 2020 203c 7370 616e 2063 6c61 7373 if < │ │ │ │ -000407f0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00040800: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.frame< │ │ │ │ -00040840: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ -00040850: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00040860: 2020 2020 3c73 7061 6e20 636c 6173 733d frame_sql, fra │ │ │ │ -000408b0: 6d65 5f70 6172 616d 733c 2f73 7061 6e3e me_params │ │ │ │ -000408c0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = compil │ │ │ │ -000408f0: 6572 3c2f 7370 616e 3e3c 7370 616e 2063 er.compile< │ │ │ │ -00040930: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00040940: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.frame │ │ │ │ -00040990: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ -000409b0: 2020 2020 2020 2020 2020 2020 3c73 7061 wind │ │ │ │ -000409d0: 6f77 5f73 716c 3c2f 7370 616e 3e3c 7370 ow_sql.append(frame_ │ │ │ │ -00040a40: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql). < │ │ │ │ -00040a70: 7370 616e 2063 6c61 7373 3d22 6e22 3e77 span class="n">w │ │ │ │ -00040a80: 696e 646f 775f 7061 7261 6d73 3c2f 7370 indow_params += t │ │ │ │ -00040ac0: 7570 6c65 3c2f 7370 616e 3e3c 7370 616e uple(frame_params< │ │ │ │ -00040b00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>).. │ │ │ │ -00040b20: 2020 2020 2020 2020 3c73 7061 6e20 636c template │ │ │ │ -00040b40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ -00040b60: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ -00040b80: 203c 7370 616e 2063 6c61 7373 3d22 6f77 or sel │ │ │ │ -00040bb0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00040bd0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00040be0: 7465 6d70 6c61 7465 3c2f 7370 616e 3e0a template. │ │ │ │ -00040bf0: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ -00040c10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (. │ │ │ │ -00040c30: 2020 2020 2020 2020 2020 2020 3c73 7061 temp │ │ │ │ -00040c50: 6c61 7465 3c2f 7370 616e 3e20 3c73 7061 late % {&q │ │ │ │ -00040ca0: 756f 743b 6578 7072 6573 7369 6f6e 2671 uot;expression&q │ │ │ │ -00040cb0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;: expr_sql, &qu │ │ │ │ -00040d20: 6f74 3b77 696e 646f 7726 7175 6f74 3b3c ot;window"< │ │ │ │ -00040d30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>: < │ │ │ │ -00040d50: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -00040d60: 2671 756f 743b 2026 7175 6f74 3b3c 2f73 " ".join │ │ │ │ -00040da0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00040dc0: 7370 616e 2063 6c61 7373 3d22 6e22 3e77 span class="n">w │ │ │ │ -00040dd0: 696e 646f 775f 7371 6c3c 2f73 7061 6e3e indow_sql │ │ │ │ -00040de0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00040df0: 293c 2f73 7061 6e3e 3c73 7061 6e20 636c ). │ │ │ │ -00040e10: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00040e20: 7374 7269 703c 2f73 7061 6e3e 3c73 7061 strip()}, │ │ │ │ -00040e40: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00040e50: 2020 2020 3c73 7061 6e20 636c 6173 733d (*params, *window_params< │ │ │ │ -00040ef0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>),. │ │ │ │ -00040f10: 2020 2020 2020 2020 3c73 7061 6e20 636c ) │ │ │ │ -00040f30: 0a0a 2020 2020 3c73 7061 6e20 636c 6173 .. def │ │ │ │ -00040f50: 203c 7370 616e 2063 6c61 7373 3d22 6e66 as_sqlite(self< │ │ │ │ -00040fa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00040fc0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00040fd0: 6f6d 7069 6c65 723c 2f73 7061 6e3e 3c73 ompiler,< │ │ │ │ -00040ff0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> connectio │ │ │ │ -00041010: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n):. if isinstance< │ │ │ │ +00040520: 6465 725f 6279 3c2f 7370 616e 3e20 3c73 der_by i │ │ │ │ +00040540: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s not None:. │ │ │ │ +000405a0: 2020 2020 2020 3c73 7061 6e20 636c 6173 order_sql< │ │ │ │ +000405c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +000405e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +000405f0: 7264 6572 5f70 6172 616d 733c 2f73 7061 rder_params = comp │ │ │ │ +00040630: 696c 6572 3c2f 7370 616e 3e3c 7370 616e iler.compile(self.ord │ │ │ │ +000406d0: 6572 5f62 793c 2f73 7061 6e3e 3c73 7061 er_by). │ │ │ │ +00040700: 203c 7370 616e 2063 6c61 7373 3d22 6e22 window_sql.append │ │ │ │ +00040750: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00040770: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +00040780: 7264 6572 5f73 716c 3c2f 7370 616e 3e3c rder_sql< │ │ │ │ +00040790: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +000407a0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +000407b0: 2020 2020 3c73 7061 6e20 636c 6173 733d window_param │ │ │ │ +000407d0: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s += tuple │ │ │ │ +00040810: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00040820: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (order_pa │ │ │ │ +00040840: 7261 6d73 3c2f 7370 616e 3e3c 7370 616e rams).. if< │ │ │ │ +00040880: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.frame │ │ │ │ +000408d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 :. │ │ │ │ +000408f0: 2020 2020 2020 2020 2020 2020 3c73 7061 fram │ │ │ │ +00040910: 655f 7371 6c3c 2f73 7061 6e3e 3c73 7061 e_sql, frame_param │ │ │ │ +00040950: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s = compiler.compile │ │ │ │ +000409c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +000409e0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +000409f0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.frame< │ │ │ │ +00040a30: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +00040a40: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00040a50: 2020 2020 3c73 7061 6e20 636c 6173 733d window_sql.app │ │ │ │ +00040aa0: 656e 643c 2f73 7061 6e3e 3c73 7061 6e20 end(frame_sql). │ │ │ │ +00040b00: 2020 2020 2020 203c 7370 616e 2063 6c61 window_pa │ │ │ │ +00040b20: 7261 6d73 3c2f 7370 616e 3e20 3c73 7061 rams += tuple(frame │ │ │ │ +00040b90: 5f70 6172 616d 733c 2f73 7061 6e3e 3c73 _params)< │ │ │ │ +00040bb0: 2f73 7061 6e3e 0a0a 2020 2020 2020 2020 /span>.. │ │ │ │ +00040bc0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00040bd0: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ +00040be0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00040bf0: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = templat │ │ │ │ +00040c10: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e or self │ │ │ │ +00040c50: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00040c60: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .template │ │ │ │ +00040c80: 3c2f 7370 616e 3e0a 0a20 2020 2020 2020 .. │ │ │ │ +00040c90: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ +00040cb0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00040cc0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00040cd0: 2020 2020 3c73 7061 6e20 636c 6173 733d template % {"expr │ │ │ │ +00040d40: 6573 7369 6f6e 2671 756f 743b 3c2f 7370 ession": expr │ │ │ │ +00040d80: 5f73 716c 3c2f 7370 616e 3e3c 7370 616e _sql, "windo │ │ │ │ +00040dc0: 7726 7175 6f74 3b3c 2f73 7061 6e3e 3c73 w":< │ │ │ │ +00040de0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> " & │ │ │ │ +00040e00: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;.join< │ │ │ │ +00040e40: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00040e50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 window_sq │ │ │ │ +00040e70: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l) │ │ │ │ +00040e90: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00040ea0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .strip()},. │ │ │ │ +00040ee0: 2020 2020 2020 2020 2020 2020 3c73 7061 (*para │ │ │ │ +00040f30: 6d73 3c2f 7370 616e 3e3c 7370 616e 2063 ms, *window │ │ │ │ +00040f80: 5f70 6172 616d 733c 2f73 7061 6e3e 3c73 _params), │ │ │ │ +00040fa0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00040fb0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00040fc0: 293c 2f73 7061 6e3e 0a0a 2020 2020 3c73 ).. de │ │ │ │ +00040fe0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f as_sql │ │ │ │ +00041000: 6974 653c 2f73 7061 6e3e 3c73 7061 6e20 ite(self,< │ │ │ │ +00041050: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> compiler< │ │ │ │ 00041070: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -000410a0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.output_field, fi │ │ │ │ -00041110: 656c 6473 3c2f 7370 616e 3e3c 7370 616e elds.DecimalField< │ │ │ │ -00041150: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -00041170: 2020 2020 2020 2020 2020 2020 3c73 7061 # C │ │ │ │ -00041190: 6173 7469 6e67 2074 6f20 6e75 6d65 7269 asting to numeri │ │ │ │ -000411a0: 6320 6d75 7374 2062 6520 6f75 7473 6964 c must be outsid │ │ │ │ -000411b0: 6520 6f66 2074 6865 2077 696e 646f 7720 e of the window │ │ │ │ -000411c0: 6578 7072 6573 7369 6f6e 2e3c 2f73 7061 expression.. < │ │ │ │ -000411e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -000411f0: 6f70 793c 2f73 7061 6e3e 203c 7370 616e opy = self │ │ │ │ -00041230: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00041240: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .copy(). │ │ │ │ -00041280: 2020 2020 2020 2020 203c 7370 616e 2063 source_ │ │ │ │ -000412a0: 6578 7072 6573 7369 6f6e 733c 2f73 7061 expressions = copy │ │ │ │ -000412e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00041300: 7370 616e 2063 6c61 7373 3d22 6e22 3e67 span class="n">g │ │ │ │ -00041310: 6574 5f73 6f75 7263 655f 6578 7072 6573 et_source_expres │ │ │ │ -00041320: 7369 6f6e 733c 2f73 7061 6e3e 3c73 7061 sions(). │ │ │ │ -00041350: 2020 3c73 7061 6e20 636c 6173 733d 226e source_express │ │ │ │ -00041370: 696f 6e73 3c2f 7370 616e 3e3c 7370 616e ions[0], < │ │ │ │ +00041090: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +000410a0: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ +000410b0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000410c0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ +000410d0: 2020 3c73 7061 6e20 636c 6173 733d 226b if isi │ │ │ │ +00041100: 6e73 7461 6e63 653c 2f73 7061 6e3e 3c73 nstance(< │ │ │ │ +00041120: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.output │ │ │ │ +00041170: 5f66 6965 6c64 3c2f 7370 616e 3e3c 7370 _field, fields.Decim │ │ │ │ +000411e0: 616c 4669 656c 643c 2f73 7061 6e3e 3c73 alField): │ │ │ │ +00041200: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ +00041210: 2020 2020 3c73 7061 6e20 636c 6173 733d # Casting t │ │ │ │ +00041230: 6f20 6e75 6d65 7269 6320 6d75 7374 2062 o numeric must b │ │ │ │ +00041240: 6520 6f75 7473 6964 6520 6f66 2074 6865 e outside of the │ │ │ │ +00041250: 2077 696e 646f 7720 6578 7072 6573 7369 window expressi │ │ │ │ +00041260: 6f6e 2e3c 2f73 7061 6e3e 0a20 2020 2020 on.. │ │ │ │ +00041270: 2020 2020 2020 203c 7370 616e 2063 6c61 copy = sel │ │ │ │ +000412c0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +000412e0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +000412f0: 636f 7079 3c2f 7370 616e 3e3c 7370 616e copy(). │ │ │ │ +00041320: 203c 7370 616e 2063 6c61 7373 3d22 6e22 source_expressi │ │ │ │ +00041340: 6f6e 733c 2f73 7061 6e3e 203c 7370 616e ons = copy< │ │ │ │ +00041380: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00041390: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 get_sourc │ │ │ │ +000413b0: 655f 6578 7072 6573 7369 6f6e 733c 2f73 e_expressions.outp │ │ │ │ -000413f0: 7574 5f66 6965 6c64 3c2f 7370 616e 3e20 ut_field │ │ │ │ -00041400: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00041410: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = fields< │ │ │ │ -00041430: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.Fl │ │ │ │ -00041460: 6f61 7446 6965 6c64 3c2f 7370 616e 3e3c oatField< │ │ │ │ -00041470: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00041480: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -00041490: 2020 2020 203c 7370 616e 2063 6c61 7373 copy │ │ │ │ -000414b0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000414c0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .set_sour │ │ │ │ -000414e0: 6365 5f65 7870 7265 7373 696f 6e73 3c2f ce_expressions(sou │ │ │ │ -00041520: 7263 655f 6578 7072 6573 7369 6f6e 733c rce_expressions< │ │ │ │ -00041530: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ -00041550: 2020 2020 2020 2020 2020 203c 7370 616e retur │ │ │ │ -00041570: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n super< │ │ │ │ -00041590: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(Wi │ │ │ │ -000415c0: 6e64 6f77 3c2f 7370 616e 3e3c 7370 616e ndow, copy< │ │ │ │ -00041600: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00041610: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00041630: 7370 616e 2063 6c61 7373 3d22 6e22 3e61 span class="n">a │ │ │ │ -00041640: 735f 7371 6c69 7465 3c2f 7370 616e 3e3c s_sqlite< │ │ │ │ -00041650: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00041660: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 compiler< │ │ │ │ -00041680: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -000416a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -000416b0: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ -000416c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000416d0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -000416e0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 return < │ │ │ │ -00041700: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00041710: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.as_sql │ │ │ │ -00041750: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00041760: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (compiler │ │ │ │ -00041780: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -000417a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000417b0: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection).. < │ │ │ │ -000417e0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ -000417f0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef __str │ │ │ │ -00041810: 5f5f 3c2f 7370 616e 3e3c 7370 616e 2063 __(self):< │ │ │ │ -00041860: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00041870: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ -00041880: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn &q │ │ │ │ -000418a0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;{} OVER ({}{}{})".format< │ │ │ │ -00041950: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(. │ │ │ │ -00041970: 2020 2020 2020 2020 2020 203c 7370 616e str< │ │ │ │ -00041990: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -000419c0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.source_express │ │ │ │ -00041a00: 696f 6e3c 2f73 7061 6e3e 3c73 7061 6e20 ion),. │ │ │ │ -00041a30: 3c73 7061 6e20 636c 6173 733d 2273 3222 "PARTITION │ │ │ │ -00041a50: 2042 5920 2671 756f 743b 3c2f 7370 616e BY " + str< │ │ │ │ -00041a90: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ -00041ac0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.partition_by) if │ │ │ │ -00041b30: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c self.part │ │ │ │ -00041b80: 6974 696f 6e5f 6279 3c2f 7370 616e 3e20 ition_by │ │ │ │ -00041b90: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00041ba0: 656c 7365 3c2f 7370 616e 3e20 3c73 7061 else &qu │ │ │ │ -00041bc0: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e ot;" │ │ │ │ -00041bd0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00041be0: 2c3c 2f73 7061 6e3e 0a20 2020 2020 2020 ,. │ │ │ │ -00041bf0: 2020 2020 203c 7370 616e 2063 6c61 7373 str │ │ │ │ -00041c10: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00041c20: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self.orde │ │ │ │ -00041c70: 725f 6279 3c2f 7370 616e 3e20 3c73 7061 r_by or< │ │ │ │ -00041c90: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> "&q │ │ │ │ -00041cb0: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;),. │ │ │ │ -00041ce0: 203c 7370 616e 2063 6c61 7373 3d22 6e62 str(self │ │ │ │ -00041d30: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00041d40: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .frame or │ │ │ │ -00041d80: 3c73 7061 6e20 636c 6173 733d 2273 3222 ""),. │ │ │ │ -00041dc0: 2020 2020 2020 3c73 7061 6e20 636c 6173 ).. │ │ │ │ -00041de0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -00041e00: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ -00041e10: 5f5f 7265 7072 5f5f 3c2f 7370 616e 3e3c __repr__< │ │ │ │ -00041e20: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00041e30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self):. │ │ │ │ -00041e70: 2020 2020 203c 7370 616e 2063 6c61 7373 return "<%s< │ │ │ │ -00041ed0: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ -00041ee0: 3a20 3c2f 7370 616e 3e3c 7370 616e 2063 : %s>" % < │ │ │ │ -00041f40: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -00041f50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 self.__cl │ │ │ │ -00041fa0: 6173 735f 5f3c 2f73 7061 6e3e 3c73 7061 ass__.__name__, se │ │ │ │ -00042010: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf).. def get_group_by_ │ │ │ │ -00042070: 636f 6c73 3c2f 7370 616e 3e3c 7370 616e cols(self< │ │ │ │ -000420b0: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -000420c0: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -000420d0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 group_by_cols = < │ │ │ │ -00042110: 7370 616e 2063 6c61 7373 3d22 7022 3e5b span class="p">[ │ │ │ │ -00042120: 5d3c 2f73 7061 6e3e 0a20 2020 2020 2020 ]. │ │ │ │ -00042130: 203c 7370 616e 2063 6c61 7373 3d22 6b22 if self │ │ │ │ -00042160: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00042180: 7370 616e 2063 6c61 7373 3d22 6e22 3e70 span class="n">p │ │ │ │ -00042190: 6172 7469 7469 6f6e 5f62 793c 2f73 7061 artition_by:. │ │ │ │ -000421c0: 2020 2020 2020 203c 7370 616e 2063 6c61 group_by_ │ │ │ │ -000421e0: 636f 6c73 3c2f 7370 616e 3e3c 7370 616e cols.extend │ │ │ │ -00042220: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00042230: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self.part │ │ │ │ -00042280: 6974 696f 6e5f 6279 3c2f 7370 616e 3e3c ition_by< │ │ │ │ -00042290: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -000422a0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 get_group │ │ │ │ -000422c0: 5f62 795f 636f 6c73 3c2f 7370 616e 3e3c _by_cols< │ │ │ │ -000422d0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ -000422e0: 2929 3c2f 7370 616e 3e0a 2020 2020 2020 )). │ │ │ │ -000422f0: 2020 3c73 7061 6e20 636c 6173 733d 226b if sel │ │ │ │ -00042320: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00042340: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00042350: 6f72 6465 725f 6279 3c2f 7370 616e 3e20 order_by │ │ │ │ -00042360: 3c73 7061 6e20 636c 6173 733d 226f 7722 is not< │ │ │ │ -00042390: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> None:. │ │ │ │ -000423d0: 2020 2020 2020 2020 3c73 7061 6e20 636c group_by │ │ │ │ -000423f0: 5f63 6f6c 733c 2f73 7061 6e3e 3c73 7061 _cols.extend(self.ord │ │ │ │ -00042490: 6572 5f62 793c 2f73 7061 6e3e 3c73 7061 er_by.get_group_by │ │ │ │ -000424d0: 5f63 6f6c 733c 2f73 7061 6e3e 3c73 7061 _cols())< │ │ │ │ -000424f0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00042500: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ -00042510: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn gro │ │ │ │ -00042530: 7570 5f62 795f 636f 6c73 3c2f 7370 616e up_by_cols
....class │ │ │ │ -00042560: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c WindowF │ │ │ │ -00042580: 7261 6d65 3c2f 7370 616e 3e3c 7370 616e rame(Expression):. │ │ │ │ -000425f0: 2020 3c2f 7370 616e 3e3c 7370 616e 2063 " │ │ │ │ -00042610: 2671 756f 743b 2671 756f 743b 3c2f 7370 "". Model t │ │ │ │ -00042640: 6865 2066 7261 6d65 2063 6c61 7573 6520 he frame clause │ │ │ │ -00042650: 696e 2077 696e 646f 7720 6578 7072 6573 in window expres │ │ │ │ -00042660: 7369 6f6e 732e 2054 6865 7265 2061 7265 sions. There are │ │ │ │ -00042670: 2074 776f 2074 7970 6573 206f 6620 6672 two types of fr │ │ │ │ -00042680: 616d 653c 2f73 7061 6e3e 0a3c 7370 616e ame. │ │ │ │ -000426a0: 636c 6175 7365 7320 7768 6963 6820 6172 clauses which ar │ │ │ │ -000426b0: 6520 7375 6263 6c61 7373 6573 2c20 686f e subclasses, ho │ │ │ │ -000426c0: 7765 7665 722c 2061 6c6c 2070 726f 6365 wever, all proce │ │ │ │ -000426d0: 7373 696e 6720 616e 6420 7661 6c69 6461 ssing and valida │ │ │ │ -000426e0: 7469 6f6e 2028 6279 206e 6f3c 2f73 7061 tion (by no. means in │ │ │ │ -00042710: 7465 6e64 6564 2074 6f20 6265 2063 6f6d tended to be com │ │ │ │ -00042720: 706c 6574 6529 2069 7320 646f 6e65 2068 plete) is done h │ │ │ │ -00042730: 6572 652e 2054 6875 732c 2070 726f 7669 ere. Thus, provi │ │ │ │ -00042740: 6469 6e67 2061 6e20 656e 6420 666f 7220 ding an end for │ │ │ │ -00042750: 613c 2f73 7061 6e3e 0a3c 7370 616e 2063 a. fr │ │ │ │ -00042770: 616d 6520 6973 206f 7074 696f 6e61 6c20 ame is optional │ │ │ │ -00042780: 2874 6865 2064 6566 6175 6c74 2069 7320 (the default is │ │ │ │ -00042790: 554e 424f 554e 4445 4420 464f 4c4c 4f57 UNBOUNDED FOLLOW │ │ │ │ -000427a0: 494e 472c 2077 6869 6368 2069 7320 7468 ING, which is th │ │ │ │ -000427b0: 6520 6c61 7374 3c2f 7370 616e 3e0a 3c73 e last. │ │ │ │ -000427d0: 2020 2072 6f77 2069 6e20 7468 6520 6672 row in the fr │ │ │ │ -000427e0: 616d 6529 2e3c 2f73 7061 6e3e 0a3c 7370 ame).. │ │ │ │ -00042800: 2020 2671 756f 743b 2671 756f 743b 2671 ""&q │ │ │ │ -00042810: 756f 743b 3c2f 7370 616e 3e0a 0a20 2020 uot;.. │ │ │ │ -00042820: 203c 7370 616e 2063 6c61 7373 3d22 6e22 template │ │ │ │ -00042840: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = " │ │ │ │ -00042870: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;%(frame │ │ │ │ -00042890: 5f74 7970 6529 733c 2f73 7061 6e3e 3c73 _type)s │ │ │ │ -000428b0: 4245 5457 4545 4e20 3c2f 7370 616e 3e3c BETWEEN < │ │ │ │ -000428c0: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -000428d0: 2528 7374 6172 7429 733c 2f73 7061 6e3e %(start)s │ │ │ │ -000428e0: 3c73 7061 6e20 636c 6173 733d 2273 3222 AND %( │ │ │ │ -00042910: 656e 6429 733c 2f73 7061 6e3e 3c73 7061 end)s&qu │ │ │ │ -00042930: 6f74 3b3c 2f73 7061 6e3e 0a0a 2020 2020 ot;.. │ │ │ │ -00042940: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00042950: 6465 663c 2f73 7061 6e3e 203c 7370 616e def __in │ │ │ │ -00042970: 6974 5f5f 3c2f 7370 616e 3e3c 7370 616e it__(self< │ │ │ │ -000429b0: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -000429c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c start=Non │ │ │ │ -00042a10: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e, │ │ │ │ -00042a30: 203c 7370 616e 2063 6c61 7373 3d22 6e22 end=None< │ │ │ │ -00042a80: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00042a90: 3a3c 2f73 7061 6e3e 0a20 2020 2020 2020 :. │ │ │ │ -00042aa0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.start = Value │ │ │ │ -00042b20: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ -00042b40: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -00042b50: 7461 7274 3c2f 7370 616e 3e3c 7370 616e tart). sel │ │ │ │ -00042b90: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00042bb0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00042bc0: 656e 643c 2f73 7061 6e3e 203c 7370 616e end = Value │ │ │ │ -00042c00: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00042c10: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (end).. │ │ │ │ -00042c50: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00042c60: 6465 663c 2f73 7061 6e3e 203c 7370 616e def set_ │ │ │ │ -00042c80: 736f 7572 6365 5f65 7870 7265 7373 696f source_expressio │ │ │ │ -00042c90: 6e73 3c2f 7370 616e 3e3c 7370 616e 2063 ns(self, exprs):. │ │ │ │ -00042d20: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ -00042d40: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00042d50: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .start, se │ │ │ │ -00042da0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.end = exprs.. def get_source_ex │ │ │ │ -00042e50: 7072 6573 7369 6f6e 733c 2f73 7061 6e3e pressions │ │ │ │ -00042e60: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00042e70: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ -00042eb0: 2020 2020 2020 3c73 7061 6e20 636c 6173 return [sel │ │ │ │ -00042f00: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00042f20: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00042f30: 7374 6172 743c 2f73 7061 6e3e 3c73 7061 start, self.end].. │ │ │ │ -00042fc0: 203c 7370 616e 2063 6c61 7373 3d22 6b22 def as_ │ │ │ │ -00042ff0: 7371 6c3c 2f73 7061 6e3e 3c73 7061 6e20 sql(self,< │ │ │ │ -00043040: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> compiler< │ │ │ │ -00043060: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -00043080: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ -00043090: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ -000430a0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000430b0: 293a 3c2f 7370 616e 3e0a 2020 2020 2020 ):. │ │ │ │ -000430c0: 2020 3c73 7061 6e20 636c 6173 733d 226e connection.ops.che │ │ │ │ -00043140: 636b 5f65 7870 7265 7373 696f 6e5f 7375 ck_expression_su │ │ │ │ -00043150: 7070 6f72 743c 2f73 7061 6e3e 3c73 7061 pport(self │ │ │ │ -00043190: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000431a0: 293c 2f73 7061 6e3e 0a20 2020 2020 2020 ). │ │ │ │ -000431b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 start, end │ │ │ │ -00043200: 203c 7370 616e 2063 6c61 7373 3d22 6f22 = self< │ │ │ │ -00043230: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.wi │ │ │ │ -00043260: 6e64 6f77 5f66 7261 6d65 5f73 7461 7274 ndow_frame_start │ │ │ │ -00043270: 5f65 6e64 3c2f 7370 616e 3e3c 7370 616e _end(. │ │ │ │ -000432a0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000432b0: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection, self< │ │ │ │ -000432f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.st │ │ │ │ -00043320: 6172 743c 2f73 7061 6e3e 3c73 7061 6e20 art.value,< │ │ │ │ -00043370: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.end.val │ │ │ │ -000433f0: 7565 3c2f 7370 616e 3e0a 2020 2020 2020 ue. │ │ │ │ -00043400: 2020 3c73 7061 6e20 636c 6173 733d 2270 ). │ │ │ │ -00043420: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ -00043440: 203c 7370 616e 2063 6c61 7373 3d22 7022 (. │ │ │ │ -00043460: 2020 2020 2020 3c73 7061 6e20 636c 6173 self.templa │ │ │ │ -000434b0: 7465 3c2f 7370 616e 3e0a 2020 2020 2020 te. │ │ │ │ -000434c0: 2020 2020 2020 3c73 7061 6e20 636c 6173 % < │ │ │ │ -000434e0: 7370 616e 2063 6c61 7373 3d22 7022 3e7b span class="p">{ │ │ │ │ -000434f0: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00043500: 2020 2020 2020 2020 3c73 7061 6e20 636c "f │ │ │ │ -00043520: 7261 6d65 5f74 7970 6526 7175 6f74 3b3c rame_type"< │ │ │ │ -00043530: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>: < │ │ │ │ -00043550: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ -00043560: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.frame_type,. │ │ │ │ -000435c0: 2020 2020 2020 2020 2020 2020 203c 7370 &q │ │ │ │ -000435e0: 756f 743b 7374 6172 7426 7175 6f74 3b3c uot;start"< │ │ │ │ -000435f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>: < │ │ │ │ -00043610: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ -00043620: 7461 7274 3c2f 7370 616e 3e3c 7370 616e tart,. │ │ │ │ -00043650: 2020 2020 3c73 7061 6e20 636c 6173 733d "end&q │ │ │ │ -00043670: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;: end,< │ │ │ │ -000436c0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -000436d0: 2020 203c 7370 616e 2063 6c61 7373 3d22 },. │ │ │ │ -000436f0: 2020 2020 2020 2020 203c 7370 616e 2063 [],. ).. def __repr__(se │ │ │ │ -000437a0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf):. retur │ │ │ │ -000437e0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n " │ │ │ │ -00043800: 266c 743b 3c2f 7370 616e 3e3c 7370 616e <%s(). │ │ │ │ +000413e0: 2020 2020 2020 2020 2020 3c73 7061 6e20 source │ │ │ │ +00041400: 5f65 7870 7265 7373 696f 6e73 3c2f 7370 _expressions[0].output_field │ │ │ │ +00041490: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c = │ │ │ │ +000414b0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 fields.< │ │ │ │ +000414e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>FloatField │ │ │ │ +00041500: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 () │ │ │ │ +00041520: 0a20 2020 2020 2020 2020 2020 203c 7370 . cop │ │ │ │ +00041540: 793c 2f73 7061 6e3e 3c73 7061 6e20 636c y. │ │ │ │ +00041560: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00041570: 7365 745f 736f 7572 6365 5f65 7870 7265 set_source_expre │ │ │ │ +00041580: 7373 696f 6e73 3c2f 7370 616e 3e3c 7370 ssions(source_expr │ │ │ │ +000415c0: 6573 7369 6f6e 733c 2f73 7061 6e3e 3c73 essions)< │ │ │ │ +000415e0: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +000415f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ +00041610: 203c 7370 616e 2063 6c61 7373 3d22 6e62 super(< │ │ │ │ +00041640: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>Window, copy │ │ │ │ +00041690: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 )< │ │ │ │ +000416b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +000416c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 as_sqlite │ │ │ │ +000416e0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00041700: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00041710: 6f6d 7069 6c65 723c 2f73 7061 6e3e 3c73 ompiler,< │ │ │ │ +00041730: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> connectio │ │ │ │ +00041750: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n) │ │ │ │ +00041770: 0a20 2020 2020 2020 203c 7370 616e 2063 . return< │ │ │ │ +00041790: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.as_sq │ │ │ │ +000417e0: 6c3c 2f73 7061 6e3e 3c73 7061 6e20 636c l( │ │ │ │ +00041800: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00041810: 636f 6d70 696c 6572 3c2f 7370 616e 3e3c compiler< │ │ │ │ +00041820: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ +00041830: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ +00041850: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on).. def __str__(self):. │ │ │ │ +00041900: 2020 2020 2020 203c 7370 616e 2063 6c61 return "{} O │ │ │ │ +00041970: 5645 5220 283c 2f73 7061 6e3e 3c73 7061 VER ({}{ │ │ │ │ +00041990: 7d7b 7d3c 2f73 7061 6e3e 3c73 7061 6e20 }{})&quo │ │ │ │ +000419b0: 743b 3c2f 7370 616e 3e3c 7370 616e 2063 t;.format(< │ │ │ │ +00041a00: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ +00041a10: 2020 203c 7370 616e 2063 6c61 7373 3d22 str(< │ │ │ │ +00041a40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.source │ │ │ │ +00041a90: 5f65 7870 7265 7373 696f 6e3c 2f73 7061 _expression),. │ │ │ │ +00041ac0: 2020 2020 2020 2020 3c73 7061 6e20 636c "P │ │ │ │ +00041ae0: 4152 5449 5449 4f4e 2042 5920 2671 756f ARTITION BY &quo │ │ │ │ +00041af0: 743b 3c2f 7370 616e 3e20 3c73 7061 6e20 t; + str(< │ │ │ │ +00041b40: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.partit │ │ │ │ +00041b90: 696f 6e5f 6279 3c2f 7370 616e 3e3c 7370 ion_by) if │ │ │ │ +00041bd0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.partition_by │ │ │ │ +00041c20: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c else "" │ │ │ │ +00041c60: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;, │ │ │ │ +00041c80: 0a20 2020 2020 2020 2020 2020 203c 7370 . st │ │ │ │ +00041ca0: 723c 2f73 7061 6e3e 3c73 7061 6e20 636c r( │ │ │ │ +00041cc0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.order_by or < │ │ │ │ +00041d30: 7370 616e 2063 6c61 7373 3d22 7332 223e span class="s2"> │ │ │ │ +00041d40: 2671 756f 743b 2671 756f 743b 3c2f 7370 ""),. │ │ │ │ +00041d70: 2020 2020 2020 2020 203c 7370 616e 2063 str(sel │ │ │ │ +00041dc0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +00041de0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00041df0: 6672 616d 653c 2f73 7061 6e3e 203c 7370 frame or │ │ │ │ +00041e10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c "& │ │ │ │ +00041e30: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;),. )< │ │ │ │ +00041e70: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ +00041e90: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> __repr__ │ │ │ │ +00041eb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 (< │ │ │ │ +00041ed0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00041ee0: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self):. ret │ │ │ │ +00041f20: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn &quo │ │ │ │ +00041f40: 743b 266c 743b 3c2f 7370 616e 3e3c 7370 t;<%s │ │ │ │ +00041f60: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 : %s> │ │ │ │ +00041fb0: 2671 756f 743b 3c2f 7370 616e 3e20 3c73 " %< │ │ │ │ +00041fd0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> (< │ │ │ │ +00041ff0: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00042000: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.__class__.__n │ │ │ │ +00042070: 616d 655f 5f3c 2f73 7061 6e3e 3c73 7061 ame__, self).. < │ │ │ │ +000420d0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +000420e0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef get_g │ │ │ │ +00042100: 726f 7570 5f62 795f 636f 6c73 3c2f 7370 roup_by_cols(self │ │ │ │ +00042140: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +00042160: 0a20 2020 2020 2020 203c 7370 616e 2063 . group_b │ │ │ │ +00042180: 795f 636f 6c73 3c2f 7370 616e 3e20 3c73 y_cols =< │ │ │ │ +000421a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> [] │ │ │ │ +000421c0: 0a20 2020 2020 2020 203c 7370 616e 2063 . if self< │ │ │ │ +00042200: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00042210: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 partition │ │ │ │ +00042230: 5f62 793c 2f73 7061 6e3e 3c73 7061 6e20 _by:. < │ │ │ │ +00042260: 7370 616e 2063 6c61 7373 3d22 6e22 3e67 span class="n">g │ │ │ │ +00042270: 726f 7570 5f62 795f 636f 6c73 3c2f 7370 roup_by_cols.exten │ │ │ │ +000422b0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d( │ │ │ │ +000422d0: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.partition_by │ │ │ │ +00042320: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00042340: 7370 616e 2063 6c61 7373 3d22 6e22 3e67 span class="n">g │ │ │ │ +00042350: 6574 5f67 726f 7570 5f62 795f 636f 6c73 et_group_by_cols │ │ │ │ +00042360: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ()). if self │ │ │ │ +000423c0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000423d0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .order_by │ │ │ │ +000423f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c is not < │ │ │ │ +00042430: 7370 616e 2063 6c61 7373 3d22 6b63 223e span class="kc"> │ │ │ │ +00042440: 4e6f 6e65 3c2f 7370 616e 3e3c 7370 616e None:. │ │ │ │ +00042470: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00042480: 6772 6f75 705f 6279 5f63 6f6c 733c 2f73 group_by_cols.exte │ │ │ │ +000424c0: 6e64 3c2f 7370 616e 3e3c 7370 616e 2063 nd(self.order_by.get_ │ │ │ │ +00042560: 6772 6f75 705f 6279 5f63 6f6c 733c 2f73 group_by_cols()). │ │ │ │ +00042590: 2020 2020 2020 203c 7370 616e 2063 6c61 return group_by_co │ │ │ │ +000425d0: 6c73 3c2f 7370 616e 3e3c 2f64 6976 3e0a ls
. │ │ │ │ +000425e0: 0a0a 0a3c 7370 616e 2063 6c61 7373 3d22 ...class │ │ │ │ +00042600: 3c73 7061 6e20 636c 6173 733d 226e 6322 WindowFrame(Expre │ │ │ │ +00042650: 7373 696f 6e3c 2f73 7061 6e3e 3c73 7061 ssion):. ""&q │ │ │ │ +000426b0: 756f 743b 3c2f 7370 616e 3e0a 3c73 7061 uot;. │ │ │ │ +000426d0: 204d 6f64 656c 2074 6865 2066 7261 6d65 Model the frame │ │ │ │ +000426e0: 2063 6c61 7573 6520 696e 2077 696e 646f clause in windo │ │ │ │ +000426f0: 7720 6578 7072 6573 7369 6f6e 732e 2054 w expressions. T │ │ │ │ +00042700: 6865 7265 2061 7265 2074 776f 2074 7970 here are two typ │ │ │ │ +00042710: 6573 206f 6620 6672 616d 653c 2f73 7061 es of frame. clauses │ │ │ │ +00042740: 7768 6963 6820 6172 6520 7375 6263 6c61 which are subcla │ │ │ │ +00042750: 7373 6573 2c20 686f 7765 7665 722c 2061 sses, however, a │ │ │ │ +00042760: 6c6c 2070 726f 6365 7373 696e 6720 616e ll processing an │ │ │ │ +00042770: 6420 7661 6c69 6461 7469 6f6e 2028 6279 d validation (by │ │ │ │ +00042780: 206e 6f3c 2f73 7061 6e3e 0a3c 7370 616e no. │ │ │ │ +000427a0: 6d65 616e 7320 696e 7465 6e64 6564 2074 means intended t │ │ │ │ +000427b0: 6f20 6265 2063 6f6d 706c 6574 6529 2069 o be complete) i │ │ │ │ +000427c0: 7320 646f 6e65 2068 6572 652e 2054 6875 s done here. Thu │ │ │ │ +000427d0: 732c 2070 726f 7669 6469 6e67 2061 6e20 s, providing an │ │ │ │ +000427e0: 656e 6420 666f 7220 613c 2f73 7061 6e3e end for a │ │ │ │ +000427f0: 0a3c 7370 616e 2063 6c61 7373 3d22 7364 . frame is o │ │ │ │ +00042810: 7074 696f 6e61 6c20 2874 6865 2064 6566 ptional (the def │ │ │ │ +00042820: 6175 6c74 2069 7320 554e 424f 554e 4445 ault is UNBOUNDE │ │ │ │ +00042830: 4420 464f 4c4c 4f57 494e 472c 2077 6869 D FOLLOWING, whi │ │ │ │ +00042840: 6368 2069 7320 7468 6520 6c61 7374 3c2f ch is the last. row i │ │ │ │ +00042870: 6e20 7468 6520 6672 616d 6529 2e3c 2f73 n the frame).. " │ │ │ │ +000428a0: 2671 756f 743b 2671 756f 743b 3c2f 7370 "".. templat │ │ │ │ +000428d0: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e = " │ │ │ │ +00042910: 3c73 7061 6e20 636c 6173 733d 2273 6922 %(frame_type)s< │ │ │ │ +00042930: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span> BETWEEN │ │ │ │ +00042950: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 %(start) │ │ │ │ +00042970: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s AND %(end)s".. def __init__(self │ │ │ │ +00042a40: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00042a60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00042a70: 7374 6172 743c 2f73 7061 6e3e 3c73 7061 start=None │ │ │ │ +00042ab0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00042ac0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , end=None │ │ │ │ +00042b10: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ): │ │ │ │ +00042b30: 0a20 2020 2020 2020 203c 7370 616e 2063 . self.sta │ │ │ │ +00042b80: 7274 3c2f 7370 616e 3e20 3c73 7061 6e20 rt = Value< │ │ │ │ +00042bc0: 7370 616e 2063 6c61 7373 3d22 7022 3e28 span class="p">( │ │ │ │ +00042bd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 start). │ │ │ │ +00042c10: 2020 2020 3c73 7061 6e20 636c 6173 733d self │ │ │ │ +00042c30: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00042c40: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .end = Valu │ │ │ │ +00042c90: 653c 2f73 7061 6e3e 3c73 7061 6e20 636c e( │ │ │ │ +00042cb0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00042cc0: 656e 643c 2f73 7061 6e3e 3c73 7061 6e20 end).. def set_source_e │ │ │ │ +00042d20: 7870 7265 7373 696f 6e73 3c2f 7370 616e xpressions(self, ex │ │ │ │ +00042d90: 7072 733c 2f73 7061 6e3e 3c73 7061 6e20 prs):. sel │ │ │ │ +00042dd0: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ +00042df0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00042e00: 7374 6172 743c 2f73 7061 6e3e 3c73 7061 start, self.end = exp │ │ │ │ +00042ea0: 7273 3c2f 7370 616e 3e0a 0a20 2020 203c rs.. < │ │ │ │ +00042eb0: 7370 616e 2063 6c61 7373 3d22 6b22 3e64 span class="k">d │ │ │ │ +00042ec0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef get_s │ │ │ │ +00042ee0: 6f75 7263 655f 6578 7072 6573 7369 6f6e ource_expression │ │ │ │ +00042ef0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s( │ │ │ │ +00042f10: 3c73 7061 6e20 636c 6173 733d 2262 7022 self):. re │ │ │ │ +00042f60: 7475 726e 3c2f 7370 616e 3e20 3c73 7061 turn [self │ │ │ │ +00042fa0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00042fb0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .start, se │ │ │ │ +00043000: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.end].. def as_sql(self< │ │ │ │ +000430c0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +000430e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +000430f0: 6f6d 7069 6c65 723c 2f73 7061 6e3e 3c73 ompiler,< │ │ │ │ +00043110: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> connectio │ │ │ │ +00043130: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n):. connec │ │ │ │ +00043170: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion.ops.check_expre │ │ │ │ +000431e0: 7373 696f 6e5f 7375 7070 6f72 743c 2f73 ssion_support(sel │ │ │ │ +00043220: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f) │ │ │ │ +00043240: 0a20 2020 2020 2020 203c 7370 616e 2063 . start, en │ │ │ │ +00043290: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d = self.< │ │ │ │ +000432e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>window_fra │ │ │ │ +00043300: 6d65 5f73 7461 7274 5f65 6e64 3c2f 7370 me_start_end(. │ │ │ │ +00043330: 2020 2020 2020 2020 3c73 7061 6e20 636c connecti │ │ │ │ +00043350: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on, self.< │ │ │ │ +000433a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>start.value< │ │ │ │ +000433f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00043410: 7370 616e 2063 6c61 7373 3d22 6270 223e span class="bp"> │ │ │ │ +00043420: 7365 6c66 3c2f 7370 616e 3e3c 7370 616e self.end.value. ). retur │ │ │ │ +000434d0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n (. s │ │ │ │ +00043510: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.template. %< │ │ │ │ +00043570: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> {. │ │ │ │ +00043590: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000435a0: 3c73 7061 6e20 636c 6173 733d 2273 3222 "frame_typ │ │ │ │ +000435c0: 6526 7175 6f74 3b3c 2f73 7061 6e3e 3c73 e":< │ │ │ │ +000435e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> self.frame │ │ │ │ +00043630: 5f74 7970 653c 2f73 7061 6e3e 3c73 7061 _type,. │ │ │ │ +00043660: 2020 2020 203c 7370 616e 2063 6c61 7373 "star │ │ │ │ +00043680: 7426 7175 6f74 3b3c 2f73 7061 6e3e 3c73 t":< │ │ │ │ +000436a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> start,. │ │ │ │ +000436e0: 2020 2020 2020 2020 2020 2020 3c73 7061 &qu │ │ │ │ +00043700: 6f74 3b65 6e64 2671 756f 743b 3c2f 7370 ot;end": end< │ │ │ │ +00043740: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>,. │ │ │ │ +00043760: 2020 2020 2020 2020 2020 203c 7370 616e },. │ │ │ │ +00043790: 203c 7370 616e 2063 6c61 7373 3d22 7022 [],. │ │ │ │ +000437b0: 2020 2020 3c73 7061 6e20 636c 6173 733d ).. │ │ │ │ +000437d0: 2020 3c73 7061 6e20 636c 6173 733d 226b def __ │ │ │ │ +00043800: 7265 7072 5f5f 3c2f 7370 616e 3e3c 7370 repr__(: < │ │ │ │ -00043840: 7370 616e 2063 6c61 7373 3d22 7369 223e span class="si"> │ │ │ │ -00043850: 2573 3c2f 7370 616e 3e3c 7370 616e 2063 %s>&q │ │ │ │ -00043870: 756f 743b 3c2f 7370 616e 3e20 3c73 7061 uot; % (se │ │ │ │ -000438c0: 6c66 3c2f 7370 616e 3e3c 7370 616e 2063 lf.__class__.__nam │ │ │ │ -00043930: 655f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 e__, self< │ │ │ │ -00043970: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00043980: 3c2f 7370 616e 3e0a 0a20 2020 203c 7370 .. def │ │ │ │ -000439a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c get_gro │ │ │ │ -000439c0: 7570 5f62 795f 636f 6c73 3c2f 7370 616e up_by_cols(self):. │ │ │ │ -00043a20: 2020 2020 2020 203c 7370 616e 2063 6c61 return [].. │ │ │ │ -00043a60: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ -00043a80: 7370 616e 2063 6c61 7373 3d22 666d 223e span class="fm"> │ │ │ │ -00043a90: 5f5f 7374 725f 5f3c 2f73 7061 6e3e 3c73 __str__(< │ │ │ │ -00043ab0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self):. │ │ │ │ -00043af0: 2020 2020 3c73 7061 6e20 636c 6173 733d if s │ │ │ │ -00043b20: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.start.< │ │ │ │ -00043b70: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>value is n │ │ │ │ -00043bc0: 6f74 3c2f 7370 616e 3e20 3c73 7061 6e20 ot None< │ │ │ │ -00043be0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> and self< │ │ │ │ -00043c20: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00043c30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 start.value │ │ │ │ -00043c80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c < 0:. │ │ │ │ -00043ce0: 2020 3c73 7061 6e20 636c 6173 733d 226e start < │ │ │ │ -00043d00: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ -00043d10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c "< │ │ │ │ -00043d30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>%d │ │ │ │ -00043d50: 3c73 7061 6e20 636c 6173 733d 2273 3222 %s" % (abs(< │ │ │ │ -00043e00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self.start< │ │ │ │ -00043e50: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.va │ │ │ │ -00043e80: 6c75 653c 2f73 7061 6e3e 3c73 7061 6e20 lue), connection.ops │ │ │ │ -00043ef0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00043f10: 7370 616e 2063 6c61 7373 3d22 6e22 3e50 span class="n">P │ │ │ │ -00043f20: 5245 4345 4449 4e47 3c2f 7370 616e 3e3c RECEDING< │ │ │ │ -00043f30: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ -00043f40: 3c2f 7370 616e 3e0a 2020 2020 2020 2020 . │ │ │ │ -00043f50: 3c73 7061 6e20 636c 6173 733d 226b 223e │ │ │ │ -00043f60: 656c 6966 3c2f 7370 616e 3e20 3c73 7061 elif sel │ │ │ │ -00043f80: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00043fa0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00043fb0: 7374 6172 743c 2f73 7061 6e3e 3c73 7061 start.value │ │ │ │ -00043ff0: 203c 7370 616e 2063 6c61 7373 3d22 6f77 is not │ │ │ │ -00044020: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c None and │ │ │ │ -00044060: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.start.value == │ │ │ │ -00044100: 3c73 7061 6e20 636c 6173 733d 226d 6922 0:. st │ │ │ │ -00044150: 6172 743c 2f73 7061 6e3e 203c 7370 616e art = connection.ops │ │ │ │ -000441c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000441e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e43 span class="n">C │ │ │ │ -000441f0: 5552 5245 4e54 5f52 4f57 3c2f 7370 616e URRENT_ROW. else:. │ │ │ │ -00044240: 2020 2020 2020 2020 2020 3c73 7061 6e20 start< │ │ │ │ -00044260: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ -00044280: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00044290: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection.ops.UNBOU │ │ │ │ -00044300: 4e44 4544 5f50 5245 4345 4449 4e47 3c2f NDED_PRECEDING.. < │ │ │ │ -00044320: 7370 616e 2063 6c61 7373 3d22 6b22 3e69 span class="k">i │ │ │ │ -00044330: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f self.end │ │ │ │ -00044380: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000443a0: 7370 616e 2063 6c61 7373 3d22 6e22 3e76 span class="n">v │ │ │ │ -000443b0: 616c 7565 3c2f 7370 616e 3e20 3c73 7061 alue is< │ │ │ │ -000443d0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> not None │ │ │ │ -00044410: 3c73 7061 6e20 636c 6173 733d 226f 7722 and sel │ │ │ │ -00044440: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00044460: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00044470: 656e 643c 2f73 7061 6e3e 3c73 7061 6e20 end.value < │ │ │ │ -000444b0: 7370 616e 2063 6c61 7373 3d22 6f22 3e26 span class="o">& │ │ │ │ -000444c0: 6774 3b3c 2f73 7061 6e3e 203c 7370 616e gt; 0:. │ │ │ │ -00044500: 2020 2020 2020 2020 203c 7370 616e 2063 end = &q │ │ │ │ -00044550: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;%d % │ │ │ │ -000445a0: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s"< │ │ │ │ -000445c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> % │ │ │ │ -000445e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000445f0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self.end< │ │ │ │ -00044640: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.va │ │ │ │ -00044670: 6c75 653c 2f73 7061 6e3e 3c73 7061 6e20 lue, connection.ops< │ │ │ │ -000446e0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.FO │ │ │ │ -00044710: 4c4c 4f57 494e 473c 2f73 7061 6e3e 3c73 LLOWING)< │ │ │ │ -00044730: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ -00044740: 7370 616e 2063 6c61 7373 3d22 6b22 3e65 span class="k">e │ │ │ │ -00044750: 6c69 663c 2f73 7061 6e3e 203c 7370 616e lif self │ │ │ │ -00044770: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00044790: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -000447a0: 6e64 3c2f 7370 616e 3e3c 7370 616e 2063 nd.value i │ │ │ │ -000447f0: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s not None and s │ │ │ │ -00044860: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.end.value │ │ │ │ -000448d0: 203c 7370 616e 2063 6c61 7373 3d22 6f22 == 0:. │ │ │ │ -00044920: 2020 2020 2020 2020 203c 7370 616e 2063 end = con │ │ │ │ -00044970: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection.< │ │ │ │ -00044990: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>ops │ │ │ │ -000449b0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -000449c0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .CURRENT_ │ │ │ │ -000449e0: 524f 573c 2f73 7061 6e3e 0a20 2020 2020 ROW. │ │ │ │ -000449f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 else:< │ │ │ │ -00044a20: 2f73 7061 6e3e 0a20 2020 2020 2020 2020 /span>. │ │ │ │ -00044a30: 2020 203c 7370 616e 2063 6c61 7373 3d22 end =< │ │ │ │ -00044a60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> connectio │ │ │ │ -00044a80: 6e3c 2f73 7061 6e3e 3c73 7061 6e20 636c n. │ │ │ │ -00044aa0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00044ab0: 6f70 733c 2f73 7061 6e3e 3c73 7061 6e20 ops.UNBOUNDED_FOLL │ │ │ │ -00044af0: 4f57 494e 473c 2f73 7061 6e3e 0a20 2020 OWING. │ │ │ │ -00044b00: 2020 2020 203c 7370 616e 2063 6c61 7373 return self< │ │ │ │ -00044b40: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ -00044b50: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 template< │ │ │ │ -00044b70: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> % │ │ │ │ -00044b90: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00044ba0: 7b3c 2f73 7061 6e3e 0a20 2020 2020 2020 {. │ │ │ │ -00044bb0: 2020 2020 203c 7370 616e 2063 6c61 7373 "fram │ │ │ │ -00044bd0: 655f 7479 7065 2671 756f 743b 3c2f 7370 e_type": sel │ │ │ │ -00044c10: 663c 2f73 7061 6e3e 3c73 7061 6e20 636c f. │ │ │ │ -00044c30: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -00044c40: 6672 616d 655f 7479 7065 3c2f 7370 616e frame_type,. │ │ │ │ -00044c70: 2020 2020 2020 3c73 7061 6e20 636c 6173 "sta │ │ │ │ -00044c90: 7274 2671 756f 743b 3c2f 7370 616e 3e3c rt"< │ │ │ │ -00044ca0: 7370 616e 2063 6c61 7373 3d22 7022 3e3a span class="p">: │ │ │ │ -00044cb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c start,. │ │ │ │ -00044cf0: 2020 2020 2020 2020 203c 7370 616e 2063 " │ │ │ │ -00044d10: 656e 6426 7175 6f74 3b3c 2f73 7061 6e3e end" │ │ │ │ -00044d20: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -00044d30: 3a3c 2f73 7061 6e3e 203c 7370 616e 2063 : end,. │ │ │ │ -00044d70: 2020 2020 3c73 7061 6e20 636c 6173 733d }.. │ │ │ │ -00044d90: 2020 3c73 7061 6e20 636c 6173 733d 226b def wi │ │ │ │ -00044dc0: 6e64 6f77 5f66 7261 6d65 5f73 7461 7274 ndow_frame_start │ │ │ │ -00044dd0: 5f65 6e64 3c2f 7370 616e 3e3c 7370 616e _end(self< │ │ │ │ -00044e10: 7370 616e 2063 6c61 7373 3d22 7022 3e2c span class="p">, │ │ │ │ -00044e20: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ -00044e40: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on, start,< │ │ │ │ -00044e90: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> end):. │ │ │ │ -00044ed0: 2020 203c 7370 616e 2063 6c61 7373 3d22 raise │ │ │ │ -00044ef0: 3c73 7061 6e20 636c 6173 733d 226e 6522 NotImplementedE │ │ │ │ -00044f10: 7272 6f72 3c2f 7370 616e 3e3c 7370 616e rror("Subcla │ │ │ │ -00044f50: 7373 6573 206d 7573 7420 696d 706c 656d sses must implem │ │ │ │ -00044f60: 656e 7420 7769 6e64 6f77 5f66 7261 6d65 ent window_frame │ │ │ │ -00044f70: 5f73 7461 7274 5f65 6e64 2829 2e26 7175 _start_end().&qu │ │ │ │ -00044f80: 6f74 3b3c 2f73 7061 6e3e 3c73 7061 6e20 ot;)...
. │ │ │ │ -00044fd0: 3c61 2063 6c61 7373 3d22 7669 6577 636f [d │ │ │ │ -00045040: 6f63 735d 3c2f 613e 0a3c 7370 616e 2063 ocs].class RowRange< │ │ │ │ -00045080: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(Wi │ │ │ │ -000450b0: 6e64 6f77 4672 616d 653c 2f73 7061 6e3e ndowFrame │ │ │ │ -000450c0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000450d0: 293a 3c2f 7370 616e 3e0a 2020 2020 3c73 ):. fr │ │ │ │ -000450f0: 616d 655f 7479 7065 3c2f 7370 616e 3e20 ame_type │ │ │ │ -00045100: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ -00045110: 3d3c 2f73 7061 6e3e 203c 7370 616e 2063 = " │ │ │ │ -00045130: 524f 5753 2671 756f 743b 3c2f 7370 616e ROWS".. def window_frame_ │ │ │ │ -00045180: 7374 6172 745f 656e 643c 2f73 7061 6e3e start_end │ │ │ │ -00045190: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ -000451a0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self, con │ │ │ │ -000451f0: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection,< │ │ │ │ -00045210: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> start, end< │ │ │ │ -00045260: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ -00045280: 2020 2020 2020 2020 3c73 7061 6e20 636c return connection │ │ │ │ -000452c0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -000452e0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ -000452f0: 7073 3c2f 7370 616e 3e3c 7370 616e 2063 ps.window_frame_ro │ │ │ │ -00045330: 7773 5f73 7461 7274 5f65 6e64 3c2f 7370 ws_start_end(start │ │ │ │ -00045370: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ -00045390: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ -000453a0: 656e 643c 2f73 7061 6e3e 3c73 7061 6e20 end)
....
.[docs]< │ │ │ │ -00045470: 2f61 3e0a 3c73 7061 6e20 636c 6173 733d /a>.class │ │ │ │ -00045490: 203c 7370 616e 2063 6c61 7373 3d22 6e63 ValueRange(Windo │ │ │ │ -000454e0: 7746 7261 6d65 3c2f 7370 616e 3e3c 7370 wFrame):< │ │ │ │ -00045500: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. frame │ │ │ │ -00045520: 5f74 7970 653c 2f73 7061 6e3e 203c 7370 _type = "RAN │ │ │ │ -00045560: 4745 2671 756f 743b 3c2f 7370 616e 3e0a GE". │ │ │ │ -00045570: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ -00045590: 3c73 7061 6e20 636c 6173 733d 226e 6622 window_frame_st │ │ │ │ -000455b0: 6172 745f 656e 643c 2f73 7061 6e3e 3c73 art_end(< │ │ │ │ -000455d0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>self, conne │ │ │ │ -00045620: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction, start, endself):. │ │ │ │ +00043860: 2020 203c 7370 616e 2063 6c61 7373 3d22 return │ │ │ │ +00043880: 203c 7370 616e 2063 6c61 7373 3d22 7332 "<%s: │ │ │ │ +000438d0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 %s>" % (self.__clas │ │ │ │ +00043990: 735f 5f3c 2f73 7061 6e3e 3c73 7061 6e20 s__.__name__, self │ │ │ │ +00043a00: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +00043a20: 0a20 2020 203c 7370 616e 2063 6c61 7373 . def │ │ │ │ +00043a40: 3c73 7061 6e20 636c 6173 733d 226e 6622 get_group_by_co │ │ │ │ +00043a60: 6c73 3c2f 7370 616e 3e3c 7370 616e 2063 ls(self):< │ │ │ │ +00043ab0: 2f73 7061 6e3e 0a20 2020 2020 2020 203c /span>. < │ │ │ │ +00043ac0: 7370 616e 2063 6c61 7373 3d22 6b22 3e72 span class="k">r │ │ │ │ +00043ad0: 6574 7572 6e3c 2f73 7061 6e3e 203c 7370 eturn []< │ │ │ │ +00043af0: 2f73 7061 6e3e 0a0a 2020 2020 3c73 7061 /span>.. def< │ │ │ │ +00043b10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> __str__< │ │ │ │ +00043b30: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +00043b60: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf):. if self.start< │ │ │ │ +00043bf0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.va │ │ │ │ +00043c20: 6c75 653c 2f73 7061 6e3e 203c 7370 616e lue is not None < │ │ │ │ +00043c80: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ +00043c90: 616e 643c 2f73 7061 6e3e 203c 7370 616e and self │ │ │ │ +00043cb0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00043cd0: 7370 616e 2063 6c61 7373 3d22 6e22 3e73 span class="n">s │ │ │ │ +00043ce0: 7461 7274 3c2f 7370 616e 3e3c 7370 616e tart.value │ │ │ │ +00043d20: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00043d30: 266c 743b 3c2f 7370 616e 3e20 3c73 7061 < 0:. │ │ │ │ +00043d70: 2020 2020 2020 2020 2020 3c73 7061 6e20 start< │ │ │ │ +00043d90: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> = │ │ │ │ +00043db0: 3c73 7061 6e20 636c 6173 733d 2273 3222 "% │ │ │ │ +00043de0: 643c 2f73 7061 6e3e 3c73 7061 6e20 636c d %s&quo │ │ │ │ +00043e30: 743b 3c2f 7370 616e 3e20 3c73 7061 6e20 t; % (abs< │ │ │ │ +00043e80: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>(s │ │ │ │ +00043eb0: 656c 663c 2f73 7061 6e3e 3c73 7061 6e20 elf.start.< │ │ │ │ +00043f00: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>value), conn │ │ │ │ +00043f50: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection.ops< │ │ │ │ +00043f90: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00043fa0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 PRECEDING │ │ │ │ +00043fc0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 ). │ │ │ │ +00043fe0: 2020 2020 2020 2020 3c73 7061 6e20 636c elif self │ │ │ │ +00044020: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00044030: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .start.valu │ │ │ │ +00044080: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e is not │ │ │ │ +000440c0: 3c73 7061 6e20 636c 6173 733d 226b 6322 None an │ │ │ │ +000440f0: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d self.sta │ │ │ │ +00044140: 7274 3c2f 7370 616e 3e3c 7370 616e 2063 rt.value == │ │ │ │ +00044190: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c 0:. │ │ │ │ +000441d0: 2020 2020 2020 3c73 7061 6e20 636c 6173 start = conn │ │ │ │ +00044220: 6563 7469 6f6e 3c2f 7370 616e 3e3c 7370 ection.ops< │ │ │ │ +00044260: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00044270: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 CURRENT_R │ │ │ │ +00044290: 4f57 3c2f 7370 616e 3e0a 2020 2020 2020 OW. │ │ │ │ +000442a0: 2020 3c73 7061 6e20 636c 6173 733d 226b else:. │ │ │ │ +000442e0: 2020 3c73 7061 6e20 636c 6173 733d 226e start < │ │ │ │ +00044300: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +00044310: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c connecti │ │ │ │ +00044330: 6f6e 3c2f 7370 616e 3e3c 7370 616e 2063 on.ops.UNBOUNDED_PRE │ │ │ │ +000443a0: 4345 4449 4e47 3c2f 7370 616e 3e0a 0a20 CEDING.. │ │ │ │ +000443b0: 2020 2020 2020 203c 7370 616e 2063 6c61 if │ │ │ │ +000443d0: 203c 7370 616e 2063 6c61 7373 3d22 6270 self.end< │ │ │ │ +00044420: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00044430: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 value is < │ │ │ │ +00044470: 7370 616e 2063 6c61 7373 3d22 6f77 223e span class="ow"> │ │ │ │ +00044480: 6e6f 743c 2f73 7061 6e3e 203c 7370 616e not None │ │ │ │ +000444a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c and self │ │ │ │ +000444e0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +000444f0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .end.value< │ │ │ │ +00044540: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> > 0:. │ │ │ │ +000445a0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 end = "%d < │ │ │ │ +00044620: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>%s │ │ │ │ +00044640: 3c73 7061 6e20 636c 6173 733d 2273 3222 " < │ │ │ │ +00044660: 7370 616e 2063 6c61 7373 3d22 6f22 3e25 span class="o">% │ │ │ │ +00044670: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c ( │ │ │ │ +00044690: 3c73 7061 6e20 636c 6173 733d 2262 7022 self.end.< │ │ │ │ +000446f0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>value, conne │ │ │ │ +00044740: 6374 696f 6e3c 2f73 7061 6e3e 3c73 7061 ction.ops.< │ │ │ │ +00044790: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>FOLLOWING< │ │ │ │ +000447b0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>). │ │ │ │ +000447d0: 2020 2020 2020 203c 7370 616e 2063 6c61 elif self< │ │ │ │ +00044810: 7370 616e 2063 6c61 7373 3d22 6f22 3e2e span class="o">. │ │ │ │ +00044820: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 end.value is │ │ │ │ +00044890: 203c 7370 616e 2063 6c61 7373 3d22 6f77 not No │ │ │ │ +000448c0: 6e65 3c2f 7370 616e 3e20 3c73 7061 6e20 ne and self.end.valu │ │ │ │ +00044960: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e == 0:. │ │ │ │ +000449c0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 end = connection< │ │ │ │ +00044a10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.op │ │ │ │ +00044a40: 733c 2f73 7061 6e3e 3c73 7061 6e20 636c s. │ │ │ │ +00044a60: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00044a70: 4355 5252 454e 545f 524f 573c 2f73 7061 CURRENT_ROW. else< │ │ │ │ +00044aa0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>:. │ │ │ │ +00044ac0: 2020 2020 2020 2020 2020 203c 7370 616e end = < │ │ │ │ +00044b00: 7370 616e 2063 6c61 7373 3d22 6e22 3e63 span class="n">c │ │ │ │ +00044b10: 6f6e 6e65 6374 696f 6e3c 2f73 7061 6e3e onnection │ │ │ │ +00044b20: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00044b30: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .ops.UNBOUN │ │ │ │ +00044b80: 4445 445f 464f 4c4c 4f57 494e 473c 2f73 DED_FOLLOWING. ret │ │ │ │ +00044bb0: 7572 6e3c 2f73 7061 6e3e 203c 7370 616e urn self │ │ │ │ +00044bd0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +00044bf0: 7370 616e 2063 6c61 7373 3d22 6e22 3e74 span class="n">t │ │ │ │ +00044c00: 656d 706c 6174 653c 2f73 7061 6e3e 203c emplate < │ │ │ │ +00044c10: 7370 616e 2063 6c61 7373 3d22 6f22 3e25 span class="o">% │ │ │ │ +00044c20: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c { │ │ │ │ +00044c40: 0a20 2020 2020 2020 2020 2020 203c 7370 . &q │ │ │ │ +00044c60: 756f 743b 6672 616d 655f 7479 7065 2671 uot;frame_type&q │ │ │ │ +00044c70: 756f 743b 3c2f 7370 616e 3e3c 7370 616e uot;: self │ │ │ │ +00044cb0: 3c73 7061 6e20 636c 6173 733d 226f 223e │ │ │ │ +00044cc0: 2e3c 2f73 7061 6e3e 3c73 7061 6e20 636c .frame_ty │ │ │ │ +00044ce0: 7065 3c2f 7370 616e 3e3c 7370 616e 2063 pe,. & │ │ │ │ +00044d20: 7175 6f74 3b73 7461 7274 2671 756f 743b quot;start" │ │ │ │ +00044d30: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 : │ │ │ │ +00044d50: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00044d60: 7374 6172 743c 2f73 7061 6e3e 3c73 7061 start,. │ │ │ │ +00044d90: 203c 7370 616e 2063 6c61 7373 3d22 7332 "end" │ │ │ │ +00044db0: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;: │ │ │ │ +00044dd0: 203c 7370 616e 2063 6c61 7373 3d22 6e22 end,. }.. def window_fra │ │ │ │ +00044e60: 6d65 5f73 7461 7274 5f65 6e64 3c2f 7370 me_start_end(self │ │ │ │ +00044ea0: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 , │ │ │ │ +00044ec0: 3c73 7061 6e20 636c 6173 733d 226e 223e │ │ │ │ +00044ed0: 636f 6e6e 6563 7469 6f6e 3c2f 7370 616e connection, start< │ │ │ │ +00044f10: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ +00044f30: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ +00044f40: 6e64 3c2f 7370 616e 3e3c 7370 616e 2063 nd):. raise │ │ │ │ +00044f80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c NotImpl │ │ │ │ +00044fa0: 656d 656e 7465 6445 7272 6f72 3c2f 7370 ementedError(&quo │ │ │ │ +00044fe0: 743b 5375 6263 6c61 7373 6573 206d 7573 t;Subclasses mus │ │ │ │ +00044ff0: 7420 696d 706c 656d 656e 7420 7769 6e64 t implement wind │ │ │ │ +00045000: 6f77 5f66 7261 6d65 5f73 7461 7274 5f65 ow_frame_start_e │ │ │ │ +00045010: 6e64 2829 2e26 7175 6f74 3b3c 2f73 7061 nd().")....[documenti │ │ │ │ +000450e0: 5d3c 2f61 3e0a 3c73 7061 6e20 636c 6173 ].class RowRange(Windo │ │ │ │ +00045150: 7746 7261 6d65 3c2f 7370 616e 3e3c 7370 wFrame):< │ │ │ │ +00045170: 2f73 7061 6e3e 0a20 2020 203c 7370 616e /span>. frame │ │ │ │ +00045190: 5f74 7970 653c 2f73 7061 6e3e 203c 7370 _type = "ROW │ │ │ │ +000451d0: 5326 7175 6f74 3b3c 2f73 7061 6e3e 0a0a S".. │ │ │ │ +000451e0: 2020 2020 3c73 7061 6e20 636c 6173 733d def < │ │ │ │ +00045200: 7370 616e 2063 6c61 7373 3d22 6e66 223e span class="nf"> │ │ │ │ +00045210: 7769 6e64 6f77 5f66 7261 6d65 5f73 7461 window_frame_sta │ │ │ │ +00045220: 7274 5f65 6e64 3c2f 7370 616e 3e3c 7370 rt_end(self, connec │ │ │ │ +00045290: 7469 6f6e 3c2f 7370 616e 3e3c 7370 616e tion, start │ │ │ │ +000452d0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000452e0: 2c3c 2f73 7061 6e3e 203c 7370 616e 2063 , end):. │ │ │ │ +00045320: 2020 2020 203c 7370 616e 2063 6c61 7373 return connection.ops< │ │ │ │ +00045390: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>.wi │ │ │ │ +000453c0: 6e64 6f77 5f66 7261 6d65 5f72 6f77 735f ndow_frame_rows_ │ │ │ │ +000453d0: 7374 6172 745f 656e 643c 2f73 7061 6e3e start_end │ │ │ │ +000453e0: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +000453f0: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (start, end │ │ │ │ +00045440: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 )< │ │ │ │ +00045460: 2f64 6976 3e0a 0a0a 0a3c 6469 7620 636c /div>....
.[documenti │ │ │ │ +00045510: 5d3c 2f61 3e0a 3c73 7061 6e20 636c 6173 ].class ValueRange(Win │ │ │ │ +00045580: 646f 7746 7261 6d65 3c2f 7370 616e 3e3c dowFrame< │ │ │ │ +00045590: 7370 616e 2063 6c61 7373 3d22 7022 3e29 span class="p">) │ │ │ │ +000455a0: 3a3c 2f73 7061 6e3e 0a20 2020 203c 7370 :. fra │ │ │ │ +000455c0: 6d65 5f74 7970 653c 2f73 7061 6e3e 203c me_type < │ │ │ │ +000455d0: 7370 616e 2063 6c61 7373 3d22 6f22 3e3d span class="o">= │ │ │ │ +000455e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c "R │ │ │ │ +00045600: 414e 4745 2671 756f 743b 3c2f 7370 616e ANGE".. def window_frame_ │ │ │ │ +00045650: 7374 6172 745f 656e 643c 2f73 7061 6e3e start_end │ │ │ │ +00045660: 3c73 7061 6e20 636c 6173 733d 2270 223e │ │ │ │ +00045670: 283c 2f73 7061 6e3e 3c73 7061 6e20 636c (self):. │ │ │ │ -000456b0: 2020 2020 2020 3c73 7061 6e20 636c 6173 return connection.ops │ │ │ │ -00045720: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ -00045740: 7370 616e 2063 6c61 7373 3d22 6e22 3e77 span class="n">w │ │ │ │ -00045750: 696e 646f 775f 6672 616d 655f 7261 6e67 indow_frame_rang │ │ │ │ -00045760: 655f 7374 6172 745f 656e 643c 2f73 7061 e_start_end(start< │ │ │ │ -000457a0: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>, < │ │ │ │ -000457c0: 7370 616e 2063 6c61 7373 3d22 6e22 3e65 span class="n">e │ │ │ │ -000457d0: 6e64 3c2f 7370 616e 3e3c 7370 616e 2063 nd)
..
< │ │ │ │ -00045800: 2f64 6976 3e0a 0a20 2020 2020 2020 2020 /div>.. │ │ │ │ -00045810: 203c 2f64 6976 3e0a 2020 2020 2020 2020
. │ │ │ │ -00045820: 3c2f 6469 763e 0a20 2020 2020 203c 2f64
. . . │ │ │ │ -00045840: 2020 200a 2020 2020 2020 2020 2020 3c64 . . │ │ │ │ -00045870: 2020 2020 2020 2020 2020 200a 2020 2020 . │ │ │ │ -00045880: 2020 3c64 6976 2063 6c61 7373 3d22 7370
. │ │ │ │ -000458d0: 2020 2020 203c 6469 7620 636c 6173 733d
..document.get │ │ │ │ -00045ab0: 456c 656d 656e 7442 7949 6428 2773 6561 ElementById('sea │ │ │ │ -00045ac0: 7263 6862 6f78 2729 2e73 7479 6c65 2e64 rchbox').style.d │ │ │ │ -00045ad0: 6973 706c 6179 203d 2022 626c 6f63 6b22 isplay = "block" │ │ │ │ -00045ae0: 3c2f 7363 7269 7074 3e0a 2020 2020 2020 . │ │ │ │ -00045af0: 2020 3c2f 6469 763e 0a20 2020 2020 203c
. < │ │ │ │ -00045b00: 2f64 6976 3e0a 2020 2020 2020 2020 2020 /div>. │ │ │ │ -00045b10: 2020 2020 3c68 333e 4c61 7374 2075 7064

Last upd │ │ │ │ -00045b20: 6174 653a 3c2f 6833 3e0a 2020 2020 2020 ate:

. │ │ │ │ -00045b30: 2020 2020 2020 2020 3c70 2063 6c61 7373

May 0 │ │ │ │ -00045b50: 382c 2032 3032 343c 2f70 3e0a 2020 2020 8, 2024

. │ │ │ │ -00045b60: 2020 2020 2020 3c2f 6469 763e 0a20 2020
. │ │ │ │ -00045b70: 2020 2020 200a 2020 2020 2020 0a20 2020 . . │ │ │ │ -00045b80: 203c 2f64 6976 3e0a 0a20 2020 203c 6469
.. . │ │ │ │ -00045ba0: 203c 6469 7620 636c 6173 733d 226e 6176 . │ │ │ │ -00045c10: 203c 2f64 6976 3e0a 0a20 2020 2020 203c
.. < │ │ │ │ -00045c20: 6469 7620 636c 6173 733d 2263 6c65 6172 div class="clear │ │ │ │ -00045c30: 6572 223e 3c2f 6469 763e 0a20 2020 203c er">
. < │ │ │ │ -00045c40: 2f64 6976 3e0a 2020 3c2f 626f 6479 3e0a /div>. . │ │ │ │ -00045c50: 3c2f 6874 6d6c 3e │ │ │ │ +000456a0: 2270 223e 2c3c 2f73 7061 6e3e 203c 7370 "p">, con │ │ │ │ +000456c0: 6e65 6374 696f 6e3c 2f73 7061 6e3e 3c73 nection,< │ │ │ │ +000456e0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> start, end< │ │ │ │ +00045730: 2f73 7061 6e3e 3c73 7061 6e20 636c 6173 /span>):. │ │ │ │ +00045750: 2020 2020 2020 2020 3c73 7061 6e20 636c return connection │ │ │ │ +00045790: 3c2f 7370 616e 3e3c 7370 616e 2063 6c61 .< │ │ │ │ +000457b0: 7370 616e 2063 6c61 7373 3d22 6e22 3e6f span class="n">o │ │ │ │ +000457c0: 7073 3c2f 7370 616e 3e3c 7370 616e 2063 ps.window_frame_ra │ │ │ │ +00045800: 6e67 655f 7374 6172 745f 656e 643c 2f73 nge_start_end(star │ │ │ │ +00045840: 743c 2f73 7061 6e3e 3c73 7061 6e20 636c t, │ │ │ │ +00045860: 203c 7370 616e 2063 6c61 7373 3d22 6e22 end)
..
.. │ │ │ │ +000458b0: 2020 203c 2f64 6976 3e0a 2020 2020 2020
. │ │ │ │ +000458c0: 2020 3c2f 6469 763e 0a20 2020 2020 203c
. < │ │ │ │ +000458d0: 2f64 6976 3e0a 2020 2020 2020 0a20 2020 /div>. . │ │ │ │ +000458e0: 2020 2020 200a 2020 2020 2020 2020 2020 . │ │ │ │ +000458f0: 3c64 6976 2063 6c61 7373 3d22 7975 692d . . │ │ │ │ +00045c20: 200a 2020 2020 3c2f 6469 763e 0a0a 2020 .
.. │ │ │ │ +00045c30: 2020 3c64 6976 2069 643d 2266 7422 3e0a
. │ │ │ │ +00045c40: 2020 2020 2020 3c64 6976 2063 6c61 7373
. up
. │ │ │ │ +00045cb0: 2020 203c 2f64 6976 3e0a 2020 3c2f 6469
. ..
< │ │ │ │ +00045ce0: 2f64 6976 3e0a 2020 2020 3c2f 6469 763e /div>.
│ │ │ │ +00045cf0: 0a20 203c 2f62 6f64 793e 0a3c 2f68 746d . . │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmooddeellss..eexxpprreessssiioonnss ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmooddeellss..eexxpprreessssiioonnss ************ │ │ │ │ │ import copy │ │ │ │ │ import datetime │ │ │ │ │ import functools │ │ │ │ │ import inspect │ │ │ │ │ import warnings │ │ │ │ │ from collections import defaultdict │ │ │ │ │ from decimal import Decimal │ │ │ │ │ @@ -494,15 +494,15 @@ │ │ │ │ │ """ │ │ │ │ │ if hasattr(self.output_field, "select_format"): │ │ │ │ │ return self.output_field.select_format(compiler, sql, params) │ │ │ │ │ return sql, params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible │ │ │ │ │ class Expression(BaseExpression, Combinable): │ │ │ │ │ """An expression that can be combined with other expressions.""" │ │ │ │ │ │ │ │ │ │ @cached_property │ │ │ │ │ def identity(self): │ │ │ │ │ constructor_signature = inspect.signature(self.__init__) │ │ │ │ │ @@ -838,15 +838,15 @@ │ │ │ │ │ rhs = compiler.compile(self.rhs) │ │ │ │ │ return connection.ops.subtract_temporals( │ │ │ │ │ self.lhs.output_field.get_internal_type(), lhs, rhs │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible(path="django.db.models.F") │ │ │ │ │ class F(Combinable): │ │ │ │ │ """An object capable of resolving references to existing query objects.""" │ │ │ │ │ │ │ │ │ │ def __init__(self, name): │ │ │ │ │ """ │ │ │ │ │ Arguments: │ │ │ │ │ @@ -918,15 +918,15 @@ │ │ │ │ │ return self │ │ │ │ │ │ │ │ │ │ def get_group_by_cols(self): │ │ │ │ │ return [] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class OuterRef(F): │ │ │ │ │ contains_aggregate = False │ │ │ │ │ contains_over_clause = False │ │ │ │ │ │ │ │ │ │ def resolve_expression(self, *args, **kwargs): │ │ │ │ │ if isinstance(self.name, self.__class__): │ │ │ │ │ return self.name │ │ │ │ │ @@ -935,15 +935,15 @@ │ │ │ │ │ def relabeled_clone(self, relabels): │ │ │ │ │ return self │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible(path="django.db.models.Func") │ │ │ │ │ class Func(SQLiteNumericMixin, Expression): │ │ │ │ │ """An SQL function call.""" │ │ │ │ │ │ │ │ │ │ function = None │ │ │ │ │ template = "%(function)s(%(expressions)s)" │ │ │ │ │ arg_joiner = ", " │ │ │ │ │ @@ -994,15 +994,15 @@ │ │ │ │ │ for pos, arg in enumerate(c.source_expressions): │ │ │ │ │ c.source_expressions[pos] = arg.resolve_expression( │ │ │ │ │ query, allow_joins, reuse, summarize, for_save │ │ │ │ │ ) │ │ │ │ │ return c │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def as_sql( │ │ │ │ │ self, │ │ │ │ │ compiler, │ │ │ │ │ connection, │ │ │ │ │ function=None, │ │ │ │ │ template=None, │ │ │ │ │ arg_joiner=None, │ │ │ │ │ @@ -1047,15 +1047,15 @@ │ │ │ │ │ copy.extra = self.extra.copy() │ │ │ │ │ return copy │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible(path="django.db.models.Value") │ │ │ │ │ class Value(SQLiteNumericMixin, Expression): │ │ │ │ │ """Represent a wrapped value as a node within an expression.""" │ │ │ │ │ │ │ │ │ │ # Provide a default value for `for_save` in order to allow unresolved │ │ │ │ │ # instances to be compiled until a decision is taken in #25425. │ │ │ │ │ for_save = False │ │ │ │ │ @@ -1135,15 +1135,15 @@ │ │ │ │ │ def empty_result_set_value(self): │ │ │ │ │ return self.value │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RawSQL(Expression): │ │ │ │ │ def __init__(self, sql, params, output_field=None): │ │ │ │ │ if output_field is None: │ │ │ │ │ output_field = fields.Field() │ │ │ │ │ self.sql, self.params = sql, params │ │ │ │ │ super().__init__(output_field=output_field) │ │ │ │ │ │ │ │ │ │ @@ -1324,15 +1324,15 @@ │ │ │ │ │ group_by_cols = [] │ │ │ │ │ for order_by in self.get_source_expressions(): │ │ │ │ │ group_by_cols.extend(order_by.get_group_by_cols()) │ │ │ │ │ return group_by_cols │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible(path="django.db.models.ExpressionWrapper") │ │ │ │ │ class ExpressionWrapper(SQLiteNumericMixin, Expression): │ │ │ │ │ """ │ │ │ │ │ An expression that can wrap another expression so that it can provide │ │ │ │ │ extra context to the inner expression, such as the output_field. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ @@ -1416,15 +1416,15 @@ │ │ │ │ │ and expression_supported_in_where_clause(self.expression) │ │ │ │ │ ): │ │ │ │ │ sql = "CASE WHEN {} THEN 1 ELSE 0 END".format(sql) │ │ │ │ │ return sql, params │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible(path="django.db.models.When") │ │ │ │ │ class When(Expression): │ │ │ │ │ template = "WHEN %(condition)s THEN %(result)s" │ │ │ │ │ # This isn't a complete conditional expression, must be used in Case(). │ │ │ │ │ conditional = False │ │ │ │ │ │ │ │ │ │ def __init__(self, condition=None, then=None, **lookups): │ │ │ │ │ @@ -1499,15 +1499,15 @@ │ │ │ │ │ cols.extend(source.get_group_by_cols()) │ │ │ │ │ return cols │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ @deconstructible(path="django.db.models.Case") │ │ │ │ │ class Case(SQLiteNumericMixin, Expression): │ │ │ │ │ """ │ │ │ │ │ An SQL searched CASE expression: │ │ │ │ │ │ │ │ │ │ CASE │ │ │ │ │ WHEN n > 0 │ │ │ │ │ @@ -1602,15 +1602,15 @@ │ │ │ │ │ return self.default.get_group_by_cols() │ │ │ │ │ return super().get_group_by_cols() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Subquery(BaseExpression, Combinable): │ │ │ │ │ """ │ │ │ │ │ An explicit subquery. It may contain OuterRef() references to the outer │ │ │ │ │ query which will be resolved when it is applied to that query. │ │ │ │ │ """ │ │ │ │ │ │ │ │ │ │ template = "(%(subquery)s)" │ │ │ │ │ @@ -1659,15 +1659,15 @@ │ │ │ │ │ def get_group_by_cols(self): │ │ │ │ │ return self.query.get_group_by_cols(wrapper=self) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Exists(Subquery): │ │ │ │ │ template = "EXISTS(%(subquery)s)" │ │ │ │ │ output_field = fields.BooleanField() │ │ │ │ │ empty_result_set_value = False │ │ │ │ │ │ │ │ │ │ def __init__(self, queryset, **kwargs): │ │ │ │ │ super().__init__(queryset, **kwargs) │ │ │ │ │ @@ -1786,15 +1786,15 @@ │ │ │ │ │ self.descending = False │ │ │ │ │ │ │ │ │ │ def desc(self): │ │ │ │ │ self.descending = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class Window(SQLiteNumericMixin, Expression): │ │ │ │ │ template = "%(expression)s OVER (%(window)s)" │ │ │ │ │ # Although the main expression may either be an aggregate or an │ │ │ │ │ # expression with an aggregate function, the GROUP BY that will │ │ │ │ │ # be introduced in the query as a result is not desired. │ │ │ │ │ contains_aggregate = False │ │ │ │ │ contains_over_clause = True │ │ │ │ │ @@ -1978,30 +1978,30 @@ │ │ │ │ │ │ │ │ │ │ def window_frame_start_end(self, connection, start, end): │ │ │ │ │ raise NotImplementedError("Subclasses must implement │ │ │ │ │ window_frame_start_end().") │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class RowRange(WindowFrame): │ │ │ │ │ frame_type = "ROWS" │ │ │ │ │ │ │ │ │ │ def window_frame_start_end(self, connection, start, end): │ │ │ │ │ return connection.ops.window_frame_rows_start_end(start, end) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ValueRange(WindowFrame): │ │ │ │ │ frame_type = "RANGE" │ │ │ │ │ │ │ │ │ │ def window_frame_start_end(self, connection, start, end): │ │ │ │ │ return connection.ops.window_frame_range_start_end(start, end) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/files.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.models.fields.files — Django 4.2.13 documentation │ │ │ │ + django.db.models.fields.files — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.models.fields.files

│ │ │ │ +  

Codice sorgente per django.db.models.fields.files

│ │ │ │  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
│ │ │ │ @@ -84,15 +85,15 @@
│ │ │ │  from django.db.models.fields import Field
│ │ │ │  from django.db.models.query_utils import DeferredAttribute
│ │ │ │  from django.db.models.utils import AltersData
│ │ │ │  from django.utils.translation import gettext_lazy as _
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FieldFile(File, AltersData): │ │ │ │ def __init__(self, instance, field, name): │ │ │ │ super().__init__(None, name) │ │ │ │ self.instance = instance │ │ │ │ self.field = field │ │ │ │ self.storage = field.storage │ │ │ │ self._committed = True │ │ │ │ @@ -145,15 +146,15 @@ │ │ │ │ def size(self): │ │ │ │ self._require_file() │ │ │ │ if not self._committed: │ │ │ │ return self.file.size │ │ │ │ return self.storage.size(self.name) │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def open(self, mode="rb"): │ │ │ │ self._require_file() │ │ │ │ if getattr(self, "_file", None) is None: │ │ │ │ self.file = self.storage.open(self.name, mode) │ │ │ │ else: │ │ │ │ self.file.open(mode) │ │ │ │ return self
│ │ │ │ @@ -163,30 +164,30 @@ │ │ │ │ open.alters_data = True │ │ │ │ │ │ │ │ # In addition to the standard File API, FieldFiles have extra methods │ │ │ │ # to further manipulate the underlying file, as well as update the │ │ │ │ # associated model instance. │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def save(self, name, content, save=True): │ │ │ │ name = self.field.generate_filename(self.instance, name) │ │ │ │ self.name = self.storage.save(name, content, max_length=self.field.max_length) │ │ │ │ setattr(self.instance, self.field.attname, self.name) │ │ │ │ self._committed = True │ │ │ │ │ │ │ │ # Save the object because it has changed, unless save is False │ │ │ │ if save: │ │ │ │ self.instance.save()
│ │ │ │ │ │ │ │ │ │ │ │ save.alters_data = True │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def delete(self, save=True): │ │ │ │ if not self: │ │ │ │ return │ │ │ │ # Only close the file if it's already open, which we know by the │ │ │ │ # presence of self._file │ │ │ │ if hasattr(self, "_file"): │ │ │ │ self.close() │ │ │ │ @@ -206,15 +207,15 @@ │ │ │ │ │ │ │ │ @property │ │ │ │ def closed(self): │ │ │ │ file = getattr(self, "_file", None) │ │ │ │ return file is None or file.closed │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ def close(self): │ │ │ │ file = getattr(self, "_file", None) │ │ │ │ if file is not None: │ │ │ │ file.close()
│ │ │ │ │ │ │ │ │ │ │ │ def __getstate__(self): │ │ │ │ @@ -306,15 +307,15 @@ │ │ │ │ return instance.__dict__[self.field.attname] │ │ │ │ │ │ │ │ def __set__(self, instance, value): │ │ │ │ instance.__dict__[self.field.attname] = value │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class FileField(Field): │ │ │ │ # The class to wrap instance attributes in. Accessing the file object off │ │ │ │ # the instance will always return an instance of attr_class. │ │ │ │ attr_class = FieldFile │ │ │ │ │ │ │ │ # The descriptor to use for accessing the attribute off of the class. │ │ │ │ descriptor_class = FileDescriptor │ │ │ │ @@ -475,15 +476,15 @@ │ │ │ │ # Clear the image dimensions cache │ │ │ │ if hasattr(self, "_dimensions_cache"): │ │ │ │ del self._dimensions_cache │ │ │ │ super().delete(save) │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class ImageField(FileField): │ │ │ │ attr_class = ImageFieldFile │ │ │ │ descriptor_class = ImageFileDescriptor │ │ │ │ description = _("Image") │ │ │ │ │ │ │ │ def __init__( │ │ │ │ self, │ │ │ │ @@ -610,35 +611,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmooddeellss..ffiieellddss..ffiilleess ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmooddeellss..ffiieellddss..ffiilleess ************ │ │ │ │ │ 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 │ │ │ │ │ @@ -15,15 +15,15 @@ │ │ │ │ │ from django.db.models.fields import Field │ │ │ │ │ from django.db.models.query_utils import DeferredAttribute │ │ │ │ │ from django.db.models.utils import AltersData │ │ │ │ │ from django.utils.translation import gettext_lazy as _ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FieldFile(File, AltersData): │ │ │ │ │ def __init__(self, instance, field, name): │ │ │ │ │ super().__init__(None, name) │ │ │ │ │ self.instance = instance │ │ │ │ │ self.field = field │ │ │ │ │ self.storage = field.storage │ │ │ │ │ self._committed = True │ │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │ │ def size(self): │ │ │ │ │ self._require_file() │ │ │ │ │ if not self._committed: │ │ │ │ │ return self.file.size │ │ │ │ │ return self.storage.size(self.name) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def open(self, mode="rb"): │ │ │ │ │ self._require_file() │ │ │ │ │ if getattr(self, "_file", None) is None: │ │ │ │ │ self.file = self.storage.open(self.name, mode) │ │ │ │ │ else: │ │ │ │ │ self.file.open(mode) │ │ │ │ │ return self │ │ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │ │ open.alters_data = True │ │ │ │ │ │ │ │ │ │ # In addition to the standard File API, FieldFiles have extra methods │ │ │ │ │ # to further manipulate the underlying file, as well as update the │ │ │ │ │ # associated model instance. │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def save(self, name, content, save=True): │ │ │ │ │ name = self.field.generate_filename(self.instance, name) │ │ │ │ │ self.name = self.storage.save(name, content, │ │ │ │ │ max_length=self.field.max_length) │ │ │ │ │ setattr(self.instance, self.field.attname, self.name) │ │ │ │ │ self._committed = True │ │ │ │ │ │ │ │ │ │ @@ -113,15 +113,15 @@ │ │ │ │ │ self.instance.save() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ save.alters_data = True │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def delete(self, save=True): │ │ │ │ │ if not self: │ │ │ │ │ return │ │ │ │ │ # Only close the file if it's already open, which we know by the │ │ │ │ │ # presence of self._file │ │ │ │ │ if hasattr(self, "_file"): │ │ │ │ │ self.close() │ │ │ │ │ @@ -142,15 +142,15 @@ │ │ │ │ │ │ │ │ │ │ @property │ │ │ │ │ def closed(self): │ │ │ │ │ file = getattr(self, "_file", None) │ │ │ │ │ return file is None or file.closed │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ def close(self): │ │ │ │ │ file = getattr(self, "_file", None) │ │ │ │ │ if file is not None: │ │ │ │ │ file.close() │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -247,15 +247,15 @@ │ │ │ │ │ return instance.__dict__[self.field.attname] │ │ │ │ │ │ │ │ │ │ def __set__(self, instance, value): │ │ │ │ │ instance.__dict__[self.field.attname] = value │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class FileField(Field): │ │ │ │ │ # The class to wrap instance attributes in. Accessing the file object off │ │ │ │ │ # the instance will always return an instance of attr_class. │ │ │ │ │ attr_class = FieldFile │ │ │ │ │ │ │ │ │ │ # The descriptor to use for accessing the attribute off of the class. │ │ │ │ │ descriptor_class = FileDescriptor │ │ │ │ │ @@ -419,15 +419,15 @@ │ │ │ │ │ # Clear the image dimensions cache │ │ │ │ │ if hasattr(self, "_dimensions_cache"): │ │ │ │ │ del self._dimensions_cache │ │ │ │ │ super().delete(save) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class ImageField(FileField): │ │ │ │ │ attr_class = ImageFieldFile │ │ │ │ │ descriptor_class = ImageFileDescriptor │ │ │ │ │ description = _("Image") │ │ │ │ │ │ │ │ │ │ def __init__( │ │ │ │ │ self, │ │ │ │ │ @@ -542,12 +542,12 @@ │ │ │ │ │ return super().formfield( │ │ │ │ │ **{ │ │ │ │ │ "form_class": forms.ImageField, │ │ │ │ │ **kwargs, │ │ │ │ │ } │ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/json.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.models.fields.json — Django 4.2.13 documentation │ │ │ │ + django.db.models.fields.json — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

Source code for django.db.models.fields.json

│ │ │ │ +  

Codice sorgente per django.db.models.fields.json

│ │ │ │  import json
│ │ │ │  import warnings
│ │ │ │  
│ │ │ │  from django import forms
│ │ │ │  from django.core import checks, exceptions
│ │ │ │  from django.db import NotSupportedError, connections, router
│ │ │ │  from django.db.models import expressions, lookups
│ │ │ │ @@ -91,15 +92,15 @@
│ │ │ │  from . import Field
│ │ │ │  from .mixins import CheckFieldDefaultMixin
│ │ │ │  
│ │ │ │  __all__ = ["JSONField"]
│ │ │ │  
│ │ │ │  
│ │ │ │  
│ │ │ │ -[docs] │ │ │ │ +[documenti] │ │ │ │ class JSONField(CheckFieldDefaultMixin, Field): │ │ │ │ empty_strings_allowed = False │ │ │ │ description = _("A JSON object") │ │ │ │ default_error_messages = { │ │ │ │ "invalid": _("Value must be valid JSON."), │ │ │ │ } │ │ │ │ _default_hint = ("dict", "{}") │ │ │ │ @@ -720,35 +721,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,11 +1,11 @@ │ │ │ │ │ -************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_tt_ii_oo_nn ************ │ │ │ │ │ +************ _DD_jj_aa_nn_gg_oo_ _44_.._22_.._11_33_ _dd_oo_cc_uu_mm_ee_nn_tt_aa_zz_ii_oo_nn_ee ************ │ │ │ │ │ _H_o_m_e | _T_a_b_l_e_ _o_f_ _c_o_n_t_e_n_t_s | _I_n_d_e_x | _M_o_d_u_l_e_s │ │ │ │ │ _u_p │ │ │ │ │ -************ SSoouurrccee ccooddee ffoorr ddjjaannggoo..ddbb..mmooddeellss..ffiieellddss..jjssoonn ************ │ │ │ │ │ +************ CCooddiiccee ssoorrggeennttee ppeerr ddjjaannggoo..ddbb..mmooddeellss..ffiieellddss..jjssoonn ************ │ │ │ │ │ import json │ │ │ │ │ import warnings │ │ │ │ │ │ │ │ │ │ from django import forms │ │ │ │ │ from django.core import checks, exceptions │ │ │ │ │ from django.db import NotSupportedError, connections, router │ │ │ │ │ from django.db.models import expressions, lookups │ │ │ │ │ @@ -22,15 +22,15 @@ │ │ │ │ │ from . import Field │ │ │ │ │ from .mixins import CheckFieldDefaultMixin │ │ │ │ │ │ │ │ │ │ __all__ = ["JSONField"] │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -_[_d_o_c_s_] │ │ │ │ │ +_[_d_o_c_u_m_e_n_t_i_] │ │ │ │ │ class JSONField(CheckFieldDefaultMixin, Field): │ │ │ │ │ empty_strings_allowed = False │ │ │ │ │ description = _("A JSON object") │ │ │ │ │ default_error_messages = { │ │ │ │ │ "invalid": _("Value must be valid JSON."), │ │ │ │ │ } │ │ │ │ │ _default_hint = ("dict", "{}") │ │ │ │ │ @@ -658,12 +658,12 @@ │ │ │ │ │ │ │ │ │ │ class KeyTransformFactory: │ │ │ │ │ def __init__(self, key_name): │ │ │ │ │ self.key_name = key_name │ │ │ │ │ │ │ │ │ │ def __call__(self, *args, **kwargs): │ │ │ │ │ return KeyTransform(self.key_name, *args, **kwargs) │ │ │ │ │ -******** QQuuiicckk sseeaarrcchh ******** │ │ │ │ │ -[q ][Go] │ │ │ │ │ +******** RRiicceerrccaa vveellooccee ******** │ │ │ │ │ +[q ][Vai] │ │ │ │ │ ******** LLaasstt uuppddaattee:: ******** │ │ │ │ │ -May 08, 2024 │ │ │ │ │ +mag 08, 2024 │ │ │ │ │ _u_p │ │ │ ├── ./usr/share/doc/python-django-doc/html/_modules/django/db/models/fields/related.html │ │ │ │ @@ -1,21 +1,22 @@ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - django.db.models.fields.related — Django 4.2.13 documentation │ │ │ │ + django.db.models.fields.related — Django 4.2.13 documentazione │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Django 4.2.13 documentation

│ │ │ │ +

Django 4.2.13 documentazione

│ │ │ │ │ │ │ │ │ │ │ │ + up
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

When

│ │ │ │
│ │ │ │
│ │ │ │ -class When(condition=None, then=None, **lookups)[source]
│ │ │ │ +class When(condition=None, then=None, **lookups)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

A When() object is used to encapsulate a condition and its result for use │ │ │ │ in the conditional expression. Using a When() object is similar to using │ │ │ │ the filter() method. The condition can │ │ │ │ be specified using field lookups, │ │ │ │ Q objects, or Expression │ │ │ │ @@ -154,30 +155,30 @@ │ │ │ │ ... & LessThan(F("registered_on"), date(2015, 1, 1)), │ │ │ │ ... then="account_type", │ │ │ │ ... ) │ │ │ │

│ │ │ │
│ │ │ │

Keep in mind that each of these values can be an expression.

│ │ │ │
│ │ │ │ -

Note

│ │ │ │ +

Nota

│ │ │ │

Since the then keyword argument is reserved for the result of the │ │ │ │ When(), there is a potential conflict if a │ │ │ │ Model has a field named then. This can be │ │ │ │ resolved in two ways:

│ │ │ │
>>> When(then__exact=0, then=1)
│ │ │ │  >>> When(Q(then=0), then=1)
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Case

│ │ │ │
│ │ │ │
│ │ │ │ -class Case(*cases, **extra)[source]
│ │ │ │ +class Case(*cases, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

A Case() expression is like the ifelif … │ │ │ │ else statement in Python. Each condition in the provided │ │ │ │ When() objects is evaluated in order, until one evaluates to a │ │ │ │ truthful value. The result expression from the matching When() object │ │ │ │ is returned.

│ │ │ │ @@ -228,15 +229,15 @@ │ │ │ │ ... default=Value("0%"), │ │ │ │ ... ) │ │ │ │ ... ).values_list("name", "discount") │ │ │ │ <QuerySet [('Jane Doe', '5%'), ('James Smith', '0%'), ('Jack Black', '10%')]> │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Note

│ │ │ │ +

Nota

│ │ │ │

Remember that the conditions are evaluated in order, so in the above │ │ │ │ example we get the correct result even though the second condition matches │ │ │ │ both Jane Doe and Jack Black. This works just like an if … │ │ │ │ elifelse statement in Python.

│ │ │ │
│ │ │ │

Case() also works in a filter() clause. For example, to find gold │ │ │ │ clients that registered more than a month ago and platinum clients that │ │ │ │ @@ -378,37 +379,37 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │
│ │ │ │ -

Previous topic

│ │ │ │ +

Argomento precedente

│ │ │ │

Query Expressions

│ │ │ │ + title="capitolo precedente">Query Expressions

│ │ │ │
│ │ │ │
│ │ │ │ -

Next topic

│ │ │ │ +

Argomento successivo

│ │ │ │

Database Functions

│ │ │ │ + title="capitolo successivo">Database Functions

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Last update:

│ │ │ │ -

May 08, 2024

│ │ │ │ +

mag 08, 2024

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Last update:

│ │ │ │ -

May 08, 2024

│ │ │ │ +

mag 08, 2024

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

We don’t usually recommend allowing null=True for CharField since this │ │ │ │ -allows the field to have two “empty values”, but it’s important for the │ │ │ │ +allows the field to have two «empty values», but it’s important for the │ │ │ │ Coalesce example below.

│ │ │ │
│ │ │ │

Comparison and conversion functions

│ │ │ │
│ │ │ │

Cast

│ │ │ │
│ │ │ │
│ │ │ │ -class Cast(expression, output_field)[source]
│ │ │ │ +class Cast(expression, output_field)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Forces the result type of expression to be the one from output_field.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models import FloatField
│ │ │ │  >>> from django.db.models.functions import Cast
│ │ │ │  >>> Author.objects.create(age=25, name="Margaret Smith")
│ │ │ │ @@ -116,15 +117,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Coalesce

│ │ │ │
│ │ │ │
│ │ │ │ -class Coalesce(*expressions, **extra)[source]
│ │ │ │ +class Coalesce(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a list of at least two field names or expressions and returns the │ │ │ │ first non-null value (note that an empty string is not considered a null │ │ │ │ value). Each argument must be of a similar type, so mixing text and numbers │ │ │ │ will result in a database error.

│ │ │ │

Usage examples:

│ │ │ │ @@ -148,15 +149,15 @@ │ │ │ │ >>> print(aggregated["combined_age_default"]) │ │ │ │ 0 │ │ │ │ >>> print(aggregated["combined_age_coalesce"]) │ │ │ │ 0 │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -

Warning

│ │ │ │ +

Avvertimento

│ │ │ │

A Python value passed to Coalesce on MySQL may be converted to an │ │ │ │ incorrect type unless explicitly cast to the correct database type:

│ │ │ │
>>> from django.db.models import DateTimeField
│ │ │ │  >>> from django.db.models.functions import Cast, Coalesce
│ │ │ │  >>> from django.utils import timezone
│ │ │ │  >>> now = timezone.now()
│ │ │ │  >>> Coalesce('updated', Cast(now, DateTimeField()))
│ │ │ │ @@ -164,15 +165,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Collate

│ │ │ │
│ │ │ │
│ │ │ │ -class Collate(expression, collation)[source]
│ │ │ │ +class Collate(expression, collation)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Takes an expression and a collation name to query against.

│ │ │ │

For example, to filter case-insensitively in SQLite:

│ │ │ │
>>> Author.objects.filter(name=Collate(Value("john"), "nocase"))
│ │ │ │  <QuerySet [<Author: John>, <Author: john>]>
│ │ │ │  
│ │ │ │ @@ -183,15 +184,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Greatest

│ │ │ │
│ │ │ │
│ │ │ │ -class Greatest(*expressions, **extra)[source]
│ │ │ │ +class Greatest(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a list of at least two field names or expressions and returns the │ │ │ │ greatest value. Each argument must be of a similar type, so mixing text and │ │ │ │ numbers will result in a database error.

│ │ │ │

Usage example:

│ │ │ │
class Blog(models.Model):
│ │ │ │ @@ -211,15 +212,15 @@
│ │ │ │  >>> comments = Comment.objects.annotate(last_updated=Greatest("modified", "blog__modified"))
│ │ │ │  >>> annotated_comment = comments.get()
│ │ │ │  
│ │ │ │
│ │ │ │

annotated_comment.last_updated will be the most recent of blog.modified │ │ │ │ and comment.modified.

│ │ │ │
│ │ │ │ -

Warning

│ │ │ │ +

Avvertimento

│ │ │ │

The behavior of Greatest when one or more expression may be null │ │ │ │ varies between databases:

│ │ │ │
    │ │ │ │
  • PostgreSQL: Greatest will return the largest non-null expression, │ │ │ │ or null if all expressions are null.

  • │ │ │ │
  • SQLite, Oracle, and MySQL: If any expression is null, Greatest │ │ │ │ will return null.

  • │ │ │ │ @@ -228,15 +229,15 @@ │ │ │ │ a sensible minimum value to provide as a default.

    │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

JSONObject

│ │ │ │
│ │ │ │
│ │ │ │ -class JSONObject(**fields)[source]
│ │ │ │ +class JSONObject(**fields)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Takes a list of key-value pairs and returns a JSON object containing those │ │ │ │ pairs.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models import F
│ │ │ │  >>> from django.db.models.functions import JSONObject, Lower
│ │ │ │ @@ -253,22 +254,22 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Least

│ │ │ │
│ │ │ │
│ │ │ │ -class Least(*expressions, **extra)[source]
│ │ │ │ +class Least(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a list of at least two field names or expressions and returns the │ │ │ │ least value. Each argument must be of a similar type, so mixing text and numbers │ │ │ │ will result in a database error.

│ │ │ │
│ │ │ │ -

Warning

│ │ │ │ +

Avvertimento

│ │ │ │

The behavior of Least when one or more expression may be null │ │ │ │ varies between databases:

│ │ │ │
    │ │ │ │
  • PostgreSQL: Least will return the smallest non-null expression, │ │ │ │ or null if all expressions are null.

  • │ │ │ │
  • SQLite, Oracle, and MySQL: If any expression is null, Least │ │ │ │ will return null.

  • │ │ │ │ @@ -277,15 +278,15 @@ │ │ │ │ a sensible maximum value to provide as a default.

    │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

NullIf

│ │ │ │
│ │ │ │
│ │ │ │ -class NullIf(expression1, expression2)[source]
│ │ │ │ +class NullIf(expression1, expression2)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts two expressions and returns None if they are equal, otherwise │ │ │ │ returns expression1.

│ │ │ │
│ │ │ │

Caveats on Oracle

│ │ │ │

Due to an Oracle convention, this │ │ │ │ @@ -308,49 +309,49 @@ │ │ │ │ end_time = models.TimeField(null=True, blank=True) │ │ │ │

│ │ │ │
│ │ │ │
│ │ │ │

Extract

│ │ │ │
│ │ │ │
│ │ │ │ -class Extract(expression, lookup_name=None, tzinfo=None, **extra)[source]
│ │ │ │ +class Extract(expression, lookup_name=None, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Extracts a component of a date as a number.

│ │ │ │

Takes an expression representing a DateField, DateTimeField, │ │ │ │ TimeField, or DurationField and a lookup_name, and returns the part │ │ │ │ of the date referenced by lookup_name as an IntegerField. │ │ │ │ -Django usually uses the databases’ extract function, so you may use any │ │ │ │ +Django usually uses the databases” extract function, so you may use any │ │ │ │ lookup_name that your database supports. A tzinfo subclass, usually │ │ │ │ provided by zoneinfo, can be passed to extract a value in a specific │ │ │ │ timezone.

│ │ │ │

Given the datetime 2015-06-15 23:30:01.000321+00:00, the built-in │ │ │ │ lookup_names return:

│ │ │ │
    │ │ │ │ -
  • “year”: 2015

  • │ │ │ │ -
  • “iso_year”: 2015

  • │ │ │ │ -
  • “quarter”: 2

  • │ │ │ │ -
  • “month”: 6

  • │ │ │ │ -
  • “day”: 15

  • │ │ │ │ -
  • “week”: 25

  • │ │ │ │ -
  • “week_day”: 2

  • │ │ │ │ -
  • “iso_week_day”: 1

  • │ │ │ │ -
  • “hour”: 23

  • │ │ │ │ -
  • “minute”: 30

  • │ │ │ │ -
  • “second”: 1

  • │ │ │ │ +
  • «year»: 2015

  • │ │ │ │ +
  • «iso_year»: 2015

  • │ │ │ │ +
  • «quarter»: 2

  • │ │ │ │ +
  • «month»: 6

  • │ │ │ │ +
  • «day»: 15

  • │ │ │ │ +
  • «week»: 25

  • │ │ │ │ +
  • «week_day»: 2

  • │ │ │ │ +
  • «iso_week_day»: 1

  • │ │ │ │ +
  • «hour»: 23

  • │ │ │ │ +
  • «minute»: 30

  • │ │ │ │ +
  • «second»: 1

  • │ │ │ │
│ │ │ │

If a different timezone like Australia/Melbourne is active in Django, then │ │ │ │ the datetime is converted to the timezone before the value is extracted. The │ │ │ │ timezone offset for Melbourne in the example date above is +10:00. The values │ │ │ │ returned when this timezone is active will be the same as above except for:

│ │ │ │
    │ │ │ │ -
  • “day”: 16

  • │ │ │ │ -
  • “week_day”: 3

  • │ │ │ │ -
  • “iso_week_day”: 2

  • │ │ │ │ -
  • “hour”: 9

  • │ │ │ │ +
  • «day»: 16

  • │ │ │ │ +
  • «week_day»: 3

  • │ │ │ │ +
  • «iso_week_day»: 2

  • │ │ │ │ +
  • «hour»: 9

  • │ │ │ │
│ │ │ │
│ │ │ │

week_day values

│ │ │ │

The week_day lookup_type is calculated differently from most │ │ │ │ databases and from Python’s standard functions. This function will return │ │ │ │ 1 for Sunday, 2 for Monday, through 7 for Saturday.

│ │ │ │

The equivalent calculation in Python is:

│ │ │ │ @@ -391,88 +392,88 @@ │ │ │ │ 1 │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

DateField extracts

│ │ │ │
│ │ │ │
│ │ │ │ -class ExtractYear(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractYear(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'year'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractIsoYear(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractIsoYear(expression, tzinfo=None, **extra)[sorgente] │ │ │ │

Returns the ISO-8601 week-numbering year.

│ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'iso_year'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractMonth(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractMonth(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'month'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractDay(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractDay(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'day'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractWeekDay(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractWeekDay(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'week_day'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractIsoWeekDay(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractIsoWeekDay(expression, tzinfo=None, **extra)[sorgente] │ │ │ │

Returns the ISO-8601 week day with day 1 being Monday and day 7 being │ │ │ │ Sunday.

│ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'iso_week_day'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractWeek(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractWeek(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'week'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractQuarter(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractQuarter(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'quarter'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -528,35 +529,35 @@ │ │ │ │
│ │ │ │
│ │ │ │

DateTimeField extracts

│ │ │ │

In addition to the following, all extracts for DateField listed above may │ │ │ │ also be used on DateTimeFields .

│ │ │ │
│ │ │ │
│ │ │ │ -class ExtractHour(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractHour(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'hour'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractMinute(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractMinute(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'minute'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class ExtractSecond(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class ExtractSecond(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'second'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ @@ -655,15 +656,15 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Now

│ │ │ │
│ │ │ │
│ │ │ │ -class Now[source]
│ │ │ │ +class Now[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the database server’s current date and time when the query is executed, │ │ │ │ typically using the SQL CURRENT_TIMESTAMP.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Now
│ │ │ │  >>> Article.objects.filter(published__lte=Now())
│ │ │ │ @@ -682,15 +683,15 @@
│ │ │ │  SQLite were added.

│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Trunc

│ │ │ │
│ │ │ │
│ │ │ │ -class Trunc(expression, kind, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class Trunc(expression, kind, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Truncates a date up to a significant component.

│ │ │ │

When you only care if something happened in a particular year, hour, or day, │ │ │ │ but not the exact second, then Trunc (and its subclasses) can be useful to │ │ │ │ filter or aggregate your data. For example, you can use Trunc to calculate │ │ │ │ the number of sales per day.

│ │ │ │ @@ -699,44 +700,44 @@ │ │ │ │ part, and an output_field that’s either DateTimeField(), │ │ │ │ TimeField(), or DateField(). It returns a datetime, date, or time │ │ │ │ depending on output_field, with fields up to kind set to their minimum │ │ │ │ value. If output_field is omitted, it will default to the output_field │ │ │ │ of expression. A tzinfo subclass, usually provided by zoneinfo, │ │ │ │ can be passed to truncate a value in a specific timezone.

│ │ │ │
│ │ │ │ -

Deprecated since version 4.0: The is_dst parameter indicates whether or not pytz should interpret │ │ │ │ +

Deprecato dalla versione 4.0: The is_dst parameter indicates whether or not pytz should interpret │ │ │ │ nonexistent and ambiguous datetimes in daylight saving time. By default │ │ │ │ (when is_dst=None), pytz raises an exception for such datetimes.

│ │ │ │

The is_dst parameter is deprecated and will be removed in Django 5.0.

│ │ │ │
│ │ │ │

Given the datetime 2015-06-15 14:30:50.000321+00:00, the built-in kinds │ │ │ │ return:

│ │ │ │
    │ │ │ │ -
  • “year”: 2015-01-01 00:00:00+00:00

  • │ │ │ │ -
  • “quarter”: 2015-04-01 00:00:00+00:00

  • │ │ │ │ -
  • “month”: 2015-06-01 00:00:00+00:00

  • │ │ │ │ -
  • “week”: 2015-06-15 00:00:00+00:00

  • │ │ │ │ -
  • “day”: 2015-06-15 00:00:00+00:00

  • │ │ │ │ -
  • “hour”: 2015-06-15 14:00:00+00:00

  • │ │ │ │ -
  • “minute”: 2015-06-15 14:30:00+00:00

  • │ │ │ │ -
  • “second”: 2015-06-15 14:30:50+00:00

  • │ │ │ │ +
  • «year»: 2015-01-01 00:00:00+00:00

  • │ │ │ │ +
  • «quarter»: 2015-04-01 00:00:00+00:00

  • │ │ │ │ +
  • «month»: 2015-06-01 00:00:00+00:00

  • │ │ │ │ +
  • «week»: 2015-06-15 00:00:00+00:00

  • │ │ │ │ +
  • «day»: 2015-06-15 00:00:00+00:00

  • │ │ │ │ +
  • «hour»: 2015-06-15 14:00:00+00:00

  • │ │ │ │ +
  • «minute»: 2015-06-15 14:30:00+00:00

  • │ │ │ │ +
  • «second»: 2015-06-15 14:30:50+00:00

  • │ │ │ │
│ │ │ │

If a different timezone like Australia/Melbourne is active in Django, then │ │ │ │ the datetime is converted to the new timezone before the value is truncated. │ │ │ │ The timezone offset for Melbourne in the example date above is +10:00. The │ │ │ │ values returned when this timezone is active will be:

│ │ │ │
    │ │ │ │ -
  • “year”: 2015-01-01 00:00:00+11:00

  • │ │ │ │ -
  • “quarter”: 2015-04-01 00:00:00+10:00

  • │ │ │ │ -
  • “month”: 2015-06-01 00:00:00+10:00

  • │ │ │ │ -
  • “week”: 2015-06-16 00:00:00+10:00

  • │ │ │ │ -
  • “day”: 2015-06-16 00:00:00+10:00

  • │ │ │ │ -
  • “hour”: 2015-06-16 00:00:00+10:00

  • │ │ │ │ -
  • “minute”: 2015-06-16 00:30:00+10:00

  • │ │ │ │ -
  • “second”: 2015-06-16 00:30:50+10:00

  • │ │ │ │ +
  • «year»: 2015-01-01 00:00:00+11:00

  • │ │ │ │ +
  • «quarter»: 2015-04-01 00:00:00+10:00

  • │ │ │ │ +
  • «month»: 2015-06-01 00:00:00+10:00

  • │ │ │ │ +
  • «week»: 2015-06-16 00:00:00+10:00

  • │ │ │ │ +
  • «day»: 2015-06-16 00:00:00+10:00

  • │ │ │ │ +
  • «hour»: 2015-06-16 00:00:00+10:00

  • │ │ │ │ +
  • «minute»: 2015-06-16 00:30:00+10:00

  • │ │ │ │ +
  • «second»: 2015-06-16 00:30:50+10:00

  • │ │ │ │
│ │ │ │

The year has an offset of +11:00 because the result transitioned into daylight │ │ │ │ saving time.

│ │ │ │

Each kind above has a corresponding Trunc subclass (listed below) that │ │ │ │ should typically be used instead of the more verbose equivalent, │ │ │ │ e.g. use TruncYear(...) rather than Trunc(..., kind='year').

│ │ │ │

The subclasses are all defined as transforms, but they aren’t registered with │ │ │ │ @@ -771,55 +772,55 @@ │ │ │ │ 2015-06-15 14:40:02.000123 │ │ │ │

│ │ │ │
│ │ │ │
│ │ │ │

DateField truncation

│ │ │ │
│ │ │ │
│ │ │ │ -class TruncYear(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncYear(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'year'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class TruncMonth(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncMonth(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'month'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class TruncWeek(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncWeek(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │

Truncates to midnight on the Monday of the week.

│ │ │ │
│ │ │ │
│ │ │ │ kind = 'week'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class TruncQuarter(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncQuarter(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'quarter'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -

Deprecated since version 4.0: The is_dst parameter is deprecated and will be removed in Django 5.0.

│ │ │ │ +

Deprecato dalla versione 4.0: The is_dst parameter is deprecated and will be removed in Django 5.0.

│ │ │ │
│ │ │ │

These are logically equivalent to Trunc('date_field', kind). They truncate │ │ │ │ all parts of the date up to kind which allows grouping or filtering dates │ │ │ │ with less precision. expression can have an output_field of either │ │ │ │ DateField or DateTimeField.

│ │ │ │

Since DateFields don’t have a time component, only Trunc subclasses │ │ │ │ that deal with date-parts can be used with DateField:

│ │ │ │ @@ -859,15 +860,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

DateTimeField truncation

│ │ │ │
│ │ │ │
│ │ │ │ -class TruncDate(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class TruncDate(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'date'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ @@ -877,15 +878,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

TruncDate casts expression to a date rather than using the built-in SQL │ │ │ │ truncate function. It’s also registered as a transform on DateTimeField as │ │ │ │ __date.

│ │ │ │
│ │ │ │
│ │ │ │ -class TruncTime(expression, tzinfo=None, **extra)[source]
│ │ │ │ +class TruncTime(expression, tzinfo=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ lookup_name = 'time'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ @@ -895,54 +896,54 @@ │ │ │ │
│ │ │ │ │ │ │ │

TruncTime casts expression to a time rather than using the built-in SQL │ │ │ │ truncate function. It’s also registered as a transform on DateTimeField as │ │ │ │ __time.

│ │ │ │
│ │ │ │
│ │ │ │ -class TruncDay(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncDay(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'day'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class TruncHour(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncHour(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'hour'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class TruncMinute(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncMinute(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'minute'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class TruncSecond(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncSecond(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'second'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -

Deprecated since version 4.0: The is_dst parameter is deprecated and will be removed in Django 5.0.

│ │ │ │ +

Deprecato dalla versione 4.0: The is_dst parameter is deprecated and will be removed in Django 5.0.

│ │ │ │
│ │ │ │

These are logically equivalent to Trunc('datetime_field', kind). They │ │ │ │ truncate all parts of the date up to kind and allow grouping or filtering │ │ │ │ datetimes with less precision. expression must have an output_field of │ │ │ │ DateTimeField.

│ │ │ │

Usage example:

│ │ │ │
>>> from datetime import date, datetime, timezone
│ │ │ │ @@ -974,44 +975,44 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

TimeField truncation

│ │ │ │
│ │ │ │
│ │ │ │ -class TruncHour(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncHour(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'hour'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class TruncMinute(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncMinute(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'minute'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class TruncSecond(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[source]
│ │ │ │ +class TruncSecond(expression, output_field=None, tzinfo=None, is_dst=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ kind = 'second'
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ -

Deprecated since version 4.0: The is_dst parameter is deprecated and will be removed in Django 5.0.

│ │ │ │ +

Deprecato dalla versione 4.0: The is_dst parameter is deprecated and will be removed in Django 5.0.

│ │ │ │
│ │ │ │

These are logically equivalent to Trunc('time_field', kind). They truncate │ │ │ │ all parts of the time up to kind which allows grouping or filtering times │ │ │ │ with less precision. expression can have an output_field of either │ │ │ │ TimeField or DateTimeField.

│ │ │ │

Since TimeFields don’t have a date component, only Trunc subclasses │ │ │ │ that deal with time-parts can be used with TimeField:

│ │ │ │ @@ -1064,15 +1065,15 @@ │ │ │ │ y = models.FloatField() │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Abs

│ │ │ │
│ │ │ │
│ │ │ │ -class Abs(expression, **extra)[source]
│ │ │ │ +class Abs(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the absolute value of a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Abs
│ │ │ │  >>> Vector.objects.create(x=-0.5, y=1.1)
│ │ │ │  >>> vector = Vector.objects.annotate(x_abs=Abs("x"), y_abs=Abs("y")).get()
│ │ │ │ @@ -1089,15 +1090,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

ACos

│ │ │ │
│ │ │ │
│ │ │ │ -class ACos(expression, **extra)[source]
│ │ │ │ +class ACos(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the arccosine of a numeric field or expression. The expression value │ │ │ │ must be within the range -1 to 1.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import ACos
│ │ │ │  >>> Vector.objects.create(x=0.5, y=-0.9)
│ │ │ │ @@ -1115,15 +1116,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

ASin

│ │ │ │
│ │ │ │
│ │ │ │ -class ASin(expression, **extra)[source]
│ │ │ │ +class ASin(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the arcsine of a numeric field or expression. The expression value must │ │ │ │ be in the range -1 to 1.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import ASin
│ │ │ │  >>> Vector.objects.create(x=0, y=1)
│ │ │ │ @@ -1141,15 +1142,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

ATan

│ │ │ │
│ │ │ │
│ │ │ │ -class ATan(expression, **extra)[source]
│ │ │ │ +class ATan(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the arctangent of a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import ATan
│ │ │ │  >>> Vector.objects.create(x=3.12, y=6.987)
│ │ │ │  >>> vector = Vector.objects.annotate(x_atan=ATan("x"), y_atan=ATan("y")).get()
│ │ │ │ @@ -1166,15 +1167,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

ATan2

│ │ │ │
│ │ │ │
│ │ │ │ -class ATan2(expression1, expression2, **extra)[source]
│ │ │ │ +class ATan2(expression1, expression2, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the arctangent of expression1 / expression2.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import ATan2
│ │ │ │  >>> Vector.objects.create(x=2.5, y=1.9)
│ │ │ │  >>> vector = Vector.objects.annotate(atan2=ATan2("x", "y")).get()
│ │ │ │ @@ -1183,15 +1184,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Ceil

│ │ │ │
│ │ │ │
│ │ │ │ -class Ceil(expression, **extra)[source]
│ │ │ │ +class Ceil(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the smallest integer greater than or equal to a numeric field or │ │ │ │ expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Ceil
│ │ │ │  >>> Vector.objects.create(x=3.12, y=7.0)
│ │ │ │ @@ -1209,15 +1210,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Cos

│ │ │ │
│ │ │ │
│ │ │ │ -class Cos(expression, **extra)[source]
│ │ │ │ +class Cos(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the cosine of a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Cos
│ │ │ │  >>> Vector.objects.create(x=-8.0, y=3.1415926)
│ │ │ │  >>> vector = Vector.objects.annotate(x_cos=Cos("x"), y_cos=Cos("y")).get()
│ │ │ │ @@ -1234,15 +1235,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Cot

│ │ │ │
│ │ │ │
│ │ │ │ -class Cot(expression, **extra)[source]
│ │ │ │ +class Cot(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the cotangent of a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Cot
│ │ │ │  >>> Vector.objects.create(x=12.0, y=1.0)
│ │ │ │  >>> vector = Vector.objects.annotate(x_cot=Cot("x"), y_cot=Cot("y")).get()
│ │ │ │ @@ -1259,15 +1260,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Degrees

│ │ │ │
│ │ │ │
│ │ │ │ -class Degrees(expression, **extra)[source]
│ │ │ │ +class Degrees(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Converts a numeric field or expression from radians to degrees.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Degrees
│ │ │ │  >>> Vector.objects.create(x=-1.57, y=3.14)
│ │ │ │  >>> vector = Vector.objects.annotate(x_d=Degrees("x"), y_d=Degrees("y")).get()
│ │ │ │ @@ -1284,15 +1285,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Exp

│ │ │ │
│ │ │ │
│ │ │ │ -class Exp(expression, **extra)[source]
│ │ │ │ +class Exp(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the value of e (the natural logarithm base) raised to the power of │ │ │ │ a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Exp
│ │ │ │  >>> Vector.objects.create(x=5.4, y=-2.0)
│ │ │ │ @@ -1310,15 +1311,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Floor

│ │ │ │
│ │ │ │
│ │ │ │ -class Floor(expression, **extra)[source]
│ │ │ │ +class Floor(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the largest integer value not greater than a numeric field or │ │ │ │ expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Floor
│ │ │ │  >>> Vector.objects.create(x=5.4, y=-2.3)
│ │ │ │ @@ -1336,15 +1337,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Ln

│ │ │ │
│ │ │ │
│ │ │ │ -class Ln(expression, **extra)[source]
│ │ │ │ +class Ln(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the natural logarithm a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Ln
│ │ │ │  >>> Vector.objects.create(x=5.4, y=233.0)
│ │ │ │  >>> vector = Vector.objects.annotate(x_ln=Ln("x"), y_ln=Ln("y")).get()
│ │ │ │ @@ -1361,15 +1362,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Log

│ │ │ │
│ │ │ │
│ │ │ │ -class Log(expression1, expression2, **extra)[source]
│ │ │ │ +class Log(expression1, expression2, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts two numeric fields or expressions and returns the logarithm of │ │ │ │ the second to base of the first.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Log
│ │ │ │  >>> Vector.objects.create(x=2.0, y=4.0)
│ │ │ │ @@ -1379,15 +1380,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Mod

│ │ │ │
│ │ │ │
│ │ │ │ -class Mod(expression1, expression2, **extra)[source]
│ │ │ │ +class Mod(expression1, expression2, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts two numeric fields or expressions and returns the remainder of │ │ │ │ the first divided by the second (modulo operation).

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Mod
│ │ │ │  >>> Vector.objects.create(x=5.4, y=2.3)
│ │ │ │ @@ -1397,24 +1398,24 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Pi

│ │ │ │
│ │ │ │
│ │ │ │ -class Pi(**extra)[source]
│ │ │ │ +class Pi(**extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the value of the mathematical constant π.

│ │ │ │
│ │ │ │
│ │ │ │

Power

│ │ │ │
│ │ │ │
│ │ │ │ -class Power(expression1, expression2, **extra)[source]
│ │ │ │ +class Power(expression1, expression2, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts two numeric fields or expressions and returns the value of the first │ │ │ │ raised to the power of the second.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Power
│ │ │ │  >>> Vector.objects.create(x=2, y=-2)
│ │ │ │ @@ -1424,15 +1425,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Radians

│ │ │ │
│ │ │ │
│ │ │ │ -class Radians(expression, **extra)[source]
│ │ │ │ +class Radians(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Converts a numeric field or expression from degrees to radians.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Radians
│ │ │ │  >>> Vector.objects.create(x=-90, y=180)
│ │ │ │  >>> vector = Vector.objects.annotate(x_r=Radians("x"), y_r=Radians("y")).get()
│ │ │ │ @@ -1449,24 +1450,24 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Random

│ │ │ │
│ │ │ │
│ │ │ │ -class Random(**extra)[source]
│ │ │ │ +class Random(**extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns a random value in the range 0.0 x < 1.0.

│ │ │ │
│ │ │ │
│ │ │ │

Round

│ │ │ │
│ │ │ │
│ │ │ │ -class Round(expression, precision=0, **extra)[source]
│ │ │ │ +class Round(expression, precision=0, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Rounds a numeric field or expression to precision (must be an integer) │ │ │ │ decimal places. By default, it rounds to the nearest integer. Whether half │ │ │ │ values are rounded up or down depends on the database.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Round
│ │ │ │ @@ -1485,15 +1486,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Sign

│ │ │ │
│ │ │ │
│ │ │ │ -class Sign(expression, **extra)[source]
│ │ │ │ +class Sign(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the sign (-1, 0, 1) of a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Sign
│ │ │ │  >>> Vector.objects.create(x=5.4, y=-2.3)
│ │ │ │  >>> vector = Vector.objects.annotate(x_sign=Sign("x"), y_sign=Sign("y")).get()
│ │ │ │ @@ -1510,15 +1511,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Sin

│ │ │ │
│ │ │ │
│ │ │ │ -class Sin(expression, **extra)[source]
│ │ │ │ +class Sin(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the sine of a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Sin
│ │ │ │  >>> Vector.objects.create(x=5.4, y=-2.3)
│ │ │ │  >>> vector = Vector.objects.annotate(x_sin=Sin("x"), y_sin=Sin("y")).get()
│ │ │ │ @@ -1535,15 +1536,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Sqrt

│ │ │ │
│ │ │ │
│ │ │ │ -class Sqrt(expression, **extra)[source]
│ │ │ │ +class Sqrt(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the square root of a nonnegative numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Sqrt
│ │ │ │  >>> Vector.objects.create(x=4.0, y=12.0)
│ │ │ │  >>> vector = Vector.objects.annotate(x_sqrt=Sqrt("x"), y_sqrt=Sqrt("y")).get()
│ │ │ │ @@ -1560,15 +1561,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Tan

│ │ │ │
│ │ │ │
│ │ │ │ -class Tan(expression, **extra)[source]
│ │ │ │ +class Tan(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the tangent of a numeric field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Tan
│ │ │ │  >>> Vector.objects.create(x=0, y=12)
│ │ │ │  >>> vector = Vector.objects.annotate(x_tan=Tan("x"), y_tan=Tan("y")).get()
│ │ │ │ @@ -1588,15 +1589,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │

Text functions

│ │ │ │
│ │ │ │

Chr

│ │ │ │
│ │ │ │
│ │ │ │ -class Chr(expression, **extra)[source]
│ │ │ │ +class Chr(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a numeric field or expression and returns the text representation of │ │ │ │ the expression as a single character. It works the same as Python’s chr() │ │ │ │ function.

│ │ │ │

Like Length, it can be registered as a transform on IntegerField. │ │ │ │ The default lookup name is chr.

│ │ │ │ @@ -1609,15 +1610,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Concat

│ │ │ │
│ │ │ │
│ │ │ │ -class Concat(*expressions, **extra)[source]
│ │ │ │ +class Concat(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a list of at least two text fields or expressions and returns the │ │ │ │ concatenated text. Each argument must be of a text or char type. If you want │ │ │ │ to concatenate a TextField() with a CharField(), then be sure to tell │ │ │ │ Django that the output_field should be a TextField(). Specifying an │ │ │ │ output_field is also required when concatenating a Value as in the │ │ │ │ @@ -1638,15 +1639,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Left

│ │ │ │
│ │ │ │
│ │ │ │ -class Left(expression, length, **extra)[source]
│ │ │ │ +class Left(expression, length, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the first length characters of the given text field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Left
│ │ │ │  >>> Author.objects.create(name="Margaret Smith")
│ │ │ │  >>> author = Author.objects.annotate(first_initial=Left("name", 1)).get()
│ │ │ │ @@ -1655,15 +1656,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Length

│ │ │ │
│ │ │ │
│ │ │ │ -class Length(expression, **extra)[source]
│ │ │ │ +class Length(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a single text field or expression and returns the number of characters │ │ │ │ the value has. If the expression is null, then the length will also be null.

│ │ │ │

Usage example:

│ │ │ │
>>> # Get the length of the name and goes_by fields
│ │ │ │  >>> from django.db.models.functions import Length
│ │ │ │ @@ -1684,15 +1685,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Lower

│ │ │ │
│ │ │ │
│ │ │ │ -class Lower(expression, **extra)[source]
│ │ │ │ +class Lower(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a single text field or expression and returns the lowercase │ │ │ │ representation.

│ │ │ │

It can also be registered as a transform as described in Length.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Lower
│ │ │ │ @@ -1703,15 +1704,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

LPad

│ │ │ │
│ │ │ │
│ │ │ │ -class LPad(expression, length, fill_text=Value(' '), **extra)[source]
│ │ │ │ +class LPad(expression, length, fill_text=Value(' '), **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the value of the given text field or expression padded on the left side │ │ │ │ with fill_text so that the resulting value is length characters long. │ │ │ │ The default fill_text is a space.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models import Value
│ │ │ │ @@ -1724,25 +1725,25 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

LTrim

│ │ │ │
│ │ │ │
│ │ │ │ -class LTrim(expression, **extra)[source]
│ │ │ │ +class LTrim(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Similar to Trim, but removes only leading │ │ │ │ spaces.

│ │ │ │
│ │ │ │
│ │ │ │

MD5

│ │ │ │
│ │ │ │
│ │ │ │ -class MD5(expression, **extra)[source]
│ │ │ │ +class MD5(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a single text field or expression and returns the MD5 hash of the │ │ │ │ string.

│ │ │ │

It can also be registered as a transform as described in Length.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import MD5
│ │ │ │ @@ -1753,15 +1754,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Ord

│ │ │ │
│ │ │ │
│ │ │ │ -class Ord(expression, **extra)[source]
│ │ │ │ +class Ord(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a single text field or expression and returns the Unicode code point │ │ │ │ value for the first character of that expression. It works similar to Python’s │ │ │ │ ord() function, but an exception isn’t raised if the expression is more │ │ │ │ than one character long.

│ │ │ │

It can also be registered as a transform as described in Length. │ │ │ │ @@ -1775,15 +1776,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Repeat

│ │ │ │
│ │ │ │
│ │ │ │ -class Repeat(expression, number, **extra)[source]
│ │ │ │ +class Repeat(expression, number, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the value of the given text field or expression repeated number │ │ │ │ times.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Repeat
│ │ │ │  >>> Author.objects.create(name="John", alias="j")
│ │ │ │ @@ -1794,15 +1795,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Replace

│ │ │ │
│ │ │ │
│ │ │ │ -class Replace(expression, text, replacement=Value(''), **extra)[source]
│ │ │ │ +class Replace(expression, text, replacement=Value(''), **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Replaces all occurrences of text with replacement in expression. │ │ │ │ The default replacement text is the empty string. The arguments to the function │ │ │ │ are case-sensitive.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models import Value
│ │ │ │ @@ -1816,15 +1817,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Reverse

│ │ │ │
│ │ │ │
│ │ │ │ -class Reverse(expression, **extra)[source]
│ │ │ │ +class Reverse(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a single text field or expression and returns the characters of that │ │ │ │ expression in reverse order.

│ │ │ │

It can also be registered as a transform as described in Length. The │ │ │ │ default lookup name is reverse.

│ │ │ │

Usage example:

│ │ │ │ @@ -1836,15 +1837,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Right

│ │ │ │
│ │ │ │
│ │ │ │ -class Right(expression, length, **extra)[source]
│ │ │ │ +class Right(expression, length, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the last length characters of the given text field or expression.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Right
│ │ │ │  >>> Author.objects.create(name="Margaret Smith")
│ │ │ │  >>> author = Author.objects.annotate(last_letter=Right("name", 1)).get()
│ │ │ │ @@ -1853,55 +1854,55 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

RPad

│ │ │ │
│ │ │ │
│ │ │ │ -class RPad(expression, length, fill_text=Value(' '), **extra)[source]
│ │ │ │ +class RPad(expression, length, fill_text=Value(' '), **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Similar to LPad, but pads on the right │ │ │ │ side.

│ │ │ │
│ │ │ │
│ │ │ │

RTrim

│ │ │ │
│ │ │ │
│ │ │ │ -class RTrim(expression, **extra)[source]
│ │ │ │ +class RTrim(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Similar to Trim, but removes only trailing │ │ │ │ spaces.

│ │ │ │
│ │ │ │
│ │ │ │

SHA1, SHA224, SHA256, SHA384, and SHA512

│ │ │ │
│ │ │ │
│ │ │ │ -class SHA1(expression, **extra)[source]
│ │ │ │ +class SHA1(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class SHA224(expression, **extra)[source]
│ │ │ │ +class SHA224(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class SHA256(expression, **extra)[source]
│ │ │ │ +class SHA256(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class SHA384(expression, **extra)[source]
│ │ │ │ +class SHA384(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class SHA512(expression, **extra)[source]
│ │ │ │ +class SHA512(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a single text field or expression and returns the particular hash of │ │ │ │ the string.

│ │ │ │

They can also be registered as transforms as described in Length.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import SHA1
│ │ │ │ @@ -1922,15 +1923,15 @@
│ │ │ │  

Oracle doesn’t support the SHA224 function.

│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

StrIndex

│ │ │ │
│ │ │ │
│ │ │ │ -class StrIndex(string, substring, **extra)[source]
│ │ │ │ +class StrIndex(string, substring, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns a positive integer corresponding to the 1-indexed position of the first │ │ │ │ occurrence of substring inside string, or 0 if substring is not │ │ │ │ found.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models import Value as V
│ │ │ │ @@ -1945,26 +1946,26 @@
│ │ │ │  >>> authors = Author.objects.annotate(smith_index=StrIndex("name", V("Smith"))).filter(
│ │ │ │  ...     smith_index__gt=0
│ │ │ │  ... )
│ │ │ │  <QuerySet [<Author: Margaret Smith>, <Author: Smith, Margaret>]>
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │ -

Warning

│ │ │ │ +

Avvertimento

│ │ │ │

In MySQL, a database table’s collation determines │ │ │ │ whether string comparisons (such as the expression and substring of │ │ │ │ this function) are case-sensitive. Comparisons are case-insensitive by │ │ │ │ default.

│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Substr

│ │ │ │
│ │ │ │
│ │ │ │ -class Substr(expression, pos, length=None, **extra)[source]
│ │ │ │ +class Substr(expression, pos, length=None, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns a substring of length length from the field or expression starting │ │ │ │ at position pos. The position is 1-indexed, so the position must be greater │ │ │ │ than 0. If length is None, then the rest of the string will be returned.

│ │ │ │

Usage example:

│ │ │ │
>>> # Set the alias to the first 5 characters of the name as lowercase
│ │ │ │ @@ -1977,15 +1978,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Trim

│ │ │ │
│ │ │ │
│ │ │ │ -class Trim(expression, **extra)[source]
│ │ │ │ +class Trim(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the value of the given text field or expression with leading and │ │ │ │ trailing spaces removed.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Trim
│ │ │ │  >>> Author.objects.create(name="  John  ", alias="j")
│ │ │ │ @@ -1996,15 +1997,15 @@
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Upper

│ │ │ │
│ │ │ │
│ │ │ │ -class Upper(expression, **extra)[source]
│ │ │ │ +class Upper(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Accepts a single text field or expression and returns the uppercase │ │ │ │ representation.

│ │ │ │

It can also be registered as a transform as described in Length.

│ │ │ │

Usage example:

│ │ │ │
>>> from django.db.models.functions import Upper
│ │ │ │ @@ -2021,45 +2022,45 @@
│ │ │ │  

There are a number of functions to use in a │ │ │ │ Window expression for computing the rank │ │ │ │ of elements or the Ntile of some rows.

│ │ │ │
│ │ │ │

CumeDist

│ │ │ │
│ │ │ │
│ │ │ │ -class CumeDist(*expressions, **extra)[source]
│ │ │ │ +class CumeDist(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Calculates the cumulative distribution of a value within a window or partition. │ │ │ │ The cumulative distribution is defined as the number of rows preceding or │ │ │ │ peered with the current row divided by the total number of rows in the frame.

│ │ │ │
│ │ │ │
│ │ │ │

DenseRank

│ │ │ │
│ │ │ │
│ │ │ │ -class DenseRank(*expressions, **extra)[source]
│ │ │ │ +class DenseRank(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Equivalent to Rank but does not have gaps.

│ │ │ │
│ │ │ │
│ │ │ │

FirstValue

│ │ │ │
│ │ │ │
│ │ │ │ -class FirstValue(expression, **extra)[source]
│ │ │ │ +class FirstValue(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Returns the value evaluated at the row that’s the first row of the window │ │ │ │ frame, or None if no such value exists.

│ │ │ │
│ │ │ │
│ │ │ │

Lag

│ │ │ │
│ │ │ │
│ │ │ │ -class Lag(expression, offset=1, default=None, **extra)[source]
│ │ │ │ +class Lag(expression, offset=1, default=None, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Calculates the value offset by offset, and if no row exists there, returns │ │ │ │ default.

│ │ │ │

default must have the same type as the expression, however, this is │ │ │ │ only validated by the database and not in Python.

│ │ │ │
│ │ │ │ @@ -2068,25 +2069,25 @@ │ │ │ │ the default parameter.

│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

LastValue

│ │ │ │
│ │ │ │
│ │ │ │ -class LastValue(expression, **extra)[source]
│ │ │ │ +class LastValue(expression, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Comparable to FirstValue, it calculates the last value in a given │ │ │ │ frame clause.

│ │ │ │
│ │ │ │
│ │ │ │

Lead

│ │ │ │
│ │ │ │
│ │ │ │ -class Lead(expression, offset=1, default=None, **extra)[source]
│ │ │ │ +class Lead(expression, offset=1, default=None, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Calculates the leading value in a given frame. Both │ │ │ │ offset and default are evaluated with respect to the current row.

│ │ │ │

default must have the same type as the expression, however, this is │ │ │ │ only validated by the database and not in Python.

│ │ │ │
│ │ │ │ @@ -2095,40 +2096,40 @@ │ │ │ │ the default parameter.

│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

NthValue

│ │ │ │
│ │ │ │
│ │ │ │ -class NthValue(expression, nth=1, **extra)[source]
│ │ │ │ +class NthValue(expression, nth=1, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Computes the row relative to the offset nth (must be a positive value) │ │ │ │ within the window. Returns None if no row exists.

│ │ │ │

Some databases may handle a nonexistent nth-value differently. For example, │ │ │ │ Oracle returns an empty string rather than None for character-based │ │ │ │ expressions. Django doesn’t do any conversions in these cases.

│ │ │ │
│ │ │ │
│ │ │ │

Ntile

│ │ │ │
│ │ │ │
│ │ │ │ -class Ntile(num_buckets=1, **extra)[source]
│ │ │ │ +class Ntile(num_buckets=1, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Calculates a partition for each of the rows in the frame clause, distributing │ │ │ │ numbers as evenly as possible between 1 and num_buckets. If the rows don’t │ │ │ │ divide evenly into a number of buckets, one or more buckets will be represented │ │ │ │ more frequently.

│ │ │ │
│ │ │ │
│ │ │ │

PercentRank

│ │ │ │
│ │ │ │
│ │ │ │ -class PercentRank(*expressions, **extra)[source]
│ │ │ │ +class PercentRank(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Computes the relative rank of the rows in the frame clause. This computation is │ │ │ │ equivalent to evaluating:

│ │ │ │
(rank - 1) / (total rows - 1)
│ │ │ │  
│ │ │ │
│ │ │ │ @@ -2188,26 +2189,26 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Rank

│ │ │ │
│ │ │ │
│ │ │ │ -class Rank(*expressions, **extra)[source]
│ │ │ │ +class Rank(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Comparable to RowNumber, this function ranks rows in the window. The │ │ │ │ computed rank contains gaps. Use DenseRank to compute rank without │ │ │ │ gaps.

│ │ │ │
│ │ │ │
│ │ │ │

RowNumber

│ │ │ │
│ │ │ │
│ │ │ │ -class RowNumber(*expressions, **extra)[source]
│ │ │ │ +class RowNumber(*expressions, **extra)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Computes the row number according to the ordering of either the frame clause │ │ │ │ or the ordering of the whole query if there is no partitioning of the │ │ │ │ window frame.

│ │ │ │
│ │ │ │
│ │ │ │ @@ -2317,37 +2318,37 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -

Previous topic

│ │ │ │ +

Argomento precedente

│ │ │ │

Conditional Expressions

│ │ │ │ + title="capitolo precedente">Conditional Expressions

│ │ │ │
│ │ │ │
│ │ │ │ -

Next topic

│ │ │ │ +

Argomento successivo

│ │ │ │

Paginator

│ │ │ │ + title="capitolo successivo">Paginator

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Last update:

│ │ │ │ -

May 08, 2024

│ │ │ │ +

mag 08, 2024

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

The Aggregate API is as follows:

│ │ │ │
│ │ │ │
│ │ │ │ -class Aggregate(*expressions, output_field=None, distinct=False, filter=None, default=None, **extra)[source]
│ │ │ │ +class Aggregate(*expressions, output_field=None, distinct=False, filter=None, default=None, **extra)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ template
│ │ │ │

A class attribute, as a format string, that describes the SQL that is │ │ │ │ generated for this aggregate. Defaults to │ │ │ │ '%(function)s(%(distinct)s%(expressions)s)'.

│ │ │ │
│ │ │ │ @@ -553,15 +554,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Value() expressions

│ │ │ │
│ │ │ │
│ │ │ │ -class Value(value, output_field=None)[source]
│ │ │ │ +class Value(value, output_field=None)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

A Value() object represents the smallest possible component of an │ │ │ │ expression: a simple value. When you need to represent the value of an integer, │ │ │ │ boolean, or string within an expression, you can wrap that value within a │ │ │ │ Value().

│ │ │ │

You will rarely need to use Value() directly. When you write the expression │ │ │ │ @@ -578,15 +579,15 @@ │ │ │ │ an instance of datetime.datetime as value defaults │ │ │ │ output_field to DateTimeField.

│ │ │ │
│ │ │ │
│ │ │ │

ExpressionWrapper() expressions

│ │ │ │
│ │ │ │
│ │ │ │ -class ExpressionWrapper(expression, output_field)[source]
│ │ │ │ +class ExpressionWrapper(expression, output_field)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

ExpressionWrapper surrounds another expression and provides access to │ │ │ │ properties, such as output_field, that may not be │ │ │ │ available on other expressions. ExpressionWrapper is necessary when using │ │ │ │ arithmetic on F() expressions with different types as described in │ │ │ │ Using F() with annotations.

│ │ │ │ @@ -597,15 +598,15 @@ │ │ │ │ else logic in queries. Django natively supports SQL CASE │ │ │ │ expressions. For more details see Conditional Expressions.

│ │ │ │
│ │ │ │
│ │ │ │

Subquery() expressions

│ │ │ │
│ │ │ │
│ │ │ │ -class Subquery(queryset, output_field=None)[source]
│ │ │ │ +class Subquery(queryset, output_field=None)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

You can add an explicit subquery to a QuerySet using the Subquery │ │ │ │ expression.

│ │ │ │

For example, to annotate each post with the email address of the author of the │ │ │ │ newest comment on that post:

│ │ │ │
>>> from django.db.models import OuterRef, Subquery
│ │ │ │ @@ -619,25 +620,25 @@
│ │ │ │      FROM "comment" U0
│ │ │ │      WHERE U0."post_id" = ("post"."id")
│ │ │ │      ORDER BY U0."created_at" DESC LIMIT 1
│ │ │ │  ) AS "newest_commenter_email" FROM "post"
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │ -

Note

│ │ │ │ +

Nota

│ │ │ │

The examples in this section are designed to show how to force │ │ │ │ Django to execute a subquery. In some cases it may be possible to │ │ │ │ write an equivalent queryset that performs the same task more │ │ │ │ clearly or efficiently.

│ │ │ │
│ │ │ │
│ │ │ │

Referencing columns from the outer queryset

│ │ │ │
│ │ │ │
│ │ │ │ -class OuterRef(field)[source]
│ │ │ │ +class OuterRef(field)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Use OuterRef when a queryset in a Subquery needs to refer to a field │ │ │ │ from the outer query or its transform. It acts like an F expression │ │ │ │ except that the check to see if it refers to a valid field isn’t made until the │ │ │ │ outer queryset is resolved.

│ │ │ │

Instances of OuterRef may be used in conjunction with nested instances │ │ │ │ @@ -677,15 +678,15 @@ │ │ │ │ OuterRef cannot be resolved until the queryset is used within a │ │ │ │ Subquery.)

│ │ │ │
│ │ │ │
│ │ │ │

Exists() subqueries

│ │ │ │
│ │ │ │
│ │ │ │ -class Exists(queryset)[source]
│ │ │ │ +class Exists(queryset)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Exists is a Subquery subclass that uses an SQL EXISTS statement. In │ │ │ │ many cases it will perform better than a subquery since the database is able to │ │ │ │ stop evaluation of the subquery when a first matching row is found.

│ │ │ │

For example, to annotate each post with whether or not it has a comment from │ │ │ │ within the last day:

│ │ │ │ @@ -754,15 +755,15 @@ │ │ │ │ there is an OuterRef, this will not be possible to resolve).

│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Raw SQL expressions

│ │ │ │
│ │ │ │
│ │ │ │ -class RawSQL(sql, params, output_field=None)[source]
│ │ │ │ +class RawSQL(sql, params, output_field=None)[sorgente] │ │ │ │
│ │ │ │ │ │ │ │

Sometimes database expressions can’t easily express a complex WHERE clause. │ │ │ │ In these edge cases, use the RawSQL expression. For example:

│ │ │ │
>>> from django.db.models.expressions import RawSQL
│ │ │ │  >>> queryset.annotate(val=RawSQL("select col from sometable where othercol = %s", (param,)))
│ │ │ │  
│ │ │ │ @@ -771,15 +772,15 @@ │ │ │ │ you’re explicitly writing SQL code) and violate the DRY principle, so you │ │ │ │ should avoid them if possible.

│ │ │ │

RawSQL expressions can also be used as the target of __in filters:

│ │ │ │
>>> queryset.filter(id__in=RawSQL("select id from sometable where col = %s", (param,)))
│ │ │ │  
│ │ │ │
│ │ │ │
│ │ │ │ -

Warning

│ │ │ │ +

Avvertimento

│ │ │ │

To protect against SQL injection attacks, you must escape any │ │ │ │ parameters that the user can control by using params. params is a │ │ │ │ required argument to force you to acknowledge that you’re not interpolating │ │ │ │ your SQL with user-provided data.

│ │ │ │

You also must not quote placeholders in the SQL string. This example is │ │ │ │ vulnerable to SQL injection because of the quotes around %s:

│ │ │ │
RawSQL("select col from sometable where othercol = '%s'")  # unsafe!
│ │ │ │ @@ -795,15 +796,15 @@
│ │ │ │  by the group by, window functions operate on frames and
│ │ │ │  partitions, and compute the result for each row.

│ │ │ │

You can specify multiple windows in the same query which in Django ORM would be │ │ │ │ equivalent to including multiple expressions in a QuerySet.annotate() call. The ORM doesn’t make use of named windows, │ │ │ │ instead they are part of the selected columns.

│ │ │ │
│ │ │ │
│ │ │ │ -class Window(expression, partition_by=None, order_by=None, frame=None, output_field=None)[source]
│ │ │ │ +class Window(expression, partition_by=None, order_by=None, frame=None, output_field=None)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ template
│ │ │ │

Defaults to %(expression)s OVER (%(window)s). If only the │ │ │ │ expression argument is provided, the window clause will be blank.

│ │ │ │
│ │ │ │ │ │ │ │ @@ -898,29 +899,29 @@ │ │ │ │ documentation for your database as needed.

│ │ │ │
│ │ │ │

Frames

│ │ │ │

For a window frame, you can choose either a range-based sequence of rows or an │ │ │ │ ordinary sequence of rows.

│ │ │ │
│ │ │ │
│ │ │ │ -class ValueRange(start=None, end=None)[source]
│ │ │ │ +class ValueRange(start=None, end=None)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ frame_type
│ │ │ │

This attribute is set to 'RANGE'.

│ │ │ │
│ │ │ │ │ │ │ │

PostgreSQL has limited support for ValueRange and only supports use of │ │ │ │ the standard start and end points, such as CURRENT ROW and UNBOUNDED │ │ │ │ FOLLOWING.

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -class RowRange(start=None, end=None)[source]
│ │ │ │ +class RowRange(start=None, end=None)[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ frame_type
│ │ │ │

This attribute is set to 'ROWS'.

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ @@ -947,15 +948,15 @@ │ │ │ │ RANGE mode, the frame starts or ends at the first or last peer according to │ │ │ │ the ordering clause. Thus, RANGE CURRENT ROW evaluates the expression for │ │ │ │ rows which have the same value specified by the ordering. Because the template │ │ │ │ includes both the start and end points, this may be expressed with:

│ │ │ │
ValueRange(start=0, end=0)
│ │ │ │  
│ │ │ │
│ │ │ │ -

If a movie’s “peers” are described as movies released by the same studio in the │ │ │ │ +

If a movie’s «peers» are described as movies released by the same studio in the │ │ │ │ same genre in the same year, this RowRange example annotates each movie │ │ │ │ with the average rating of a movie’s two prior and two following peers:

│ │ │ │
>>> from django.db.models import Avg, F, RowRange, Window
│ │ │ │  >>> Movie.objects.annotate(
│ │ │ │  ...     avg_rating=Window(
│ │ │ │  ...         expression=Avg("rating"),
│ │ │ │  ...         partition_by=[F("studio"), F("genre")],
│ │ │ │ @@ -996,15 +997,15 @@
│ │ │ │  but also expose a number of extra methods and attributes listed below. All
│ │ │ │  query expressions must inherit from Expression() or a relevant
│ │ │ │  subclass.

│ │ │ │

When a query expression wraps another expression, it is responsible for │ │ │ │ calling the appropriate methods on the wrapped expression.

│ │ │ │
│ │ │ │
│ │ │ │ -class Expression[source]
│ │ │ │ +class Expression[sorgente] │ │ │ │
│ │ │ │
│ │ │ │ contains_aggregate
│ │ │ │

Tells Django that this expression contains an aggregate and that a │ │ │ │ GROUP BY clause needs to be added to the query.

│ │ │ │
│ │ │ │ │ │ │ │ @@ -1119,15 +1120,15 @@ │ │ │ │

nulls_first and nulls_last define how null values are sorted. │ │ │ │ See Using F() to sort null values for example usage.

│ │ │ │
│ │ │ │ Changed in Django 4.1:

In older versions, nulls_first and nulls_last defaulted to │ │ │ │ False.

│ │ │ │
│ │ │ │
│ │ │ │ -

Deprecated since version 4.1: Passing nulls_first=False or nulls_last=False to asc() │ │ │ │ +

Deprecato dalla versione 4.1: Passing nulls_first=False or nulls_last=False to asc() │ │ │ │ is deprecated. Use None instead.

│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ desc(nulls_first=None, nulls_last=None)
│ │ │ │ @@ -1135,15 +1136,15 @@ │ │ │ │

nulls_first and nulls_last define how null values are sorted. │ │ │ │ See Using F() to sort null values for example usage.

│ │ │ │
│ │ │ │ Changed in Django 4.1:

In older versions, nulls_first and nulls_last defaulted to │ │ │ │ False.

│ │ │ │
│ │ │ │
│ │ │ │ -

Deprecated since version 4.1: Passing nulls_first=False or nulls_last=False to desc() │ │ │ │ +

Deprecato dalla versione 4.1: Passing nulls_first=False or nulls_last=False to desc() │ │ │ │ is deprecated. Use None instead.

│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ reverse_ordering()
│ │ │ │ @@ -1393,37 +1394,37 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -

Previous topic

│ │ │ │ +

Argomento precedente

│ │ │ │

Lookup API reference

│ │ │ │ + title="capitolo precedente">Lookup API reference

│ │ │ │
│ │ │ │
│ │ │ │ -

Next topic

│ │ │ │ +

Argomento successivo

│ │ │ │

Conditional Expressions

│ │ │ │ + title="capitolo successivo">Conditional Expressions

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │

Last update:

│ │ │ │ -

May 08, 2024

│ │ │ │ +

mag 08, 2024

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
  • │ │ │ │
    │ │ │ │ -SET_NULL[source]
    │ │ │ │ +SET_NULL[sorgente] │ │ │ │

    Set the ForeignKey null; this is only possible if │ │ │ │ null is True.

    │ │ │ │
    │ │ │ │ │ │ │ │
  • │ │ │ │
  • │ │ │ │
    │ │ │ │ -SET_DEFAULT[source]
    │ │ │ │ +SET_DEFAULT[sorgente] │ │ │ │

    Set the ForeignKey to its default value; a default for the │ │ │ │ ForeignKey must be set.

    │ │ │ │
    │ │ │ │ │ │ │ │
  • │ │ │ │
  • │ │ │ │
    │ │ │ │ -SET()[source]
    │ │ │ │ +SET()[sorgente] │ │ │ │

    Set the ForeignKey to the value passed to │ │ │ │ SET(), or if a callable is passed in, │ │ │ │ the result of calling it. In most cases, passing a callable will be │ │ │ │ necessary to avoid executing queries at the time your models.py is │ │ │ │ imported:

    │ │ │ │
    from django.conf import settings
    │ │ │ │  from django.contrib.auth import get_user_model
    │ │ │ │ @@ -1788,15 +1789,15 @@
    │ │ │ │  
    │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │
  • │ │ │ │
  • │ │ │ │
    │ │ │ │ -DO_NOTHING[source]
    │ │ │ │ +DO_NOTHING[sorgente] │ │ │ │

    Take no action. If your database backend enforces referential │ │ │ │ integrity, this will cause an IntegrityError unless │ │ │ │ you manually add an SQL ON DELETE constraint to the database field.

    │ │ │ │
    │ │ │ │ │ │ │ │
  • │ │ │ │ │ │ │ │ @@ -1829,15 +1830,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │

    If limit_choices_to is or returns a Q object, which is useful for complex queries, then it will only have an effect on the choices │ │ │ │ available in the admin when the field is not listed in │ │ │ │ raw_id_fields in the │ │ │ │ ModelAdmin for the model.

    │ │ │ │
    │ │ │ │ -

    Note

    │ │ │ │ +

    Nota

    │ │ │ │

    If a callable is used for limit_choices_to, it will be invoked │ │ │ │ every time a new form is instantiated. It may also be invoked when a │ │ │ │ model is validated, for example by management commands or the admin. │ │ │ │ The admin constructs querysets to validate its form inputs in various │ │ │ │ edge cases multiple times, so there is a possibility your callable may │ │ │ │ be invoked several times.

    │ │ │ │
    │ │ │ │ @@ -1937,15 +1938,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │

    ManyToManyField

    │ │ │ │
    │ │ │ │
    │ │ │ │ -class ManyToManyField(to, **options)[source]
    │ │ │ │ +class ManyToManyField(to, **options)[sorgente] │ │ │ │
    │ │ │ │ │ │ │ │

    A many-to-many relationship. Requires a positional argument: the class to │ │ │ │ which the model is related, which works exactly the same as it does for │ │ │ │ ForeignKey, including recursive and │ │ │ │ lazy relationships.

    │ │ │ │

    Related objects can be added, removed, or created with the field’s │ │ │ │ @@ -2012,22 +2013,22 @@ │ │ │ │ relationships. However, if you want to manually specify the intermediary │ │ │ │ table, you can use the through option to specify │ │ │ │ the Django model that represents the intermediate table that you want to │ │ │ │ use.

    │ │ │ │

    The most common use for this option is when you want to associate │ │ │ │ extra data with a many-to-many relationship.

    │ │ │ │
    │ │ │ │ -

    Note

    │ │ │ │ +

    Nota

    │ │ │ │

    If you don’t want multiple associations between the same instances, add │ │ │ │ a UniqueConstraint including the from and to │ │ │ │ fields. Django’s automatically generated many-to-many tables include │ │ │ │ such a constraint.

    │ │ │ │
    │ │ │ │
    │ │ │ │ -

    Note

    │ │ │ │ +

    Nota

    │ │ │ │

    Recursive relationships using an intermediary model can’t determine the │ │ │ │ reverse accessors names, as they would be the same. You need to set a │ │ │ │ related_name to at least one of them. If you’d │ │ │ │ prefer Django not to create a backwards relation, set related_name │ │ │ │ to '+'.

    │ │ │ │
    │ │ │ │

    If you don’t specify an explicit through model, there is still an │ │ │ │ @@ -2155,21 +2156,21 @@ │ │ │ │ relationship at the database level.

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │

    OneToOneField

    │ │ │ │
    │ │ │ │
    │ │ │ │ -class OneToOneField(to, on_delete, parent_link=False, **options)[source]
    │ │ │ │ +class OneToOneField(to, on_delete, parent_link=False, **options)[sorgente] │ │ │ │
    │ │ │ │ │ │ │ │

    A one-to-one relationship. Conceptually, this is similar to a │ │ │ │ ForeignKey with unique=True, but the │ │ │ │ -“reverse” side of the relation will directly return a single object.

    │ │ │ │ -

    This is most useful as the primary key of a model which “extends” │ │ │ │ +«reverse» side of the relation will directly return a single object.

    │ │ │ │ +

    This is most useful as the primary key of a model which «extends» │ │ │ │ another model in some way; Multi-table inheritance is │ │ │ │ implemented by adding an implicit one-to-one relation from the child │ │ │ │ model to the parent model, for example.

    │ │ │ │

    One positional argument is required: the class to which the model will be │ │ │ │ related. This works exactly the same as it does for ForeignKey, │ │ │ │ including all the options regarding recursive │ │ │ │ and lazy relationships.

    │ │ │ │ @@ -2228,15 +2229,15 @@ │ │ │ │ examples of OneToOneField.

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │

    Field API reference

    │ │ │ │
    │ │ │ │
    │ │ │ │ -class Field[source]
    │ │ │ │ +class Field[sorgente] │ │ │ │

    Field is an abstract class that represents a database table column. │ │ │ │ Django uses fields to create the database table (db_type()), to map │ │ │ │ Python types to database (get_prep_value()) and vice-versa │ │ │ │ (from_db_value()).

    │ │ │ │

    A field is thus a fundamental piece in different Django APIs, notably, │ │ │ │ models and querysets.

    │ │ │ │

    In models, a field is instantiated as a class attribute and represents a │ │ │ │ @@ -2275,31 +2276,31 @@ │ │ │ │ behavior.

    │ │ │ │
    │ │ │ │ │ │ │ │

    To map a Field to a database-specific type, Django exposes several │ │ │ │ methods:

    │ │ │ │
    │ │ │ │
    │ │ │ │ -get_internal_type()[source]
    │ │ │ │ +get_internal_type()[sorgente] │ │ │ │

    Returns a string naming this field for backend specific purposes. │ │ │ │ By default, it returns the class name.

    │ │ │ │

    See Emulating built-in field types for usage in custom fields.

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ -db_type(connection)[source]
    │ │ │ │ +db_type(connection)[sorgente] │ │ │ │

    Returns the database column data type for the Field, taking │ │ │ │ into account the connection.

    │ │ │ │

    See Custom database types for usage in custom fields.

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ -rel_db_type(connection)[source]
    │ │ │ │ +rel_db_type(connection)[sorgente] │ │ │ │

    Returns the database column data type for fields such as ForeignKey │ │ │ │ and OneToOneField that point to the Field, taking │ │ │ │ into account the connection.

    │ │ │ │

    See Custom database types for usage in custom fields.

    │ │ │ │
    │ │ │ │ │ │ │ │

    There are three main situations where Django needs to interact with the │ │ │ │ @@ -2309,24 +2310,24 @@ │ │ │ │

  • when it loads data from the database (database backend value -> Python │ │ │ │ value)

  • │ │ │ │
  • when it saves to the database (Python value -> database backend value)

  • │ │ │ │ │ │ │ │

    When querying, get_db_prep_value() and get_prep_value() are used:

    │ │ │ │
    │ │ │ │
    │ │ │ │ -get_prep_value(value)[source]
    │ │ │ │ +get_prep_value(value)[sorgente] │ │ │ │

    value is the current value of the model’s attribute, and the method │ │ │ │ should return data in a format that has been prepared for use as a │ │ │ │ parameter in a query.

    │ │ │ │

    See Converting Python objects to query values for usage.

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ -get_db_prep_value(value, connection, prepared=False)[source]
    │ │ │ │ +get_db_prep_value(value, connection, prepared=False)[sorgente] │ │ │ │

    Converts value to a backend-specific value. By default it returns │ │ │ │ value if prepared=True and get_prep_value() if is │ │ │ │ False.

    │ │ │ │

    See Converting query values to database values for usage.

    │ │ │ │
    │ │ │ │ │ │ │ │

    When loading data, from_db_value() is used:

    │ │ │ │ @@ -2337,33 +2338,33 @@ │ │ │ │ the reverse of get_prep_value().

    │ │ │ │

    This method is not used for most built-in fields as the database │ │ │ │ backend already returns the correct Python type, or the backend itself │ │ │ │ does the conversion.

    │ │ │ │

    expression is the same as self.

    │ │ │ │

    See Converting values to Python objects for usage.

    │ │ │ │
    │ │ │ │ -

    Note

    │ │ │ │ +

    Nota

    │ │ │ │

    For performance reasons, from_db_value is not implemented as a │ │ │ │ no-op on fields which do not require it (all Django fields). │ │ │ │ Consequently you may not call super in your definition.

    │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │

    When saving, pre_save() and get_db_prep_save() are used:

    │ │ │ │
    │ │ │ │
    │ │ │ │ -get_db_prep_save(value, connection)[source]
    │ │ │ │ +get_db_prep_save(value, connection)[sorgente] │ │ │ │

    Same as the get_db_prep_value(), but called when the field value │ │ │ │ must be saved to the database. By default returns │ │ │ │ get_db_prep_value().

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ -pre_save(model_instance, add)[source]
    │ │ │ │ +pre_save(model_instance, add)[sorgente] │ │ │ │

    Method called prior to get_db_prep_save() to prepare the value │ │ │ │ before being saved (e.g. for DateField.auto_now).

    │ │ │ │

    model_instance is the instance this field belongs to and add │ │ │ │ is whether the instance is being saved to the database for the first │ │ │ │ time.

    │ │ │ │

    It should return the value of the appropriate attribute from │ │ │ │ model_instance for this field. The attribute name is in │ │ │ │ @@ -2371,54 +2372,54 @@ │ │ │ │

    See Preprocessing values before saving for usage.

    │ │ │ │
    │ │ │ │ │ │ │ │

    Fields often receive their values as a different type, either from │ │ │ │ serialization or from forms.

    │ │ │ │
    │ │ │ │
    │ │ │ │ -to_python(value)[source]
    │ │ │ │ +to_python(value)[sorgente] │ │ │ │

    Converts the value into the correct Python object. It acts as the │ │ │ │ reverse of value_to_string(), and is also called in │ │ │ │ clean().

    │ │ │ │

    See Converting values to Python objects for usage.

    │ │ │ │
    │ │ │ │ │ │ │ │

    Besides saving to the database, the field also needs to know how to │ │ │ │ serialize its value:

    │ │ │ │
    │ │ │ │
    │ │ │ │ -value_from_object(obj)[source]
    │ │ │ │ +value_from_object(obj)[sorgente] │ │ │ │

    Returns the field’s value for the given model instance.

    │ │ │ │

    This method is often used by value_to_string().

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ -value_to_string(obj)[source]
    │ │ │ │ +value_to_string(obj)[sorgente] │ │ │ │

    Converts obj to a string. Used to serialize the value of the field.

    │ │ │ │

    See Converting field data for serialization for usage.

    │ │ │ │
    │ │ │ │ │ │ │ │

    When using model forms, the Field │ │ │ │ needs to know which form field it should be represented by:

    │ │ │ │
    │ │ │ │
    │ │ │ │ -formfield(form_class=None, choices_form_class=None, **kwargs)[source]
    │ │ │ │ +formfield(form_class=None, choices_form_class=None, **kwargs)[sorgente] │ │ │ │

    Returns the default django.forms.Field of this field for │ │ │ │ ModelForm.

    │ │ │ │

    By default, if both form_class and choices_form_class are │ │ │ │ None, it uses CharField. If the field has │ │ │ │ choices and choices_form_class │ │ │ │ isn’t specified, it uses TypedChoiceField.

    │ │ │ │

    See Specifying the form field for a model field for usage.

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ -deconstruct()[source]
    │ │ │ │ +deconstruct()[sorgente] │ │ │ │

    Returns a 4-tuple with enough information to recreate the field:

    │ │ │ │
      │ │ │ │
    1. The name of the field on the model.

    2. │ │ │ │
    3. The import path of the field (e.g. "django.db.models.IntegerField"). │ │ │ │ This should be the most portable version, so less specific may be better.

    4. │ │ │ │
    5. A list of positional arguments.

    6. │ │ │ │
    7. A dict of keyword arguments.

    8. │ │ │ │ @@ -2469,15 +2470,15 @@ │ │ │ │ Field.hidden │ │ │ │

      Boolean flag that indicates if a field is used to back another non-hidden │ │ │ │ field’s functionality (e.g. the content_type and object_id fields │ │ │ │ that make up a GenericForeignKey). The hidden flag is used to │ │ │ │ distinguish what constitutes the public subset of fields on the model from │ │ │ │ all the fields on the model.

      │ │ │ │
      │ │ │ │ -

      Note

      │ │ │ │ +

      Nota

      │ │ │ │

      Options.get_fields() │ │ │ │ excludes hidden fields by default. Pass in include_hidden=True to │ │ │ │ return hidden fields in the results.

      │ │ │ │
      │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ @@ -2639,37 +2640,37 @@ │ │ │ │
  • Attributes for fields with relations
  • │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ -

    Previous topic

    │ │ │ │ +

    Argomento precedente

    │ │ │ │

    Models

    │ │ │ │ + title="capitolo precedente">Models

    │ │ │ │
    │ │ │ │
    │ │ │ │ -

    Next topic

    │ │ │ │ +

    Argomento successivo

    │ │ │ │

    Model index reference

    │ │ │ │ + title="capitolo successivo">Model index reference

    │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │

    Last update:

    │ │ │ │ -

    May 08, 2024

    │ │ │ │ +

    mag 08, 2024

    │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Without passing safe=False, a TypeError will be raised.

    │ │ │ │

    Note that an API based on dict objects is more extensible, flexible, and │ │ │ │ makes it easier to maintain forwards compatibility. Therefore, you should avoid │ │ │ │ using non-dict objects in JSON-encoded response.

    │ │ │ │
    │ │ │ │ -

    Warning

    │ │ │ │ +

    Avvertimento

    │ │ │ │

    Before the 5th edition of ECMAScript it was possible to │ │ │ │ poison the JavaScript Array constructor. For this reason, Django does │ │ │ │ not allow passing non-dict objects to the │ │ │ │ JsonResponse constructor by default. However, most │ │ │ │ modern browsers implement ECMAScript 5 which removes this attack vector. │ │ │ │ Therefore it is possible to disable this security precaution.

    │ │ │ │
    │ │ │ │ @@ -1332,15 +1333,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │

    StreamingHttpResponse objects

    │ │ │ │
    │ │ │ │
    │ │ │ │ -class StreamingHttpResponse[source]
    │ │ │ │ +class StreamingHttpResponse[sorgente] │ │ │ │
    │ │ │ │ │ │ │ │

    The StreamingHttpResponse class is used to stream a response from │ │ │ │ Django to the browser.

    │ │ │ │
    │ │ │ │

    Advanced usage

    │ │ │ │

    StreamingHttpResponse is somewhat advanced, in that it is │ │ │ │ @@ -1441,15 +1442,15 @@ │ │ │ │ │ │ │ │

    │ │ │ │ │ │ │ │
    │ │ │ │

    FileResponse objects

    │ │ │ │
    │ │ │ │
    │ │ │ │ -class FileResponse(open_file, as_attachment=False, filename='', **kwargs)[source]
    │ │ │ │ +class FileResponse(open_file, as_attachment=False, filename='', **kwargs)[sorgente] │ │ │ │

    FileResponse is a subclass of StreamingHttpResponse │ │ │ │ optimized for binary files. It uses wsgi.file_wrapper if provided by the wsgi │ │ │ │ server, otherwise it streams the file out in small chunks.

    │ │ │ │

    If as_attachment=True, the Content-Disposition header is set to │ │ │ │ attachment, which asks the browser to offer the file to the user as a │ │ │ │ download. Otherwise, a Content-Disposition header with a value of │ │ │ │ inline (the browser default) will be set only if a filename is │ │ │ │ @@ -1478,27 +1479,27 @@ │ │ │ │

    In order to stream a file asynchronously you need to use a third-party │ │ │ │ package that provides an asynchronous file API, such as aiofiles.

    │ │ │ │
    │ │ │ │
    │ │ │ │

    Methods

    │ │ │ │
    │ │ │ │
    │ │ │ │ -FileResponse.set_headers(open_file)[source]
    │ │ │ │ +FileResponse.set_headers(open_file)[sorgente] │ │ │ │

    This method is automatically called during the response initialization and │ │ │ │ set various headers (Content-Length, Content-Type, and │ │ │ │ Content-Disposition) depending on open_file.

    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │

    HttpResponseBase class

    │ │ │ │
    │ │ │ │
    │ │ │ │ -class HttpResponseBase[source]
    │ │ │ │ +class HttpResponseBase[sorgente] │ │ │ │
    │ │ │ │ │ │ │ │

    The HttpResponseBase class is common to all Django responses. │ │ │ │ It should not be used to create responses directly, but it can be │ │ │ │ useful for type-checking.

    │ │ │ │
    │ │ │ │ │ │ │ │ @@ -1564,37 +1565,37 @@ │ │ │ │
  • HttpResponseBase class
  • │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ -

    Previous topic

    │ │ │ │ +

    Argomento precedente

    │ │ │ │

    Paginator

    │ │ │ │ + title="capitolo precedente">Paginator

    │ │ │ │
    │ │ │ │
    │ │ │ │ -

    Next topic

    │ │ │ │ +

    Argomento successivo

    │ │ │ │

    SchemaEditor

    │ │ │ │ + title="capitolo successivo">SchemaEditor

    │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    Last update:

    │ │ │ │ -

    May 08, 2024

    │ │ │ │ +

    mag 08, 2024

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    Last update:

    │ │ │ │ -

    May 08, 2024

    │ │ │ │ +

    mag 08, 2024

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │