2👍
✅
You use the related name functionality.
articles = Reporter.objects.get(name='somename').article_set.all()
If you already have the reporter, this is even easier:
articles = my_reporter.article_set.all()
0👍
You have to write code like this;
reporter_ids = Reporter.objects.filter(name='somename').values_list('id', flat=True)
article = Article.objects.filter(reporter_id__in=reporter_ids)
- [Answered ]-Django concurrency with celery
- [Answered ]-Is celery the appropriate tech for running long-running processes I simply need to start/stop?
- [Answered ]-Django context processors and URL arguments
Source:stackexchange.com