Re: Beginner's question regarding prefetch_related

2019-06-28 Thread jjmutumi
Hi there, I think you can use values() to do a group by. Something along these lines should be able to do it in 3 queries: from django.models import Max # aggregate grouping by submission

Re: Beginner's question regarding prefetch_related

2019-06-28 Thread swimmer
I want to display a complete list of all submissions, and depending on the status of the most recent assessment for each submission, I want to display some additional information for each submission. In the system, there might be thousands of submissions and a handful of assessments for each of

Re: Beginner's question regarding prefetch_related

2019-06-27 Thread Charlotte Wood
What are you trying to do? On Thu, Jun 27, 2019, 2:09 PM swimmer wrote: > Dear Django community, > > I have a data model that looks like the following: > > class Submission(models.Model): >... > > class Assessment(models.Model): >submission = models.ForeignKey( >Submission,