TypeError: '<' not supported instances of 'str' and 'builtin_function_or_method' solution method

Recently, I encountered this situation when writing the backend using flask and python. Many answers on the Internet cannot solve the problem. I will share my solution.
I found that the dictionary id was not quoted, so no error would be reported when writing. However, an error would be reported when accessing the front end after startup. It may be that the underlying sorting mechanism can only sort strings. Although it will add the default id, it will not report the error on its own. Adding it manually without quotes will cause an error.
Insert image description here

Guess you like

Origin blog.csdn.net/returnadsss/article/details/128879886