PHP 的表格括号技巧是为了 Django 的 ___?

Mat*_*att 5 php python django

在 PHP 中,您可以创建具有以下名称的表单元素:

category[1]
category[2]
Run Code Online (Sandbox Code Playgroud)

甚至

category[junk]
category[test]
Run Code Online (Sandbox Code Playgroud)

当表单发布后,category它会自动变成一个不错的字典,例如:

category[1] => "the input value", category[2] => "the other input value"
Run Code Online (Sandbox Code Playgroud)

有没有办法在 Django 中做到这一点?request.POST.getlist不太正确,因为它只是返回一个列表,而不是一个字典。我也需要钥匙。