# Path: src/presenters/models.py
# class Presenter(models.Model):
#     game = models.ForeignKey('Game', default=get_default_game)
#     platform = models.ForeignKey('Platform')
#     id_in_platform = models.IntegerField(default=0)
#     tag = models.ManyToManyField('Tag', blank=True)
#     nickname = models.CharField(max_length=50)
#     introduce = models.TextField()
#     room_url = models.CharField(max_length=255, blank=True)
#     gender = models.CharField(max_length=1, choices=GENDER_CHOICES, default='M')
#     avatar_url = models.CharField(max_length=255, blank=True)
# 
#     join_date = models.DateField(auto_now_add=True)
# 
#     invalid = models.BooleanField(default=True)
# 
#     def __unicode__(self):
#         return self.nickname


from .models import Presenter
from haystack import indexes
# -*- coding: utf-8 -*-

class PresenterIndex(indexes.SearchIndex, indexes.Indexable):
    text = indexes.CharField(document=True, use_template=True)

    nickname = indexes.CharField(model_attr='nickname')
    introduce = indexes.CharField(model_attr='introduce')

    def get_model(self):

# Path: src/presenters/models.py
# class Presenter(models.Model):
#     game = models.ForeignKey('Game', default=get_default_game)
#     platform = models.ForeignKey('Platform')
#     id_in_platform = models.IntegerField(default=0)
#     tag = models.ManyToManyField('Tag', blank=True)
#     nickname = models.CharField(max_length=50)
#     introduce = models.TextField()
#     room_url = models.CharField(max_length=255, blank=True)
#     gender = models.CharField(max_length=1, choices=GENDER_CHOICES, default='M')
#     avatar_url = models.CharField(max_length=255, blank=True)
# 
#     join_date = models.DateField(auto_now_add=True)
# 
#     invalid = models.BooleanField(default=True)
# 
#     def __unicode__(self):
#         return self.nickname


# Path: src/presenters/search_indexes.py
from .models import Presenter
from haystack import indexes

# -*- coding: utf-8 -*-

class PresenterIndex(indexes.SearchIndex, indexes.Indexable):
    text = indexes.CharField(document=True, use_template=True)

    nickname = indexes.CharField(model_attr='nickname')
    introduce = indexes.CharField(model_attr='introduce')

    def get_model(self):

        return Presenter