Python task manager from scratch, part 29: Cosmetic improvements
After the big back-end switch, I'm still cleaning up. Today:
- Making the "mark complete" buttons go on the same line as the task descriptions;
- Making the task descriptions labels of those HTML buttons instead of text that happens to be near them;
- Giving those buttons unique IDs;
- Fixing a data-loss bug where I'd add tasks and then lose them.
Some things to know about the material:
- The bug was caused (I think!) by the fact that I hadn't committed them. It's useful to know a bit about what "committing" is: I found this post useful. The idea of a "unit of work" is also valuable, and I went far too long without studying it. (My favorite introduction to it is in Architecture Patterns with Python.)
- Right now we have one HTML form per task. Another, perhaps better, choice is to have a single form. Do not take this as any kind of principled position on the matter. But do take it as a reminder that there are a lot of perfectly good approaches to implementing things in HTML and CSS that sound a bit strange when you first hear them ("to render this task list we'll create a page with 32 forms on it").
Here's the current commit in the veery/
repository.