def by_user_condition(condition): queries = [] res = list(User.select(condition)) for i, user in enumerate(res): queries.append(WebPage.select(WebPage.q.user == user.number)) return queries
def get_sentence(filter, sentence): bq = BGUQuery(WebPage.get(sentence.metadata['webpage_id'])) filter.process(list(bq)[sentence.metadata['index']]) return filter