Hi I have these models
class Score(models.Model):
""""""
id = models.BigAutoField(primary_key=True)
venuemachine = models.ForeignKey(
VenueMachine,
related_name='scores',
null=True,
on_delete=models.CASCADE,
)
...
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
class VenueMachine(models.Model):
""""""
...
machine = models.ForeignKey(
Machine,
on_delete=models.CASCADE,
related_name='venuemachines',
)
...
class Machine(models.Model, ImageResizeMixin):
""""""
name = models.CharField(
max_length=150,
verbose_name='Machine Name',
)
What I want is to get five latest Scores but with different Machines
This is really tricky and I am not sure how I can filter it using Django ORM.
Please help!
@KenWhitesell , any comments?