Coerce in django forms
问题 What does the coerce argument do in django forms? I've read the documentation, but its not very helpful, so a good explanation with a few examples of use cases would be helpful. To quote the documentation: A function that takes one argument and returns a coerced value. Examples include the built-in int, float, bool and other types. Defaults to an identity function. 回答1: TypedChoiceField is just like ChoiceField, except ChoiceField always return unicode. With TypedChoiceField you pass a