def parse(self, data):
self.parser.username = self.username
result = self.parser.parse(data, lexer=self.lexer)
tables = self.findTables(result)
if boartty.db.project_table in tables:
result = and_(boartty.db.story_table.c.project_key == boartty.db.project_table.c.key,
result)
tables.remove(boartty.db.project_table)
if boartty.db.tag_table in tables:
result = and_(boartty.db.story_tag_table.c.tag_key == boartty.db.tag_table.c.key,
boartty.db.story_tag_table.c.story_key == boartty.db.story_table.c.key,
result)
tables.remove(boartty.db.tag_table)
if boartty.db.user_table in tables:
result = and_(boartty.db.story_table.c.user_key == boartty.db.user_table.c.key,
result)
tables.remove(boartty.db.user_table)
#if boartty.db.file_table in tables:
# result = and_(boartty.db.file_table.c.revision_key == boartty.db.revision_table.c.key,
# boartty.db.revision_table.c.story_key == boartty.db.story_table.c.key,
# result)
# tables.remove(boartty.db.file_table)
if tables:
raise Exception("Unknown table in search: %s" % tables)
return result
评论列表
文章目录