Lessons Learned


On Django, be careful when paginating querysets. Make sure your order_by always return consistent ordering, otherwise you might have subtle bugs in page transitions. For example, .order_by('title') isn't enough if items may have repeated titles. Do a .order_by('title', 'created') or a .order_by('title', 'id') instead to guarantee the order won't vary on different queries.

Did you like?