Exemple #1
0
def _sponsored_link_query(status, author_id = None):
    q = Link._query(Link.c.sr_id == get_promote_srid(),
                    Link.c._spam == (True, False),
                    Link.c._deleted == (True,False),
                    sort = db_sort('new'))
    if status is not None:
        q._filter(Link.c.promote_status == status)
    if author_id is not None:
        q._filter(Link.c.author_id == author_id)
    return make_results(q)
Exemple #2
0
def _sponsored_link_query(status, author_id=None):
    q = Link._query(Link.c.sr_id == get_promote_srid(),
                    Link.c._spam == (True, False),
                    Link.c._deleted == (True, False),
                    sort=db_sort('new'))
    if status is not None:
        q._filter(Link.c.promote_status == status)
    if author_id is not None:
        q._filter(Link.c.author_id == author_id)
    return make_results(q)
 def query(reddits):
     sr_ids = Subreddit.user_subreddits(c.user)
     res = queries._get_sr_comments(sr_ids)
     res1 = c.site.get_links('new', 'all')
     res1 = queries.make_results(res1)
     return queries.merge_results(res1,res)
 def query(reddits):
     sr_ids = Subreddit.user_subreddits(c.user)
     res = queries._get_sr_comments(sr_ids)
     res1 = c.site.get_links('new', 'all')
     res1 = queries.make_results(res1)
     return queries.merge_results(res1, res)