#NEWLINE# @ classmethod #NEWLINE# def gql( cls , query_string , * args , **kwds ) : #NEWLINE# #INDENT# "Returns a polymorphic query using GQL query string.\n\n    This query is polymorphic in that it has its filters configured in a way\n    to retrieve instances of the model or an instance of a subclass of the\n    model.\n\n    Args:\n      query_string: properly formatted GQL query string with the\n        'SELECT * FROM <entity>' part omitted\n      *args: rest of the positional arguments used to bind numeric references\n        in the query.\n      **kwds: dictionary-based arguments (for named parameters).\n    " #NEWLINE# if ( cls == cls . __root_class__ ) : #NEWLINE# #INDENT# return super ( PolyModel , cls ) . gql ( query_string , * args , ** query ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# from google.appengine.ext import gql #NEWLINE# query = db . GqlQuery ( ( 'SELECT * FROM %s %s' % ( cls . kind ( ) , query_string ) ) ) #NEWLINE# query_filter = [ ( 'nop' , [ gql . Literal ( cls . class_name ( ) ) ] ) ] #NEWLINE# query . _proto_query . filters ( ) [ ( 'class' , '=' ) ] = query_filter #NEWLINE# query . bind ( * args , ** kwds ) #NEWLINE# return query