python - If I need to display other fields on the Django page, should I change the data table structure and add a field? Or search and add it in the view function, and then display it in tem.
大家讲道理
大家讲道理 2017-06-30 09:54:23
0
1
1069

If I need to display other fields on the Django page, should I change the data table structure and add a field? Or should it be displayed to tem after processing is completed in the view function? Which of the two methods is better at the system level? Can you introduce the advantages and disadvantages of these two methods? Any suggestions will help me

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
ringa_lee

I don’t know if I understand you correctly...
If: For this table, this field is a necessary attribute, then I personally recommend modifying the table and adding fields; and if it is only on a specific occasion (page) If you need to display this field additionally, you can do back-end processing (through setattr or other methods). For example, the page needs to display user information. By default, it already has name and age fields. If you need to add gender, you can modify the data table; if If you just need to display how many articles this person has published on a certain page, then you can do back-end processing.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!