def get_default_sites(): return [site.id for site in Site.objects.all()] class MyModel(models.Model): sites = models.ManyToManyField(Site, default=get_default_sites)