... zone are different, to clarify how the value inserted in the field will be interpreted. Using database cursors as context managers Prior to Python 2.7, database cursors could be used as a context manager. The specific backend's cursor defined the behavi ... ext manager. The behavior of magic method lookups was changed with Python 2.7 and cursors were no longer usable as context managers. Django 1.7 allows a cursor to be used as a context manager. That is, the following can be used: with connection . cursor ... ' or ending it with '+' . F expressions support the power operator ( ** ). The remove() and clear() methods of the related managers created by ForeignKey and GenericForeignKey now accept the bulk keyword argument to control whether or not to perform oper ... ... abase routers aren't in use or if no apps can be migrated to the database ( #27054 , #27110 , #27142 ). Removed duplicated managers in Model._meta.managers ( #27073 ). Fixed contrib.admindocs crash when a view is in a class, such as some of the admin vie ... ... a whole tree of relationships, not just the top-level model in the initial QuerySet . This copying is also done in related managers, even though fetch modes don't affect such managers' queries. Available modes Referencing fetch modes Fetch modes are defi ... ... en file content ( #36191 ). Fixed a regression in Django 5.1 where the count and exists methods of ManyToManyField related managers would always return 0 and False when the intermediary model back references used to_field ( #36197 ). Fixed a regression i ... ... を参照ください。 スキーマ・オペレーション CreateModel class CreateModel ( name , fields , options = None , bases = None , managers = None ) [ソース] プロジェクトの履歴に新たなモデル、そしてデータベース上に対応するテーブルを作成します。 name は models.py ... me" という形式の文字列を含めることができます。このパラメータが空の場合、デフォルトでは標準の models.Model から継承します。 managers は (マネージャ名, マネージャのインスタンス) という 2 値のタプルのリストを受け取ります。マイグレーションの間はリスト内で最初 ... スが使用するためにこれらの変更を保持します。 options はオプション名と値をマッピングした辞書である必要があります。 AlterModelManagers class AlterModelManagers ( name , managers ) [ソース] マイグレーション中に利用可能なマネージャを変更します。 AddField clas ... ... ional parameters ( fail_silently and later) must be passed as keyword arguments to get_connection() , mail_admins() , mail_managers() , send_mail() , and send_mass_mail() . All parameters must be passed as keyword arguments when creating an EmailMessage ... g HTTPS during the Django 6.x release cycle. The URLIZE_ASSUME_HTTPS transitional setting is deprecated. Setting ADMINS or MANAGERS to a list of (name, address) tuples is deprecated. Set to a list of email address strings instead. Django never used the n ... oicesType is removed. The Prefetch.get_current_queryset() method is removed. The get_prefetch_queryset() method of related managers and descriptors is removed. get_prefetcher() and prefetch_related_objects() no longer fall back to get_prefetch_queryset() ... ... or the third call. Site . objects . clear_cache () current_site = Site . objects . get_current () CurrentSiteManager class managers. CurrentSiteManager もし Site があなたのアプリケーションで重要な役割を果たしているなら、モデルに CurrentSiteManager を使う ... を明示的にモデルに追加することで使用します。例えば: from django.contrib.sites.models import Site from django.contrib.sites.managers import CurrentSiteManager from django.db import models class Photo ( models . Model ): photo = models . FileField ( upload ... has a field called publish_on , demonstrates this: from django.contrib.sites.models import Site from django.contrib.sites.managers import CurrentSiteManager from django.db import models class Photo ( models . Model ): photo = models . FileField ( upload ... ... o use the base unittest library, you can -- you just won't get any of the nice new unittest2 features. Transaction context managers Users of Python 2.5 and above may now use transaction management functions as context managers. For example: with transact ... view. Support for lookups spanning relations in admin's list_filter . Support for HttpOnly cookies. mail_admins() and mail_managers() はメッセージにHTMLコンテンツを簡単に添付できるようになりました。 EmailMessage now supports CC's. Error emails now includ ... ... igration crash when adding new relations to models ( #24573 ). Fixed a migration crash when applying migrations with model managers on Python 3 that were generated on Python 2 ( #24701 ). Restored the ability to use iterators as queryset filter arguments ... ... eldset> ( #36949 ). Fixed a bug in Django 6.0 where the fields.E348 system check did not detect name clashes between model managers and related_name s for non-self-referential relationships ( #36973 ). ... 2026年10月08日