0👍
Django does not yet support compound indicies. The accepted solution is to register a post_syncdb signal handler — https://docs.djangoproject.com/en/1.6/ref/signals/#post-syncdb
Here’s the template (you’ll need to fill in the appropriate details):
from django.db import connection
from django.db.models.signals import post_syncdb
def callback(sender, **kwargs):
cur = connection.cursor()
cur.execute('CREATE UNIQUE INDEX ...')
post_syncdb.connect(callback, sender=app.models)
- [Answered ]-Jquery to Python / Django Query Dict
- [Answered ]-Django haystack search result possible to get list of actual objects directly?
Source:stackexchange.com