PageRenderTime 102ms CodeModel.GetById 40ms app.highlight 2ms RepoModel.GetById 59ms app.codeStats 0ms

/sphinxtest/tests/models.py

http://django-sphinx.googlecode.com/
Python | 19 lines | 13 code | 6 blank | 0 comment | 0 complexity | 1b56712fcb15e4de7ab90a5822029815 MD5 | raw file
 1from django.db import models
 2
 3from djangosphinx import SphinxSearch
 4
 5import datetime
 6
 7class Group(models.Model):
 8    name = models.CharField(max_length=32)
 9
10class Document(models.Model):
11    group       = models.ForeignKey(Group)
12    date_added  = models.DateTimeField(default=datetime.datetime.now)
13    title       = models.CharField(max_length=32)
14    content     = models.TextField()
15    
16    search      = SphinxSearch(index="test")
17    
18    class Meta:
19        db_table = 'documents'