Exemplo n.º 1
0
 def test_load_search_model_indexes_valid(self):
     search_proxy_model = load_search_model_indexes()[1]
     self.assertEqual(
         search_proxy_model.search_fields,
         self.index_settings['auth.user']
     )
     self.assertEqual(search_proxy_model.__name__, 'SearchableUser')
Exemplo n.º 2
0
from django.db import models, transaction

from mezzanine.core.managers import SearchableManager

from raspberryio.search.utils import load_search_model_indexes


class Searchable(models.Model):
    """
    An abstract base class to extend django Model classes from to make them
    searchable. Requires that the base class defines search_fields.
    """

    objects = SearchableManager()

    class Meta():
        abstract = True


searchable_models = load_search_model_indexes()
Exemplo n.º 3
0
 def test_load_search_model_indexes_valid(self):
     search_proxy_model = load_search_model_indexes()[1]
     self.assertEqual(search_proxy_model.search_fields,
                      self.index_settings['auth.user'])
     self.assertEqual(search_proxy_model.__name__, 'SearchableUser')
from django.db import models, transaction

from mezzanine.core.managers import SearchableManager

from raspberryio.search.utils import load_search_model_indexes


class Searchable(models.Model):
    """
    An abstract base class to extend django Model classes from to make them
    searchable. Requires that the base class defines search_fields.
    """

    objects = SearchableManager()

    class Meta:
        abstract = True


searchable_models = load_search_model_indexes()