Use the Django ORM to lock objects in the database