listener/app_engine/error/forms.py
def as_query(self, table):
        """ This is getting a bit complicated """
        args, gql = [], []
        counter = 1

        for k, v in self.cleaned_data.items():
            # if there's a value handler, use it
            lookup = getattr(self, "handle_%s" % k, None)
            if lookup:  v = lookup(v)
            # if there's a filter handler user it
            lfilter = getattr(self, "filter_%s" % k, None)
            if lfilter:
                # will return a filter and args..
                newfilter, newargs = lfilter(v, args)
                gql.append(newfilter)
                args.extend(newargs)
                counter += len(newargs)
            else:
                gql.append(" %s = :%s " % (k, counter))
                args.append(v)
                counter += 1

        conditions = " AND ".join(gql)
        if conditions: conditions = "WHERE %s" % conditions
        conditions = "SELECT * FROM %s %s ORDER BY %s timestamp DESC" % (table, conditions, self.inequality)
        query = db.GqlQuery(conditions, *args)
        return query
 This is getting a bit complicated 
This is getting a bit complicated
This is getting a bit complicated
def as_query(self, table):
        args, gql = [], []
        counter = 1
        for k, v in self.cleaned_data.items():
            lookup = getattr(self, "handle_%s" % k, None)
            if lookup:  v = lookup(v)
            lfilter = getattr(self, "filter_%s" % k, None)
            if lfilter:
                newfilter, newargs = lfilter(v, args)
                gql.append(newfilter)
                args.extend(newargs)
                counter += len(newargs)
            else:
                gql.append(" %s = :%s " % (k, counter))
                args.append(v)
                counter += 1
        conditions = " AND ".join(gql)
        if conditions: conditions = "WHERE %s" % conditions
        conditions = "SELECT * FROM %s %s ORDER BY %s timestamp DESC" % (table, conditions, self.inequality)
        query = db.GqlQuery(conditions, *args)
        return query
def as_query ( self , table ) : args , gql = [ ] , [ ] counter = 1 for k , v in self . cleaned_data . items ( ) : lookup = getattr ( self , "handle_%s" % k , None ) if lookup : v = lookup ( v ) lfilter = getattr ( self , "filter_%s" % k , None ) if lfilter : newfilter , newargs = lfilter ( v , args ) gql . append ( newfilter ) args . extend ( newargs ) counter += len ( newargs ) else : gql . append ( " %s = :%s " % ( k , counter ) ) args . append ( v ) counter += 1 conditions = " AND " . join ( gql ) if conditions : conditions = "WHERE %s" % conditions conditions = "SELECT * FROM %s %s ORDER BY %s timestamp DESC" % ( table , conditions , self . inequality ) query = db . GqlQuery ( conditions , * args ) return query
This is getting a bit complicated
This is getting a bit complicated
""" This is getting a bit complicated """ # if there's a value handler, use it # if there's a filter handler user it # will return a filter and args..
self
table