<s> from __future__ import unicode_literals <EOL> from django . conf import settings <EOL> from shop . search . indexes import ProductIndex as ProductIndexBase <EOL> from haystack import indexes <EOL> if settings . SHOP_TUTORIAL == '<STR_LIT>' : <EOL> from myshop . models . simple . smartcard import SmartCard <EOL> elif settings . SHOP_TUTORIAL == '<STR_LIT>' : <EOL> from myshop . models . i18n . smartcard import SmartCard <EOL> elif settings . SHOP_TUTORIAL == '<STR_LIT>' : <EOL> from myshop . models . polymorphic . smartcard import SmartCard <EOL> from myshop . models . polymorphic . smartphone import SmartPhoneModel <EOL> class ProductIndex ( ProductIndexBase ) : <EOL> catalog_media = indexes . CharField ( stored = True , indexed = False , null = True ) <EOL> search_media = indexes . CharField ( stored = True , indexed = False , null = True ) <EOL> def prepare_catalog_media ( self , product ) : <EOL> return self . render_html ( '<STR_LIT>' , product , '<STR_LIT>' ) <EOL> def prepare_search_media ( self , product ) : <EOL> return self . render_html ( '<STR_LIT>' , product , '<STR_LIT>' ) <EOL> class SmartCardIndex ( ProductIndex , indexes . Indexable ) : <EOL> def get_model ( self ) : <EOL> return SmartCard <EOL> if settings . SHOP_TUTORIAL == '<STR_LIT>' : <EOL> class SmartPhoneIndex ( ProductIndex , indexes . Indexable ) : <EOL> def get_model ( self ) : <EOL> return SmartPhoneModel <EOL> myshop_search_index_classes = ( SmartCardIndex , SmartPhoneIndex ) <EOL> else : <EOL> myshop_search_index_classes = ( SmartCardIndex , ) </s>
