There are times when you want to get a single field of a single object in the database. For example, just get the headline of the blog post #1, not fetching it’s body. How do you do it in a usual way?'Hello world' # Or maybe even this way: >>> BlogPost.objects.values('headline').filter(pk=1)['headline'] 'Hello world'
Recently I’ve stumbled upon a shorter one:Continue reading