#NEWLINE# def get_favorites( self , limit , skip = 0 , user = None ) : #NEWLINE# #INDENT# query = db . Query ( Vote ) #NEWLINE# query . filter ( 'voter = ' , self ) #NEWLINE# query . filter ( 'is_up = ' , True ) #NEWLINE# query . order ( '-creation_time' ) #NEWLINE# result = [ ] #NEWLINE# for vote in query . run ( ) : #NEWLINE# #INDENT# monster = Monster . get_by_id_safe ( vote . monster . key ( ) . id ( ) , user ) #NEWLINE# if monster : #NEWLINE# #INDENT# if user : #NEWLINE# #INDENT# skip -= 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result . append ( monster ) #NEWLINE# if ( len ( result ) >= limit ) : #NEWLINE# #INDENT# return result #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return result