Commit 17756cc991213accd59d2f313abed7bfd44a2b7c

Authored by Alex Riina
1 parent fb4d7948

Add db_index to submit_date

Fixes #74
  1 +# -*- coding: utf-8 -*-
  2 +from __future__ import unicode_literals
  3 +
  4 +from django.db import models, migrations
  5 +
  6 +
  7 +class Migration(migrations.Migration):
  8 +
  9 + dependencies = [
  10 + ('django_comments', '0002_update_user_email_field_length'),
  11 + ]
  12 +
  13 + operations = [
  14 + migrations.AlterField(
  15 + model_name='comment',
  16 + name='submit_date',
  17 + field=models.DateTimeField(default=None, verbose_name='date/time submitted', db_index=True),
  18 + preserve_default=True,
  19 + ),
  20 + ]
... ...
... ... @@ -62,7 +62,7 @@ class CommentAbstractModel(BaseCommentAbstractModel):
62 62 comment = models.TextField(_('comment'), max_length=COMMENT_MAX_LENGTH)
63 63
64 64 # Metadata about the comment
65   - submit_date = models.DateTimeField(_('date/time submitted'), default=None)
  65 + submit_date = models.DateTimeField(_('date/time submitted'), default=None, db_index=True)
66 66 ip_address = models.GenericIPAddressField(_('IP address'), unpack_ipv4=True, blank=True, null=True)
67 67 is_public = models.BooleanField(_('is public'), default=True,
68 68 help_text=_('Uncheck this box to make the comment effectively '
... ...
Please register or login to post a comment