'Constructor.
Args:
query_string: Properly formatted GQL query string.
*args: Positional arguments used to bind numeric references in the query.
**kwds: Dictionary-based arguments for named references.
Raises:
PropertyError if the query filters or sorts on a property that\'s not
indexed.'

def __init__(self, query_string, *args, **kwds):

    from google.appengine.ext import gql
    app = kwds.pop('_app', None)
    namespace = None
    if isinstance(app, tuple):
        if (len(app) != 2):
            raise BadArgumentError('_app    must    have    2    values    if    type    is    tuple.')
        (app, namespace) = app
    self._proto_query = gql.GQL(query_string, _app=app, namespace=namespace)
    if (self._proto_query._kind is not None):
        model_class = class_for_kind(self._proto_query._kind)
    else:
        model_class = None
    super(GqlQuery, self).__init__(model_class)
    if (model_class is not None):
        for (property, unused) in (self._proto_query.filters().keys() + self._proto_query.orderings()):
            if (property in model_class._unindexed_properties):
                raise PropertyError(("Property    '%s'    is    not    indexed" % property))
    self.bind(*args, **kwds)
