Skip to content

Instantly share code, notes, and snippets.

View tjwalch's full-sized avatar

Tomas Walch tjwalch

  • Stockholm, Sweden
View GitHub Profile
@tjwalch
tjwalch / gist:ee743e99b4b967e5baa38094ffe4e4c6
Created September 16, 2019 18:21
Django JOIN instead of subquery
from django.conf import settings
from django.db import models
class School(models.Model):
verified_users = models.ManyToManyField(
settings.AUTH_USER_MODEL,
related_name='verified_schools',
)