... 細については、 フィールドのドキュメント を参照してください。 フィールドの解体 ¶ __init__() メソッドとは対照的なものとして、 deconstruct() メソッドがあります。これは モデルのマイグレーション 中に使用されるもので、新しいフィールドのインスタンスを取得する方法、 ... するためにどの引数を __init__() に渡すかを指示します。 継承元のフィールドの上に追加のオプションを追加していない場合、新しい deconstruct() メソッドを記述する必要はありません。 ただし、 __init__() で渡される引数を変更する場合( HandField のように)、渡される値 ... を補足する必要があります。 deconstruct() 関数は4要素のタプルを返します。それは、フィールドの属性、インポートするフィールドクラスのフルパス、位置引数(リスト型)、 ... ... 細については、 フィールドのドキュメント を参照してください。 フィールドの解体 ¶ __init__() メソッドとは対照的なものとして、 deconstruct() メソッドがあります。これは モデルのマイグレーション 中に使用されるもので、新しいフィールドのインスタンスを取得する方法、 ... するためにどの引数を __init__() に渡すかを指示します。 継承元のフィールドの上に追加のオプションを追加していない場合、新しい deconstruct() メソッドを記述する必要はありません。 ただし、 __init__() で渡される引数を変更する場合( HandField のように)、渡される値 ... を補足する必要があります。 deconstruct() 関数は4要素のタプルを返します。それは、フィールドの属性、インポートするフィールドクラスのフルパス、位置引数(リスト型)、 ... ... "hint" : "Use GenericIPAddressField instead." , "id" : "fields.E900" , # pick a unique ID for your field. } __init__() 、 deconstruct() 、 get_internal_type() などのデータベースマイグレーションで動作するために必要なフィールドのメソッドは残しておく必要があり ... れていないメソッド 任意のクラスへのリファレンス (ただし、モジュールのトップレベルのスコープにいなければならない) カスタムの deconstruct() メソッドを持つすべてのオブジェクト ( 以下を参照 ) Changed in Django 6.0: Serialization support for zoneinfo.ZoneInfo ins ... 値がマイグレーションでどのように表示されるかを示す文字列と、マイグレーションで必要なインポートのセットを返す必要があります。 deconstruct() メソッドを追加する ¶ 自作のカスタムクラスに deconstruct() メソッドを実装することで、インスタンスを Django にシリアライズ ... ... "hint" : "Use GenericIPAddressField instead." , "id" : "fields.E900" , # pick a unique ID for your field. } __init__() 、 deconstruct() 、 get_internal_type() などのデータベースマイグレーションで動作するために必要なフィールドのメソッドは残しておく必要があり ... れていないメソッド 任意のクラスへのリファレンス (ただし、モジュールのトップレベルのスコープにいなければならない) カスタムの deconstruct() メソッドを持つすべてのオブジェクト ( 以下を参照 ) Changed in Django 6.0: Serialization support for zoneinfo.ZoneInfo ins ... 値がマイグレーションでどのように表示されるかを示す文字列と、マイグレーションで必要なインポートのセットを返す必要があります。 deconstruct() メソッドを追加する ¶ 自作のカスタムクラスに deconstruct() メソッドを実装することで、インスタンスを Django にシリアライズ ... ... and to enable easier addition of composite keys in future releases of Django, the Field API now has a new required method: deconstruct() . This method takes no arguments, and returns a tuple of four items: name : The field's attribute name on its parent mod ... es. This change should not affect you unless you write custom Field subclasses; if you do, you may need to reimplement the deconstruct() method if your subclass changes the method signature of __init__ in any way. If your field just inherits from a built-in ... Django field and doesn't override __init__ , no changes are necessary. If you do need to override deconstruct() , a good place to start is the built-in Django fields ( django/db/models/fields/__init__.py ) as several fields, includi ... ... and to enable easier addition of composite keys in future releases of Django, the Field API now has a new required method: deconstruct() . This method takes no arguments, and returns a tuple of four items: name : The field's attribute name on its parent mod ... es. This change should not affect you unless you write custom Field subclasses; if you do, you may need to reimplement the deconstruct() method if your subclass changes the method signature of __init__ in any way. If your field just inherits from a built-in ... Django field and doesn't override __init__ , no changes are necessary. If you do need to override deconstruct() , a good place to start is the built-in Django fields ( django/db/models/fields/__init__.py ) as several fields, includi ... ... t to LogoutView , for equivalence with the function-based logout() view ( #28513 ). Omitted pages_per_range from BrinIndex.deconstruct() if it's None ( #25809 ). Fixed a regression where SelectDateWidget localized the years in the select box ( #28530 ). Fix ... ... n time picker widget displaying "undefined" ( #29109 ). Fixed crash with QuerySet.order_by(Exists(...)) ( #29118 ). Made Q.deconstruct() deterministic with multiple keyword arguments ( #29125 ). You may need to modify Q 's in existing migrations, or accept ... ... t to LogoutView , for equivalence with the function-based logout() view ( #28513 ). Omitted pages_per_range from BrinIndex.deconstruct() if it's None ( #25809 ). Fixed a regression where SelectDateWidget localized the years in the select box ( #28530 ). Fix ... ... n time picker widget displaying "undefined" ( #29109 ). Fixed crash with QuerySet.order_by(Exists(...)) ( #29118 ). Made Q.deconstruct() deterministic with multiple keyword arguments ( #29125 ). You may need to modify Q 's in existing migrations, or accept ... 2026年10月08日