This week, I let a PR get too big . Everything in the PR relates to one another, but it could have been broken up into more manageable pieces. I just kept having one little thing to fix! And now, it’s at 400+ lines of code changes across 16 files. Yikes! Instead of beating myself up about it, I thought I would talk about what makes this PR so unwieldy. What’s wrong with it? In short: it does too…
Daily Art Thanks to the recommendation of a friend who knew I was trying to do more art, I’ve been following @andrea.nelson.art on Instagram and trying out some of her art projects for myself. I took two weeks off at the end of 2022, and I spent most of it making art, and it was delightful. I’ve never really done much art. I’m “not good at it.” But then eight years ago I became a Big Sister to a…
TILs Adding extra fields to the list view in the Django Admin Adding ability to search in the Django Admin Adding filtering functionality to the Django Admin Adding a custom field to the Django admin list display ficography Ficography is my attempt to build a better system for tracking the fanfiction I want to read. I spent some time this week creating sample data, making the Django admin work,…
Week ending 11-4-22 New TILs: I'm trying to work in public more, and break up the things I learn into smaller chunks, and practice more writing, so this week I distilled wha I learned from GH Actions into some TILs. Running an action conditionally Setting output for a step in a job, so a different job can use it Making one job in a workflow depend on another job Parsing JSON output from a GitHub…
I’m working on a way to track my fanfiction reading, and using that as an excuse to learn GitHub Actions. I’ve posted 7 new TILs on small things you can do with GitHub Actions and wanted to share those. My personal experience with learning GitHub Actions has been… interesting. The syntax is very different than what I am expecting, and I don’t always predict correctly whether to use the ${{ }}…
DjangoCon US 2022 I just got back from my first in-person conference in more than three years! DjangoCon US 2022 in San Diego, CA accomplished everything a conference is supposed to — I feel inspired, energized, and motivated. I’m planning on doing a longer DjangoCon US post once the talks come out on YouTube so I can link to the ones that spoke the loudest to me, but suffice it to say, the talks…
In which I talk about super-slow API endpoints and how I fixed them, why it’s okay that a pie chart can add up to more than 100% (spoiler: it’s not really a pie chart and dealing with money is hard), and link you to my 3-part series on What You Should Know About DRF.
Sometimes the endpoints you get when you use a ModelViewSet aren't enough and you need to add extra endpoints for custom functions. To do this, you could use the APIView class and add a custom route to your `urls.py` file, and that would work fine. But if you have a viewset already, and you feel like this new endpoint belongs with the other endpoints in your viewset, you can use DRF's @action…
If you came here from Part 1 of What You Should Know About Django REST Framework, you may be wondering why I just walked you through a bunch of source code. We stepped through that code because if you know what the main methods of the ModelViewSet do and how they work, you know where to go when you want to tweak the behavior of your viewset. You can pull out the method that contains what you want…
One of the things I hear people say about Django is that it's a "batteries included" framework, and Django REST Framework is no different. One of the most powerful of these "batteries" is the ModelViewSet class, which is more of a "battery pack," in that it contains several different batteries. If you have any experience with Django's class-based views, then DRF's viewsets will hopefully look…
In looking back over the PRs I submitted this week for my main client, who has a microservice architecture, I see that I was fixing a lot of small, annoying bugs. These bugs were introduced as part of a rewrite I’m working on to improve the performance of a few API endpoints in one of the microservices. These endpoints depend on getting a lot of data from another microservice and we made some…
I’ll be honest: I was incredibly distracted at work this week. I had a lot of goals for this week that just did not happen. But I was able to solve a couple problems and make some progress! One of my goals for 2021 is to share what I’m working on more frequently, and I really like seeing Simon Willison’s Weeknotes posts as well as his TILs , so I’m going to try to copycat those this year. Amazon…
Every Django model comes with its own model manager. The manager is how you interact with your Django models to do database queries. In this post, learn how to override the built-in model manager to create your own custom manager.
This week I needed to manipulate the privacy of a Wagtail page programmatically. The Wagtail docs show you how to edit page privacy in the admin UI, but it doesn't peek behind the curtain to show you the code. The example here is a result of my Google searching.
Notebooks aren’t just for journaling and to-do lists. They can also be valuable tools for learning, personal organization, and professional development.
Every day is a new adventure in a new job. I came into my job at REVSYS with not much production Python experience and my colleagues have been kind enough to share some time-saving and frustration-reducing libraries with me as I've been learning. This Friday, I'm sharing five libraries (technically, four libraries and a repo) that I've learned about in the last three months and fallen pretty much…
In the spirit of starting 2018 off with a more confident step, however, I kept the focus on the results of the year, which were often beautiful, inspiring, funny, and joyful. Here's to a new year and a new 365 days of memories.
Because I have worked remotely full-time for the past three years and it suits me pretty well, people ask me a lot about how working remotely works in practice. How did you get your boss on board? Do you really wear pajamas all day? What about loneliness? Read on.