Ephes Blog

Miscellaneous things. Not sure what to put here, yet.


Weeknotes 2023-06-05

, Jochen
"I don't want to be offensive, but there is a very fine line between...
... numerator and denominator.
It's a divisive issue." --Ten

Slowly getting back to work, combining Tailwind and htmx with Django. Released a new version of django-cast which now includes all the information needed to run a SPA in front of it from a theme. This was more work than expected. To make sure there's all the information needed for a SPA theme, I built a Vue.js cast-vue theme for django-cast, which is now feature complete after adding comments and the podlove player for audio content last week. Also met with Manuel to work on training LLMs from scratch using all the Python code from GitHub.

Articles

Software

Mastodon / Twitter

Podcasts / Videos


Weeknotes 2023-05-29

, Jochen
can't wait to quit my day job and start my new landscaping company, Move Fast and Rake Things --Annika Backstrom


Holiday week. Didn't do much except for some light programming in the morning, working on the comment feature of the Vue.js theme for django-cast.

Articles

Software

Mastodon

Podcasts

Out of Context Images


Weeknotes 2023-05-22

, Jochen

"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 ✷


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

, Jochen

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

, Jochen

"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


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