I have several Django projects, like my timebox
or chore tracker
project.
Two fields I will often add to most models is some kind of description/memo field and a url/more field.
from django.db import models
class Project(models.Model):
# most of the model specific bits
...
# common fields I add.
description = models.TextField(blank=True)
url = models.URLField(blank=True)
I will typically allow either to be blank, since both are intended to be optional.
A name/title might be enough as a quick hint or label, but often having a longer description/memo field is essential to provide extra detail once you have enough objects.
I have mostly kept it as a plain text description (I will often use {{ obj.description|linebreaks }}
to allow a bit of formatting), though other times I will consider allowing a full markdown description.
Read More →
I tend to use my calendar and reminders to track a lot of what I want to do, but sometimes I want to manage the data externally and sync.
For certain kinds of repeating tasks, I wanted to edit a list of tasks in a group, and it seemed like csv might work.
While csv does not have a strong specification, many programming tools make it easy to work with.
The initial format I thought about was something simple.
Read More →
A friend recently wrote “our personal database
, about how they maintain a postgres database for various projects.
I wrote something similar when I wrote about my personal api
, though Rubenerd’s post made me want to write a little bit more about it.
Since I am already using django
for various projects, my personal API is also built on Django.
While I could modify thing directly using something like pgAdmin, building on Django means I can take advantage of the models
and admin
built in to Django.
Read More →
There have been a few times while working with Django
, where I have wanted to triger something only if the instance changed.
Since Django provides a robust signals system, I decided to use that for my prototype.
First we need to import the packages we will use.
from django.db import models
from django.db.models.signals import post_save, pre_save, ModelSignal
from django.dispatch import receiver
from django.forms.models import model_to_dict
Next, we want to handle our pre_save
signal.
We want to store a snapshot of the original object so that we can compare it later.
Read More →
Recently there is quite a lot of back and forth regarding ActivityPub based projects and Bluesky.
Read More →
Drinking more water.
Similar to a friend figuring out water
this is how I get myself to drink more water.
- A while back, I bought several 500 ml bottles from Daiso for about ¥ 100. At the beginning of the day I fill each of them up and put them in the fridge.
- Keep one at my desk. If I have a bottle next to me, I will reflexively drink sips while working.
- Any time I empty a bottle, I scan an nfc
tag on my desk to record it, and then get a new bottle from the fridge.
As a bonus, this also means short forced breaks throughout the day to empty water.
Read More →
3D Printing is still somewhat magical.
Several years ago, a friend gave me a ender3
that they were not using, and I have been using that for a few small projects, but it is an old printer so it is not always reliable.
Recently I have been considering 3D printing some more, and would really like to get a newer one.
Not unexpectedly, my recent youtube recommendations and now subscriptions have included quite a lot of 3D Printing, such as channels like Print Farm Academy
or Macy Makes
talking about creating 3D printing businesses or Hands on Katie
showing all kinds of things that she makes with 3D printing.
Read More →
I am not particularly fond of Kubernetes and have tried to avoid it as much as possible, but at times it feels somewhat inevitable.
In order to have a little more familiarity with how it works, I decided to go through Kubernetes the Hard Way
and setup a cluster.
Note:
If I was really going to use Kubernetes, I would likely use some project that managed it in a better way.
Going through this excercise is the same reason I went through Linux from Scratch
years ago to better understand how things were assembled together.
Read More →
One advantage of having my own personal api
is that I can put various useful scripts under a single repo and have them run.
I have been using raindrop
for several years, to collect bookmarks to read later.
Often, while researching things, it would be useful to automatically group things into collections, so I wrote some celery tasks to help with this.
Read More →
While USB-C
mostly defines just the physical connector, the increase in Power Delivery
options makes it a more appealing option for all kinds of devices.
In some ways, I am lucky as an American than lives in Japan, most devices use the same plugs, and I do not do so much traveling as to need all kinds of adapters.
That said, it is still somewhat annoying (first world problems) to have many different power bricks and large plugs on my desk.
Is it yet feasible to move more small devices to USB-C and ditch all these power bricks ?
Read More →