I have two models Article and Blog related using a foreign key. I want to select only blog name while extracting the article.
articles = Articles.objects.all
select_related should be use on the whole model, and then you can filter it more. This will work:
Articles.objects.select_related('blog').only('blog__name', 'title', 'create_time')
You can use annotate() for this.
>>> a = Articles.objects.annotate(blog_name=F('blog__name')).first()
>>> a.title
>>> a.blog_name