ユーザーを転送するURLを作成するために使用しているフォームがあります。呼び出された私のフォームにはSearchForm
、いくつかの BooleanFields、いくつかの ModelChoiceFields、いくつかの CharFields などがあります。フィールドは に設定されています) のようなrequired=False
文字列に追加します。すべてのフィールドを反復処理し、次のようにする方法はありますか:search
"FieldName=Value"
for item in form:
name=item.name
value=item.value
name にはフィールドの ID が入り、value にはユーザーが入力した値が入ります。
ありがとう!