Exemplo n.º 1
0
def record_list(limit, cursor, q, message=False):
    """Return CommentList or triple (comments, next_cursor, more)."""
    i, n, m, c = RecordIndex.search(q, limit, cursor=cursor, message=message)
    if message:
        if n:
            n = n.urlsafe()
        return RecordList(items=i, cursor=n, more=m, count=c)
    return i, n, m, c
Exemplo n.º 2
0
def record_list(limit, cursor, q, message=False):
    """Return CommentList or triple (comments, next_cursor, more)."""
    i, n, m, c = RecordIndex.search(q, limit, cursor=cursor, message=message)
    if message:
        if n:
            n = n.urlsafe()
        return RecordList(items=i, cursor=n, more=m, count=c)
    return i, n, m, c
Exemplo n.º 3
0
 def count(self, message):
     q = json.loads(message.q)
     return RecordList(count=RecordIndex.search(q, None, count=True))
Exemplo n.º 4
0
 def count(self, message):
     q = json.loads(message.q)
     return RecordList(count=RecordIndex.search(q, None, count=True))