#NEWLINE# def GetKindByNum( kind , num ) : #NEWLINE# #INDENT# K = str ( kind . capitalize ( ) ) #NEWLINE# one = memcache . get ( ( ( K + '_' ) + str ( num ) ) ) #NEWLINE# if one : #NEWLINE# #INDENT# return one #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# q = db . GqlQuery ( ( ( 'SELECT * FROM ' + K ) + ' WHERE num = :1' ) , int ( num ) ) #NEWLINE# if ( q . count ( ) == 1 ) : #NEWLINE# #INDENT# one = q [ 0 ] #NEWLINE# memcache . set ( ( ( num + '_' ) + str ( num ) ) , one , 86400 ) #NEWLINE# return one #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False