... er versions. オーバービュー ¶ Django 1.2 introduces several large, important new features, including: Support for multiple database connections in a single Django instance. Model validation inspired by Django's form validation. Vastly improved protection ... ntly being developed, and will be announced prior to the release of Django 1.3. Django 1.2 の新機能 ¶ Support for multiple databases ¶ Django 1.2 adds the ability to use more than one database in your Django project. Queries can be issued at a specific d ... atabase with the using() method on QuerySet objects. Individual objects can be saved to a specific database by providing a using argument when you call save() . Model validation ¶ Model instances now have support for validating th ... ... er versions. オーバービュー ¶ Django 1.2 introduces several large, important new features, including: Support for multiple database connections in a single Django instance. Model validation inspired by Django's form validation. Vastly improved protection ... ntly being developed, and will be announced prior to the release of Django 1.3. Django 1.2 の新機能 ¶ Support for multiple databases ¶ Django 1.2 adds the ability to use more than one database in your Django project. Queries can be issued at a specific d ... atabase with the using() method on QuerySet objects. Individual objects can be saved to a specific database by providing a using argument when you call save() . Model validation ¶ Model instances now have support for validating th ... ... details on installing the optional test dependencies. Running the tests requires a Django settings module that defines the databases to use. To help you get started, Django provides and uses a sample settings module that uses the SQLite database. See Usi ... ng another settings module to learn how to use a different settings module to run the tests with a different database. Having problems? See トラブルシューティング for some common issues. Running tests using tox ¶ Tox is a tool for running t ... ox -l py3 black blacken-docs flake8> =3.7.0 docs isort> =7.0.0 lint-docs zizmor> =1.19.0 Testing other Python versions and database backends ¶ In addition to the default environments, tox supports running unit tests for other versions of Python and other ... ... details on installing the optional test dependencies. Running the tests requires a Django settings module that defines the databases to use. To help you get started, Django provides and uses a sample settings module that uses the SQLite database. See Usi ... ng another settings module to learn how to use a different settings module to run the tests with a different database. Having problems? See トラブルシューティング for some common issues. Running tests using tox ¶ Tox is a tool for running t ... ox -l py3 black blacken-docs flake8> =3.7.0 docs isort> =7.0.0 lint-docs zizmor> =1.19.0 Testing other Python versions and database backends ¶ In addition to the default environments, tox supports running unit tests for other versions of Python and other ... ... also been improved on all backends. There is a corresponding form field . Query Expressions, Conditional Expressions, and Database Functions ¶ Query Expressions allow you to create, customize, and compose complex SQL expressions. This has enabled annota ... to accept expressions. Conditional Expressions allow you to use if ... elif ... else logic within queries. A collection of database functions is also included with functionality such as Coalesce , Concat , and Substr . TestCase data setup ¶ TestCase has ... been refactored to allow for data initialization at the class level using transactions and savepoints. Database backends which do not support transactions, like MySQL with the MyISAM storage engine, will still be able to run these tes ... ... also been improved on all backends. There is a corresponding form field . Query Expressions, Conditional Expressions, and Database Functions ¶ Query Expressions allow you to create, customize, and compose complex SQL expressions. This has enabled annota ... to accept expressions. Conditional Expressions allow you to use if ... elif ... else logic within queries. A collection of database functions is also included with functionality such as Coalesce , Concat , and Substr . TestCase data setup ¶ TestCase has ... been refactored to allow for data initialization at the class level using transactions and savepoints. Database backends which do not support transactions, like MySQL with the MyISAM storage engine, will still be able to run these tes ... ... 推奨 します。 Django 2.2 の新機能 ¶ Constraints ¶ The new CheckConstraint and UniqueConstraint classes enable adding custom database constraints. Constraints are added to models using the Meta.constraints option. マイナーな機能 ¶ django.contrib.admin ¶ Ad ... elements. The new BTreeIndex , HashIndex and SpGistIndex classes allow creating B-Tree , hash , and SP-GiST indexes in the database. BrinIndex now has the autosummarize parameter. The new search_type parameter of SearchQuery allows searching for a phrase ... operator classes ( Index.opclasses ). Added support for partial indexes ( Index.condition ). Added the NullIf and Reverse database functions, as well as many math database functions . Setting the new ignore_conflicts parameter of QuerySet.bulk_create() ... ... 推奨 します。 Django 2.2 の新機能 ¶ Constraints ¶ The new CheckConstraint and UniqueConstraint classes enable adding custom database constraints. Constraints are added to models using the Meta.constraints option. マイナーな機能 ¶ django.contrib.admin ¶ Ad ... elements. The new BTreeIndex , HashIndex and SpGistIndex classes allow creating B-Tree , hash , and SP-GiST indexes in the database. BrinIndex now has the autosummarize parameter. The new search_type parameter of SearchQuery allows searching for a phrase ... operator classes ( Index.opclasses ). Added support for partial indexes ( Index.condition ). Added the NullIf and Reverse database functions, as well as many math database functions . Setting the new ignore_conflicts parameter of QuerySet.bulk_create() ... ... isting, synchronous code. It should have no noticeable effect on any existing Django projects. JSONField for all supported database backends ¶ Django now includes models.JSONField and forms.JSONField that can be used on all supported database backends. B ... .JSONField , plus the related form field and transforms, you should adjust to use the new fields, and generate and apply a database migration. For now, the old fields and transforms are left as a reference to the new ones and are deprecated as of this re ... er now supports negative integers. django.contrib.postgres ¶ The new BloomIndex class allows creating bloom indexes in the database. The new BloomExtension migration operation installs the bloom extension to add support for this index. get_FOO_display() ... ... スを定義する ¶ Django でデータベースを使う最初のステップは、利用するデータベースサーバーを Django に教えることです。これは、 DATABASES の設定で行います。この設定は、データベースへのエイリアスです。Django を通してデータベースを参照するためのデータベースエイ ... リアスを、辞書にマッピングします。この辞書の設定の詳細は、 DATABASES ドキュメントで説明しています。 データベースには、選択した任意のエイリアスを付けることができます。しかし、エイリアス defau ... わちデフォルトの PostgreSQL データベースと users という名前の MySQL データベースを定義した settings.py スニペットの例です。 DATABASES = { "default" : { "NAME" : "app_data" , "ENGINE" : "django.db.backends.postgresql" , "USER" : "postgres_user" , "PASSWORD ... 2026年10月08日