How can i display my data in database and export it to pdf -Django

十年热恋 提交于 2019-12-02 13:03:17
Daniel Schwarze

Your variable x won't return anything you can print into the PDF, because its a queryset and not a couple strings attached to each other. I just started working with Django and getting the values works something like this:

x = Item.objects.all[0].name

This code snippet will assign the vale of the row name of the first entry in your Item table to the variable x.

For more Information I can only recommend reading the Tutorial about writing queries on the django website.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!