What can I do if there is no field displayed in the list?

hou15169492792 注册会员
2023-02-26 20:08

This answer partially references GPT and GPT_Pro to solve the problem better.
First, check whether the field actually exists in the database. If it does, go ahead and check. Second, you need to check whether the corresponding table Settings are incorrect, such as whether the field is checked to display, or whether the position of the field is set correctly(for example, at the front of the displayed list). Also, check whether it is possible that the front-end JS may have masked it, such as being set to hide, or deleted.

Finally, if nothing works, we can locate the problem by adding a debug code to the server, for example, adding console.log() to the code to print out the field information we want to see, to help us find the problem.

// 添加 debug 代码
console.log('pen field: ', penField)

The above method can help you locate the problem and solve the problem that no field is displayed in the list.
If the answer is helpful, please accept it.

lidongmei_ 注册会员
2023-02-26 20:08

the reference answer GPT ᴼ ᴾ ᴱ ᴺ ᴬ ᴵ < br / > the error message says in the query field list can't find the fields" drfstudy_student. Classes id ". This means that your code requests this field when executing a database query, but the field does not actually exist in the relevant table.

First, you can check the model class definition to make sure there is a foreign key field named "classes" in the "drfstudy_student" model class. If this field does not exist, you need to add it.

If the field does exist, it is possible that the database is not synchronized to the latest model definition. To synchronize your database, run Djangos database migration command as follows:

python manage.py makemigrations
python manage.py migrate

If the above steps do not solve the problem, then you need to further examine the code in the view function to ensure that all fields requested in the query exist in the relevant table.

About the Author

Question Info

Publish Time
2023-02-26 20:08
Update Time
2023-02-26 20:08