... に接続してクエリ CREATE EXTENSION IF NOT EXISTS hstore; を実行してください。 CreateExtension class CreateExtension ( name , hints = None ) [ソース] PostgreSQL拡張モジュールをインストールする Operation サブクラスです。一般的な拡張モジュールについては、以 ... 下のサブクラスのいずれかを使用してください。 name これは必須の引数です。インストールする拡張機能の名前です。 hints New in Django 6.0. The optional hints argument will be passed as **hints to the allow_migrate() method of database routers ... to assist them in making routing decisions . BloomExtension class BloomExtension ( hints = None ) [ソース] bloom 拡張機能をインストールします。 hints New in Django 6.0. The optional hints argument will be passed ... ... きます。 データベース ルーター データベース ルーターは、以下の 4 つのメソッドを提供するクラスです: db_for_read ( model , ** hints ) model 型のオブジェクトの読み取り操作に使用するデータベースをサジェストします。 データベース操作がデータベースを選択する際 ... に役立つ追加情報を提供できる場合、それは hints 辞書で与えられます。有効なヒントの詳細は 下記 を参照してください。 サジェストがない場合は None を返します。 db_for_write ( ... model , ** hints ) Model型のオブジェクトの書き込みに使用するデータベースをサジェストします。 データベース操作がデータベースを選択する際に役 ... ... encies = [ # Dependencies to other migrations ] operations = [ migrations . RunPython ( forwards ), ] You can also provide hints that will be passed to the allow_migrate() method of database routers as **hints : myapp/dbrouters.py class MyRouter : def ... allow_migrate ( self , db , app_label , model_name = None , ** hints ): if "target_db" in hints : return db == hints [ "target_db" ] return True これをマイグレーションに利用するには、次のよう ... ns . Migration ): dependencies = [ # Dependencies to other migrations ] operations = [ migrations . RunPython ( forwards , hints = { "target_db" : "default" }), ] もし RunPython や RunSQL 操作が 1 つのモデルにしか影響しないのであれば、 model_name をヒ ... ... onstraint に置き換えます。 特別なオペレーション RunSQL class RunSQL ( sql , reverse_sql = None , state_operations = None , hints = None , elidable = False ) [ソース] データベース上で任意の SQL を実行できるようにします。Django が直接サポートしていない、 ... operations = [ migrations . AddField ( "musician" , "name" , models . CharField ( max_length = 255 ), ), ], ) オプションの hints 引数はデータベースルータオブジェクトの allow_migrate() メソッドに **hints として渡されてルーティングの決定を補助します。デ ... これは特に処理を逆の順序で行いたい場合に有用です。 RunPython class RunPython ( code , reverse_code = None , atomic = None , hints = None , elidable = False ) [ソース] マイグレーション履歴を反映して独自の Python コードを実行します。 code (与えられれば加 ... ... tension , CryptoExtension , HStoreExtension , TrigramExtension , and UnaccentExtension operations now support the optional hints parameter. This allows providing database hints to database routers to assist them in making routing decisions . django.co ... ... and RunSQL now call the allow_migrate() method of database routers. The router can use the newly introduced app_label and hints arguments to make a routing decision. To take advantage of this feature you need to update the router to the new allow_mig ... () method of database routers has changed from allow_migrate(db, model) to allow_migrate(db, app_label, model_name=None, **hints) . When model_name is set, the value that was previously given through the model positional argument may now be found insi ... de the hints dictionary under the key 'model' . After switching to the new signature the router will also be called by the RunPython an ... ... 期されます。 class CacheRouter : """A router to control all database cache operations""" def db_for_read ( self , model , ** hints ): "All cache read operations go to the replica" if model . _meta . app_label == "django_cache" : return "cache_replica" r ... eturn None def db_for_write ( self , model , ** hints ): "All cache write operations go to primary" if model . _meta . app_label == "django_cache" : return "cache_primary" retu ... rn None def allow_migrate ( self , db , app_label , model_name = None , ** hints ): "Only install the cache model on primary" if app_label == "django_cache" : return db == "cache_primary" return None デー ... ... e will be removed. It changed from allow_migrate(self, db, model) to allow_migrate(self, db, app_label, model_name=None, **hints) . Support for the syntax of {% cycle %} that uses comma-separated arguments will be removed. The warning that Signer issu ... ... check framework We've added a new System check framework for detecting common problems (like invalid models) and providing hints for resolving those problems. The framework is extensible so you can add your own checks for your own apps and libraries. ... ... try の属性) hidden (Field の属性) hidden_settings (SafeExceptionReporterFilter の属性) HiddenInput (django.forms のクラス) hints (BloomExtension の属性) (BtreeGinExtension の属性) (BtreeGistExtension の属性) (CITextExtension の属性) (CreateExtension の ... 2026年10月08日