Skip to main content

Learning Backend WebDev, Log #8 - Many, Many Relationships

Another day of doing only Django.
Not that I’m complaining. Finishing up this Django course is my priority.
Followed by PostgreSQL and Data Structures and Algorithms.
I just have to do them step by step, one after another.

What I learnt in Django land

  • I like calling it Django land. Reminds me of Tarantino’s Django and Candyland.
  • I learnt all about many to many database relationships and how they’re done with models in Django.
  • They’re a logical extension of one to many relationships.
  • It’s like one of those who know who games. I know Carol. Carol knows Amelia. And so Carol is my through table, my join table, my junction table. I can request things of Amelia through Carol. That in a nutshell is what it is like.
  • I realise that all these complicated terms I feared are actually succinct names for simple, yet long winded processes or things.
  • I’m going to practice all this tomorrow morning.
  • Heuristic, whenever I see repeated strings vertically, I ought to be thinking databases for efficient storage.
  • Heuristic, whenever I see multiple things relating to multiple other things, I ought to be thinking many to many models/relationships (many books to a genre, many genres to a book, an author with multiple books, a book with multiple authors)
  • Use integers for primary keys. Integers are fast.
  • I now love the folk who designed and built Django. The more I learn about its innards, the more I realise there is no Django magic. Just back breaking hard work and lots of thought put into building this beautiful edifice over the years. Makes me appreciate learning Django, even more.

Focus Follow Up aka How did I do with focus today?

  • Did seven, 30 minute sessions of Django and one aborted session
  • Had a lot of housework today and still managed to wrangle 3 and half hours of deep work.
  • Writing notes, seems to be helping. I get my quizzes right the first time around.
  • Deliberate practice and focus are not easy, that’s for sure. I keep looking at the clock. And then I keep moaning about how time passes too slowly when I am struggling with stuff.
  • Also noticed that whenever I start working on something tough, my mind gets really uncomfortable and wants to do everything else, but focus on the problem and do the work. I want to suddenly call people I haven’t spoken to in ages, check my mail, my messages, peek at the fediverse 😂 I resist. And tell myself, I just have to hold on for 20 more minutes 😂
  • I serendipitously came across this tweet, just a few minutes ago, which tells me I am not alone :)
    • Writing code is often a constant struggle against distraction.
      — Joy of Clojure
  • This focus is now bleeding into other areas of my life. I am slowing down and doing other stuff, slowly, intentionally.
  • My mind feels like it is slowly expanding as if it was in a vise. It feels a bit more relaxed, a bit more freer

Here’s to showin’ up!


P.S. Subscribe to my mailing list!
Forward these posts and letters to your friends and get them to subscribe!
P.P.S. Feed my insatiable reading habit.