@cached_query(SubredditQueryCache)
def get_spam_filtered_links(sr_id):
 return Link._query((Link.c.sr_id == sr_id), (Link.c._spam == True), (Link.c.verdict != 'mod-removed'), sort=db_sort('new'))

@ cached_query ( SubredditQueryCache ) def get_spam_filtered_links ( sr_id ) : return Link . _query ( ( Link . c . sr_id == sr_id ) , ( Link . c . _spam == True ) , ( Link . c . verdict != 'mod-removed' ) , sort = db_sort ( 'new' ) )
note: this query will never run unless someone does an "update" on it .