Replace all __unicode__ methods to __str__ and the @python_2_unicode_compatible decorator. Replace all instance of smart_str, smart_unicode, force_uncode with force_text. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
15 lines
382 B
Python
15 lines
382 B
Python
from __future__ import unicode_literals
|
|
|
|
from django.http import Http404
|
|
from django.utils.encoding import force_text
|
|
|
|
from .classes import SearchModel
|
|
|
|
|
|
class SearchModelMixin(object):
|
|
def get_search_model(self):
|
|
try:
|
|
return SearchModel.get(self.kwargs['search_model'])
|
|
except KeyError as exception:
|
|
raise Http404(force_text(exception))
|