From c21535d42084de7ac4e6a3fdc2beff1a01920d47 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 7 Dec 2012 17:21:26 -0500 Subject: [PATCH] models: Create database indexes on auxiliary Message fields. I suspect we'll want these for narrowing code at some point. (imported from commit d2077aa4d7a6967bb4cb7d9404a4db4fcf824343) --- zephyr/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zephyr/models.py b/zephyr/models.py index 86409125f6..9dce008d1c 100644 --- a/zephyr/models.py +++ b/zephyr/models.py @@ -405,9 +405,9 @@ def linebreak(string): class Message(models.Model): sender = models.ForeignKey(UserProfile) recipient = models.ForeignKey(Recipient) - subject = models.CharField(max_length=MAX_SUBJECT_LENGTH) + subject = models.CharField(max_length=MAX_SUBJECT_LENGTH, db_index=True) content = models.TextField() - pub_date = models.DateTimeField('date published') + pub_date = models.DateTimeField('date published', db_index=True) sending_client = models.ForeignKey(Client) def __repr__(self):