Ephes Blog

Miscellaneous things. Mostly Weeknotes and links I stumbled upon.


Weeknotes 2023-05-22

"sorry about that, i wasn’t making a strange face because of what you said on the team sync meeting, but because i’ve been watching my own camera the whole time, and at all times i am nothing but a horse discovering his own reflection" --henry ✷

exploded_vacation_luggage_in_citroen


Less busy week, good. Created a first release for cast-vue, a Vue.js theme for django-cast. It's a weird mix of pre-rendered html via Django and classic http API based SPA. I like it 😆. To support cast-vue, some changes had to be made to django-cast, so there's a new release for it too. The only major feature that is missing from cast-vue in comparison to the bootstrap ones is comments.

Articles

Software

Podcasts


TIL: Using django-filter Filtersets in Wagtail API v2

For this blog I have a "Filter / Full text search" box at the top. Now I wanted to build a Vue.js theme for the Wagtail based blog engine. Since I now have to fetch all posts via the Wagtail API v2, I wondered if it would be possible to keep the filter box and just pass the form data as query parameters to the API (which is based on Django REST framework).

When I tried to add one of the query parameters, I got the following error message from DRF:

Query parameter is not an operation or a recognized field: date_facets

Fortunately, it was relatively easy to combine my existing django-filter filterset called PostFilterset with a slightly modified PagesAPIViewSet by adding a use_post_filter flag:

...
class FilteredPagesAPIViewSet(PagesAPIViewSet):
    def get_filtered_queryset(self) -> QuerySet:
        # allow additional query parameters from PostFilterset + use_post_filter flag
        additional_query_params = PostFilterset.Meta.fields + ["use_post_filter"]
        self.known_query_parameters = self.known_query_parameters.union(additional_query_params)
        queryset = super().get_queryset()
        return PostFilterset(
            data=self.request.GET.copy(), queryset=queryset, fetch_facet_counts=True).qs

    def get_queryset(self):
        if self.request.GET.dict().get("use_post_filter", "false") == "true":
            return self.get_filtered_queryset()
        return super().get_queryset()

...
wagtail_api_router = WagtailAPIRouter("cast:api:wagtail")
wagtail_api_router.register_endpoint("pages", FilteredPagesAPIViewSet)

Weeknotes 2023-05-15

"Adam Smith's invisible hand — the idea that free markets lead to efficiency as if guided by unseen forces — is invisible, at least in part, because it is not there." --Joseph Stiglitz

Octupus and Kids with scarlet fever

Another busy week for me. Time for a regular week, I think. Or vacation or something. The pytest workshop was a lot of fun and we used a simple mastodon client as a sample application. Mastodon.py is great and now I have to fight the urge to build some mastodon bots by connecting GPT-4 (yay, got API access) to the fediverse (what could possibly go wrong?). Since we used bootstrap5 for the pytest sample app, I thought: How hard could it be to create a bootstrap5 theme for django-cast? So now this site and python-podcast are both bootstrap5. Also some health issues - the kids were sick with scarlet fever and some serious dental work 🦷 for me. Fun.

Software

Podcasts


Weeknotes 2023-05-08

"The worst thing that ever happened in software engineering was when Kirk asked Scotty how long something would take and Scotty said thirty minutes and Kirk said you’ve got five and Scotty got it done in five and impressionable children watched this and grew up to become managers." --Isaac Freeman
Pytest Knolling


Had a busy week. I have been working on a Vue.js theme for django-cast. It's not finished yet, but enough to see how it works. Hope to get back to it soon. Then we produced a new podcast episode about building GUI applications with Python and miaplan. It was a lot of fun. And then I did a stream about the reading of the nlp with transformers book. Doing so many different things and making meaningful progress is kind of hard. Speaking of which: I also had to do some more preparation for the upcoming pytest course.

Articles

Weeknotes

Mastodon / Twitter

Software

Books

Videos

Podcast


Weeknotes 2023-05-01

I'm a normal person, in the mathematical sense. --Johannes Spielmann
Midjourney generated tulips


Last week, I worked on updating django-cast to support Wagtail 5 (which is set to release tomorrow) and Django 4.2:

  • Released version 0.3.0 of wagtail_srcset, which includes a workaround for the image_node.filter_spec -> image_node.filter_specs renaming in Wagtail 5, along with some tox fixes and test image cleanup after testing.
  • Released version 0.2.14 of django-cast , adding support for Wagtail 5 and Django 4.2.
  • Ran python-podcast.de and wersdoerfer.de on the Wagtail 5 release candidate and Django 4.2 for a week to identify any potential issues (none found).

Another topic I focused on last week was Vue.js. I attended the revived Vue.js Cologne meetup, which was enjoyable, and began developing a Vue theme for django-cast. I even managed to record a live-stream about it. Integrating Vue.js into Django proved easier than anticipated, perhaps due to assistance from my LLM robot friends. While I'm not a huge fan of single-page applications (SPAs) and frontend frameworks in general, I want to keep my options open and be able to justify my preferences.

In terms of meetups, I attended a Java User Group Düsseldorf event to see the talk "Die Welt vor 10 Jahren mit Stefan Tilkov / Eberhard Wolff - live von der RheinJUG". I found it quite interesting. However, despite attending numerous local meetups, I didn't recognize any of the attendees. It's fascinating how disjunct various IT-related communities can be.

Melia Hotel RheinJUG

In "Slavoj Žižek: „Paradoxien der Mehrlust“ - Ein gegenwartskritischer Rundumschlag" (starting at 06:00), an amusing moment arises as Žižek discusses LLM creativity. He claims that human creativity stems from our ability to harness contingency in random mistakes, referencing Heinrich von Kleist. Ironically, his poetic description of what LLMs can't do is spot-on for how they function technically. The 'temperature' parameter even allows for adjustable creativity by controlling how much contingency is added. Although I have often expressed my disdain for uninformed discussions about topics I am knowledgeable in, this instance has proven that they can be surprisingly entertaining, and I stand corrected.

Articles

Software

Mastodon / Twitter

Weeknotes

Video

Papers

Podcast

Out of Context Images