DJANGO Get First, Second and Third most found Value in a Model
You can count the number of clientvuls for each vul and then order and return the first three:
from django.db.models import Count

vul.objects.alias(
    num_client=Count('clientvul_set')
).order_by('-num_client')[:3]

there is no need to make a model for this. Unless we are talking about billions of records, such queries run in milliseconds, and are more robust since it will also change the order in case a clientvul is removed for example.

I got a Dashboard model that is filled by a schduled Job.
dashboard model
class dashboard(models.Model):
    topvul1=models.IntegerField(default=0)
    topvul2=models.IntegerField(default=0)
    topvul3=models.IntegerField(default=0)


I want to show the most found, second most found and third most found VID from the clientvul model. And fill it once per Day to my dashboard model.
clientvul model
class clientvul(models.Model):
    
    client= models.ForeignKey(client, on_delete=models.CASCADE)
    vid=models.ForeignKey(vul, on_delete=models.CASCADE)
    path=models.CharField(max_length=1000)
    product=models.CharField(max_length=1000)
    isactive=models.BooleanField(default=True)
    class Meta:
        constraints = [
            models.UniqueConstraint(
               fields=['client', 'VID'], name='unique_migration_host_combination' # legt client und VID als Primarykey fest
            )
        ]

