I want to show one notification of each notification type and the most recent.
My question is how to get each notification type and show the most recent of that notification type.

```
notifications = Notification.objects.filter(**condition). \
    exclude(notification_user__in=users). \
    order_by('notificationType__priority','-start_date')[:1]

```

models.py

```
class Notification(models.Model):
title = models.CharField(max_length=75)
description = models.TextField()
start_date = models.DateTimeField()
end_date = models.DateTimeField()
application = models.ManyToManyField('Products.Application')
notificationType = models.ForeignKey(NotificationType)
url = models.URLField(null=True, blank=True)
region = models.ManyToManyField('Geolocations.Region', null=True, blank=True)
image = models.ImageField(null=True, blank=True)
user = models.ManyToManyField(User, through='Notification_User')

class NotificationType(models.Model):
type = models.CharField(max_length=30)
priority = models.IntegerField(max_length=3)
color = RGBColorField()

```

This only shows the most recent notification independent of the notification type.
Any suggestion?

**UPDATE**

now i inserted the notifications into a list.
but in this ways doesnt work
my idea is if the notification\_type the priority value (unique int) does not exist, to add into the list

```
notifications=[]    
if n.objects.filter(notification_type__priority=notifications).exists():
    notifications.append(n)

```