Event sourcing in Django

Posted on Thu 05 January 2017 in Django • Tagged with django, models, event sourcing, audit trail

Django comes with batteries included to make CRUD (create, read, update, delete) operations easy. But it also makes deleting data easy, causing you to lose historical data. Old data in your business critical models are valuable, and you never know when you'll want an audit trail. Use event sourcing to ensure you never lose your data's history.

Continue reading

3 ways of testing Django views

Posted on Mon 02 January 2017 in Django • Tagged with django, testing, views

I tried 3 different ways of testing a Django view. These are my thoughts.

Continue reading

When should I use a Python tuple?

Posted on Fri 23 December 2016 in Python • Tagged with python, collections, list, tuple

Have you ever wondered when to use a tuple instead of a list? Why is a tuple useful?

Continue reading

Use ptipython, a better Python shell

Posted on Wed 21 December 2016 in Python • Tagged with python, django

Most Python developers use a shell, or REPL (Read-Evaluate-Print-Loop) to quickly try out small bits of code and also for quick and dirty debugging. Did you know there are other options apart from the default Python shell?

Continue reading

Writing readable queries in Django

Posted on Sun 18 December 2016 in Django • Tagged with django, querysets

Queries in Django can get complicated and difficult to read. Here's how to write them in a way that doesn't confuse other programmers.

Continue reading

Hello there!

Posted on Sat 17 December 2016 in Blog • Tagged with blog

Hey there!

I'm a Python developer based in Australia, and I want to write about programming topics (mostly Python, sometimes other languages).

I love helping people. If anything I post here is of any help to you, that's awesome. You can also email me at yoongkang [at] yoongkang.com.

Continue reading