1
from django.db import connection
2
from django.db import models
5
class Article(models.Model):
6
headline = models.CharField(max_length=100)
7
pub_date = models.DateTimeField()
11
["headline", "pub_date"],
15
# Indexing a TextField on Oracle or MySQL results in index creation error.
16
if connection.vendor == 'postgresql':
17
class IndexedArticle(models.Model):
18
headline = models.CharField(max_length=100, db_index=True)
19
body = models.TextField(db_index=True)
20
slug = models.CharField(max_length=40, unique=True)