Approaching Wapp application
(1) By Vetelko (vetelko) on 2025-01-06 16:58:02 [link] [source]
Hello all,
can someone please take a look at my code and tell me if I understand the philosophy of writing a Wapp application correctly? I don't want to post spaghetti code—you must all be full already—so I published the code as a gist on Github.
V
(2) By anonymous on 2025-01-07 12:07:00 in reply to 1 [link] [source]
Im not an expert but it looks good enough to me that I think you got the essence of using the templating with TCL portion. I myself only use it for a similar type project but I was unaware you could pull from sqlite3 db like that. Right now and the foreseeable future I use a bunch of hard coded lists in the same TCL script so I have it super portable but that is neat. Also the creation of functions for modular CSS styling is something I will steal too instead of hardcording via <style>.
Cheers broski
(3.3) By Vetelko (vetelko) on 2025-01-07 14:50:41 edited from 3.2 in reply to 2 [source]
Thank you for your reply. The fact that db eval as a database procedure simultaneously generates HTML while iterating through the result set is exactly an approach I need to deal with :)
Right with the first example I looked at, I was unlucky because the curly braces of db eval
were so far apart that I didn’t realize it was generating HTML. I was staring at it, trying to figure out how it was actually done, looking for the resultset returned from db eval
and some foreach
cycle :)
Thanks to how drh uses it in the Wapp examples, I understand this better too.
I take it as a feature.