... ribute: >>> result . status SUCCESSFUL >>> result . return_value 42 If the Task has not finished executing, or has failed, ValueError is raised. >>> result . status RUNNING >>> result . return_value Traceback (most recent call last): ... ValueError : Task ... kError containing information about error raised during the execution: >>> result . errors [ 0 ] . exception_class <class 'ValueError'> Note that this is just the type of exception, and contains no other values. The traceback information is reduced to a st ... ... てるには、オブジェクトを保存する必要があることに注意してください。例えば、保存されていない Place で Restaurant を作成すると ValueError が発生します: >>> p3 = Place ( name = "Demon Dogs" , address = "944 W. Fullerton" ) >>> Restaurant . objects . create ( pl ... ace = p3 , serves_hot_dogs = True , serves_pizza = False ) Traceback (most recent call last): ... ValueError : save() prohibited to prevent data loss due to unsaved related object 'place'. Restaurant.objects.all() は Place のセット ... ... ます。 to_python(self, value) メソッドで、マッチした文字列をビュー関数に渡す型に変換します。与えられた値を変換できない場合は ValueError を発生させます。 ValueError はマッチしないと解釈され、別のURLパターンがマッチしない限り、結果として404レスポンスがユーザー ... されます。 to_url(self, value) メソッドで、 Python の型を URL で使用する文字列に変換します。与えられた値を変換できない場合は ValueError を発生させる必要があります。 ValueError はマッチしないと解釈され、結果として reverse() は NoReverseMatch を発生させます。 ... URL name, reverse() matches the number of arguments and the names of the keyword arguments. Path converters can also raise ValueError to indicate no match, see 独自のパスコンバータを登録する for details. URL の名前空間 はじめに URL名前空間を使用すると、異な ... ... ( name = "Django" ) >>> book . author = Author ( name = "John" ) >>> book . save () Traceback (most recent call last): ... ValueError : save() prohibited to prevent data loss due to unsaved related object 'author'. A similar check on assignment to reverse ... as removed in Django 1.8.5. Assigning unsaved objects to a ForeignKey , GenericForeignKey , and OneToOneField now raises a ValueError . Previously, the assignment of an unsaved object would be silently ignored. For example: >>> book = Book . objects . crea ... r will be raised to prevent data loss: >>> book . author = Author ( name = "john" ) Traceback (most recent call last): ... ValueError : Cannot assign "<Author: John>": "Author" instance isn't saved in the database. If you require allowing the assignment of ... ... 脆弱性を回避するために、 ClearableFileInput と FileInput フォームウィジェットは、 multiple HTML 属性が設定されている場合に ValueError を発生させるようになりました。例外を防ぎ、以前の動作を維持するには、 allow_multiple_selected を True に設定してください。 ... ... 脆弱性を回避するために、 ClearableFileInput と FileInput フォームウィジェットは、 multiple HTML 属性が設定されている場合に ValueError を発生させるようになりました。例外を防ぎ、以前の動作を維持するには、 allow_multiple_selected を True に設定してください。 ... ... er_id" ) -- OK MAX ( "product_id" , "order_id" ) -- ERROR 複合主キーは複数のカラム表現を含むため、このような関数に渡すと、 ValueError が発生します。 ただし Count だけは例外で、複合主キーでも利用できます。 Max ( "order_id" ) # OK Max ( "pk" ) # ValueError C ... ... 入する前に保存する必要があることに注意してください。たとえば、保存されていない Reporter で Article を作成すると、次のように ValueError が発生します。 >>> r3 = Reporter ( first_name = "John" , last_name = "Smith" , email = "john@example.com" ) >>> Article . ... eadline = "This is a test" , pub_date = date ( 2005 , 7 , 27 ), reporter = r3 ... ) Traceback (most recent call last): ... ValueError : save() prohibited to prevent data loss due to unsaved related object 'reporter'. Article オブジェクトはリレーション先オブ ... ... 。 言語コードが500文字を超える場合、 strict が True の場合、または汎用バリアントが存在せず strict が False の場合には、現在 ValueError が発生するようになりました。 ... ... edRelation() のクラッシュを引き起こしていました ( #35135 )。 FilteredRelation() は現在、右辺としてクエリセットを持つ場合に ValueError を発生させます。 Django 5.0 において、ベースのクエリセットが prefetch_related() を使用していた場合に、 dumpdata 管理コマン ... 2026年10月08日