'Filter by dbkey through a raw SQL b/c metadata is a BLOB.'

def filter(self, trans, user, query, dbkey):

    (dbkey_user, dbkey) = decode_dbkey(dbkey)
    dbkey = dbkey.replace("'", "\\'")
    return query.filter(or_(('metadata    like    \'%%"dbkey":    ["%s"]%%\'' % dbkey), ('metadata    like    \'%%"dbkey":    "%s"%%\'' % dbkey)))
