app/views/search.py
def index_data(self, item):
        """
        Converts the item into an indexable dictionary
        """
        # =========== Choices ==========
        if isinstance(item, BasicChoice):
            data = {
                'name': unicode(item.name),
                'type': u'BasicChoice',
                'keywords': u'%s choice' % (item.name),
                'desc': unicode(item.desc),
                'defn': unicode(item.defn),
            }
        elif isinstance(item, LinearChoice):
            data = {
                'name': unicode(item.name),
                'type': u'LinearChoice',
                'keywords': u'%s choice' % (item.name),
                'desc': unicode(item.desc),
                'defn': unicode(item.defn),
            }
        elif isinstance(item, SubChoice):
            data = {
                'name': unicode(item.name),
                'type': u'SubChoice',
                'keywords': u'%s %s subchoice choice' %
                    (item.choice.name, item.name),
                'desc': u'',
                'defn': unicode(item.defn),
            }
        # =========== Traits ==========
        elif isinstance(item, TraitGroup):
            data = {
                'name': unicode(item.name),
                'type': u'TraitGroup',
                'keywords': u'%s group' % (item.name),
                'desc': unicode(item.desc),
                'defn': u'',
            }
        # =========== Traits ==========
        elif isinstance(item, BasicTrait):
            data = {
                'name': unicode(item.name),
                'type': u'BasicTrait',
                'keywords': u'%s trait' % (item.name),
                'desc': unicode(item.desc),
                'defn': unicode(item.defn),
            }
        elif isinstance(item, LinearTrait):
            data = {
                'name': unicode(item.name),
                'type': u'LinearTrait',
                'keywords': u'%s %s %s trait' % (
                    item.name, item.pos_name, item.neg_name
                ),
                'desc': unicode(item.desc),
                'defn': unicode(item.defn),
            }
        data['id'] = unicode(item.id)
        data['index_id'] = u'%s-%s' % (data['type'], data['id'])
        data['keywords'] = data['keywords'].lower()

        return data

        Converts the item into an indexable dictionary
        
Converts the item into an indexable dictionary
Converts the item into an indexable dictionary
def index_data(self, item):
        if isinstance(item, BasicChoice):
            data = {
                'name': unicode(item.name),
                'type': u'BasicChoice',
                'keywords': u'%s choice' % (item.name),
                'desc': unicode(item.desc),
                'defn': unicode(item.defn),
            }
        elif isinstance(item, LinearChoice):
            data = {
                'name': unicode(item.name),
                'type': u'LinearChoice',
                'keywords': u'%s choice' % (item.name),
                'desc': unicode(item.desc),
                'defn': unicode(item.defn),
            }
        elif isinstance(item, SubChoice):
            data = {
                'name': unicode(item.name),
                'type': u'SubChoice',
                'keywords': u'%s %s subchoice choice' %
                    (item.choice.name, item.name),
                'desc': u'',
                'defn': unicode(item.defn),
            }
        elif isinstance(item, TraitGroup):
            data = {
                'name': unicode(item.name),
                'type': u'TraitGroup',
                'keywords': u'%s group' % (item.name),
                'desc': unicode(item.desc),
                'defn': u'',
            }
        elif isinstance(item, BasicTrait):
            data = {
                'name': unicode(item.name),
                'type': u'BasicTrait',
                'keywords': u'%s trait' % (item.name),
                'desc': unicode(item.desc),
                'defn': unicode(item.defn),
            }
        elif isinstance(item, LinearTrait):
            data = {
                'name': unicode(item.name),
                'type': u'LinearTrait',
                'keywords': u'%s %s %s trait' % (
                    item.name, item.pos_name, item.neg_name
                ),
                'desc': unicode(item.desc),
                'defn': unicode(item.defn),
            }
        data['id'] = unicode(item.id)
        data['index_id'] = u'%s-%s' % (data['type'], data['id'])
        data['keywords'] = data['keywords'].lower()
        return data
def index_data ( self , item ) : if isinstance ( item , BasicChoice ) : data = { 'name' : unicode ( item . name ) , 'type' : u'BasicChoice' , 'keywords' : u'%s choice' % ( item . name ) , 'desc' : unicode ( item . desc ) , 'defn' : unicode ( item . defn ) , } elif isinstance ( item , LinearChoice ) : data = { 'name' : unicode ( item . name ) , 'type' : u'LinearChoice' , 'keywords' : u'%s choice' % ( item . name ) , 'desc' : unicode ( item . desc ) , 'defn' : unicode ( item . defn ) , } elif isinstance ( item , SubChoice ) : data = { 'name' : unicode ( item . name ) , 'type' : u'SubChoice' , 'keywords' : u'%s %s subchoice choice' % ( item . choice . name , item . name ) , 'desc' : u'' , 'defn' : unicode ( item . defn ) , } elif isinstance ( item , TraitGroup ) : data = { 'name' : unicode ( item . name ) , 'type' : u'TraitGroup' , 'keywords' : u'%s group' % ( item . name ) , 'desc' : unicode ( item . desc ) , 'defn' : u'' , } elif isinstance ( item , BasicTrait ) : data = { 'name' : unicode ( item . name ) , 'type' : u'BasicTrait' , 'keywords' : u'%s trait' % ( item . name ) , 'desc' : unicode ( item . desc ) , 'defn' : unicode ( item . defn ) , } elif isinstance ( item , LinearTrait ) : data = { 'name' : unicode ( item . name ) , 'type' : u'LinearTrait' , 'keywords' : u'%s %s %s trait' % ( item . name , item . pos_name , item . neg_name ) , 'desc' : unicode ( item . desc ) , 'defn' : unicode ( item . defn ) , } data [ 'id' ] = unicode ( item . id ) data [ 'index_id' ] = u'%s-%s' % ( data [ 'type' ] , data [ 'id' ] ) data [ 'keywords' ] = data [ 'keywords' ] . lower ( ) return data
Converts the item into an indexable dictionary
Converts the item into an indexable dictionary
"""
        Converts the item into an indexable dictionary
        """ # =========== Choices ========== # =========== Traits ========== # =========== Traits ==========
self
item