Ephes Blog

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


Weeknotes 2023-06-12

, Jochen
"I was born in 1994"
- boring
- heard it before
- tells you nothing
"I was born in the year of Cotton Eye Joe"
- arouses curiosity
- who was Cotton Eye Joe
- where did he come from?
- where did he go?
- Cotton Eye Joe

-- snart


A deep dive into htmx and Alpine.js. Mixing hyperscript in weird htmx attributes with javascript in even weirder alpine attributes embedded in already weird Django template syntax is often too much for PyCharm and djhtml. But it still works - so far I can't complain. A while ago, my printer broke down. I got a new one this week. I had to deal with some bureaucracy because the refund went to a bank account that no longer exists.

Another WWDC was held and some weird hardware got announced. But on the plus side, PWAs on Apple platforms finally seem to be getting interesting. So, yay for that. I went to a meeting of the local Python user group, which was a lot of fun. And finally, summer is here, so I spent a lot of time out in the sun, barbecuing, etc.

Articles

Books

Videos

Podcasts


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
vacation in ostfriesland illustration


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 ✷

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

, 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)