Commit b118a28f authored by Chris Reffett's avatar Chris Reffett

Get haystack/whosh going, properly set up search templates

parent 3df6bffd
......@@ -56,3 +56,4 @@ docs/_build/
# Database
advisor/db.sqlite3
advisor/whoosh_index/
......@@ -5,11 +5,11 @@ from mainapp.models import Course, Major, Minor
class CourseIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField( document = True, use_template = True)
title = indexes.CharField( model_attr = "title" )
#title = indexes.CharField( model_attr = "title" )
catalogyear = indexes.CharField( model_attr = "catalogyear" )
description = indexes.CharField( model_attr = "description" )
dept = indexes.CharField( model_attr = "dept" )
courseid = indexes.CharField( model_attr = "courseid" )
#description = indexes.CharField( model_attr = "description" )
#dept = indexes.CharField( model_attr = "dept" )
#courseid = indexes.CharField( model_attr = "courseid" )
credits = indexes.CharField( model_attr = "credits" )
def get_model(self):
......@@ -19,10 +19,10 @@ class CourseIndex(indexes.SearchIndex, indexes.Indexable):
return self.get_model().objects.all()
class MajorIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField( document = True, use_template = True)
text = indexes.CharField(document = True, use_template = True)
name = indexes.CharField( model_attr = "name" )
description = indexes.CharField( models_attr = "description" )
#name = indexes.CharField(model_attr = "name")
#description = indexes.CharField(model_attr = "description")
def get_model(self):
return Major
......@@ -31,10 +31,10 @@ class MajorIndex(indexes.SearchIndex, indexes.Indexable):
return self.get_model().objects.all()
class MinorIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField( document = True, use_template = True)
text = indexes.CharField(document = True, use_template = True)
name = indexes.CharField( model_attr = "name" )
description = indexes.CharField( models_attr = "description" )
#name = indexes.CharField(model_attr = "name")
#description = indexes.CharField(model_attr = "description")
def get_model(self):
return Minor
......
{{ object.title }}
{{ object.description }}
{{ object.courseid }}
{{ object.dept }}
{{ object.title }}
{{ object.description }}
{{ object.title }}
{{ object.description }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment