Weeknotes 2024-01-15

, Jochen
May type hints never overload you,

First workweek of 2024. Recorded and published a podcast episode about Typescript and typing in general, which was a lot of fun 🎙️. For django-cast I found out that it is possible to pre-fetch all the data needed to render a list of posts or episodes and call .serve passing that data and avoid hitting the database 💡. You might to have to do some unholy things though, like monkeypatching the PageLinkHandler. I didn't expect this, but rendering a page including internal links in Wagtail will cause a database query because only the links page id is stored in the markup and the page object is needed to get the page url which is needed to render the link to html. And I haven't found a way to pass data from the page's template context to the PageLinkHandler. But it's doable. So I'll do it 😇.



Mastodon / Twitter


Return to blog