Q:

Django ORM. How to exclude old data?

I want to exclude unnessery old records from my queryset.
I tried use annotate(Max('pc_users__created')), but this is not what i want. I think i should use 'group by' or something like that, but I can not understand how.
Here's my models.py
class Room(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    updated = models.DateTimeField(auto_now=True)
    room_number = models.SmallIntegerField()

    def __str__(self):
        return f'Room №{self.room_number}'

class UserProfiles(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    updated = models.DateTimeField(auto_now=True)
    name = models.CharField(max_length=100)

    def __str__(self):
        return f'{self.name}'

class Pc(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    updated = models.DateTimeField(auto_now=True)
    title = models.CharField(max_length=100)
    ram = models.SmallIntegerField()
    cpu = models.CharField(max_length=20)
    gpu = models.CharField(max_length=20)

    def __str__(self):
        return f'{self.title}'

class PcUsers(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    updated = models.DateTimeField(auto_now=True)
    pc = models.ForeignKey(Pc, on_delete=models.PROTECT, related_name='pc_users')
    user = models.ForeignKey(UserProfiles, on_delete=models.PROTECT)

    def __str__(self):
        return f'{self.pc}: {self.user}'

class PcRooms(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    updated = models.DateTimeField(auto_now=True)
    pc = models.ForeignKey(Pc, on_delete=models.PROTECT, related_name='pc_rooms')
    room = models.ForeignKey(Room, on_delete=models.PROTECT)

    def __str__(self):
        return f'{self.pc}: {self.room}'

and views.py:
from myapp.models import Pc
def report(request):
    data = Pc.objects.values(
        'id',
        'title',
        'pc_users__user__name',
        'pc_rooms__room__room_number'
    )
    return render(request, 'report.html', {'data': data})

Also here is my data from admin site 
I want exclude all repetitive records and keep all newest records.
Like this
+-------+------------+---------+---------+
| ID Pc |  Pc Title  | Pc User | Pc Room |
+-------+------------+---------+---------+
|     1 | Laptop     | User1   |     201 |--> Keep this
|     1 | Laptop     | User1   |     999 |
|     1 | Laptop     | Admin   |     201 |
|     1 | Laptop     | Admin   |     999 |
|     2 | PC1        | User1   |     201 |--> Keep this
|     2 | PC1        | User1   |     202 |
|     2 | PC1        | User2   |     201 |
|     2 | PC1        | User2   |     202 |
|     3 | PC2        | User2   |     202 |--> Keep this
|     3 | PC2        | User2   |     203 |
|     3 | PC2        | User3   |     202 |
|     3 | PC2        | User3   |     203 |
|     4 | PC3        | User3   |     203 |--> Keep this
|     4 | PC3        | User3   |     201 |
|     4 | PC3        | User1   |     203 |
|     4 | PC3        | User1   |     201 |
|     5 | Server     | Admin   |     999 |--> Keep this
|     6 | new laptop | None    |     301 |--> Keep this
+-------+------------+---------+---------+

A:

Use distinct() to exclude repetitions and order_by using the created field to keep the most recent records

