From petef4+usenet at gmail.com Sun Jul 3 04:42:41 2022 From: petef4+usenet at gmail.com (Pete Forman) Date: Sun, 03 Jul 2022 09:42:41 +0100 Subject: [Flask] Hello, new to list References: Message-ID: Dave Pawson writes: > Is there a more used forum, or is Flask declining? On 1 July 2022 David Lord @davidism tweeted: > I've done it. I've achieved the open source maintainer platinum > trophy. There are no open issues or pull requests on Flask, a > framework downloaded 75 million times in the last month. So it's not declining, just working well. Personnally I've used Flask commercially and for my own web site. -- Pete Forman https://payg.pythonanywhere.com/ From dave.pawson at gmail.com Sun Jul 3 05:01:25 2022 From: dave.pawson at gmail.com (Dave Pawson) Date: Sun, 3 Jul 2022 10:01:25 +0100 Subject: [Flask] A Question. app.py structure Message-ID: I've 'played' with flask long enough to use it seriously. Scenario: Book keeping, html user interface, mariadb mysql, flask + jinja code I've working forms, database entry, read from db etc. Now looking at structure? It would appear that app.py (whatever you use) needs to contain or import most of the code? Are there any lessons to be learned for this structure and how it interacts with templates/x.html E.g. Show x.html to user, return x, test x, show templates/y.html Should I be thinking of structuring app.py as any other app or... It would seem app.py cannot (am I wrong) be a class, just call up imported classes as needed? Any advice in this area please. TiA -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. From ccp at drsb.com.my Sun Jul 3 21:39:00 2022 From: ccp at drsb.com.my (CCP Dragonedge) Date: Mon, 4 Jul 2022 09:39:00 +0800 Subject: [Flask] Printing on formatted paper? Message-ID: Hi, I created a very simple inventory system for my company using Flask. One of the functions in my system allows users to print out a list of inventory. Kind of cheating - I just create a CSV file, and tell the user to download it and use Excel to print. I wonder, however, if there is a way to do "nice" printing. For example, like on a formatted sheet of paper (e.g. invoices). Can you actually manipulate printing at the Python / Flask level? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.pawson at gmail.com Mon Jul 4 02:44:05 2022 From: dave.pawson at gmail.com (Dave Pawson) Date: Mon, 4 Jul 2022 07:44:05 +0100 Subject: [Flask] Printing on formatted paper? In-Reply-To: References: Message-ID: On Mon, 4 Jul 2022 at 02:39, CCP Dragonedge wrote: > > Hi, > > I created a very simple inventory system for my company using Flask. > > One of the functions in my system allows users to print out a list of inventory. Kind of cheating - I just create a CSV file, and tell the user to download it and use Excel to print. > > I wonder, however, if there is a way to do "nice" printing. For example, like on a formatted sheet of paper (e.g. invoices). Can you actually manipulate printing at the Python / Flask level? HTML->Word->printer? >From Python, call up (shell) XSLT and convert to PDF via XSL-FO? HTH -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. From ccp at drsb.com.my Mon Jul 4 03:19:12 2022 From: ccp at drsb.com.my (CCP Dragonedge) Date: Mon, 4 Jul 2022 15:19:12 +0800 Subject: [Flask] Printing on formatted paper? In-Reply-To: References: Message-ID: Thank you. I will give it a try. p On Mon, 4 Jul 2022, 14:44 Dave Pawson, wrote: > > > I wonder, however, if there is a way to do "nice" printing. For example, > like on a formatted sheet of paper (e.g. invoices). Can you actually > manipulate printing at the Python / Flask level? > > HTML->Word->printer? > > From Python, call up (shell) XSLT and convert to PDF via XSL-FO? > > HTH > > > > -- > Dave Pawson > XSLT XSL-FO FAQ. > Docbook FAQ. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hi at jnnkb.eu Mon Jul 4 05:15:58 2022 From: hi at jnnkb.eu (hi at jnnkb.eu) Date: Mon, 04 Jul 2022 12:15:58 +0300 Subject: [Flask] Printing on formatted paper? In-Reply-To: References: Message-ID: <85CA8E9E-B150-4F7B-99BD-56EBF911EDA1@jnnkb.eu> Hey, I think the easiest way is probably to create a route that contains the information you want in a nicely formated HTML and then let the browser convert that to a PDF. You could also use your normal route (e.g. your standart invoices route) and provide some additional CSS to format it nicely for printing. Maybe this rather old blog post helps you getting started: https://drublic.de/blog/printing-the-web Greetings On July 4, 2022 4:39:00 AM GMT+03:00, CCP Dragonedge wrote: >Hi, > >I created a very simple inventory system for my company using Flask. > >One of the functions in my system allows users to print out a list of >inventory. Kind of cheating - I just create a CSV file, and tell the user >to download it and use Excel to print. > >I wonder, however, if there is a way to do "nice" printing. For example, >like on a formatted sheet of paper (e.g. invoices). Can you actually >manipulate printing at the Python / Flask level? > >Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: