@@ -0,0 +1,257 @@
+from django.db import models%0Afrom .models import Schema%0A%0Adef get_schema():%0A    cursor = models.connection.cursor()%0A    cursor.execute('SHOW search_path')%0A    search_path = cursor.fetchone()%5B0%5D%0A    return Schema.objects.get(schema=search_path.split(',')%5B0%5D)%0A

Add a tool for getting the current schema. Not sure if this could break things. Concurrency might be a bitch.