开发者

django - print multiple pages

Currently i have a listing of all of my "projects" in a modeladmin. i have set ModelAdmin.list_per_page to 50 and my listing is split in 8 pages. However if i need to print the whole list i have to click each page and then print the webpage.

can i creat开发者_JS百科e a second modeladmin for the same model so i can have a greater list_per_page value when i need to print?

Is there a better way to do it?

any idea is appreciated thanks


As far as I'm concerned, only one ModelAdmin per model is possible.

You could add ?all to the url in address bar to list all items to make your life a bit easier, but this unfortunately only works up to a certain total amount of items (200 I guess).

You might also consider increasing the number of items per page to a number that is a good balance between the convenience of browsing it in your browser and printing it.

However, depending on the reason you want to print the page, I would suggest you create a view in your website that generates the required table for easy printing. That allows you to add some extra parameters to your print too, like the printing date (although your browser might put it somewhere too).

You could also consider generating a pdf file, or something like that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜