Esempio n. 1
0
class PostCounter(MBase):
    id = columns.BigInt(index=True, primary_key=True)
    up_votes = columns.Counter()
    down_votes = columns.Counter()
    views = columns.Counter()
    karma = columns.Counter()
    replies = columns.Counter()
Esempio n. 2
0
class DiscussionCounter(MBase):
    id = columns.BigInt(primary_key=True)
    message_count = columns.Counter()
    user_count = columns.Counter()
    view_count = columns.Counter()
    follower_count = columns.Counter()

    def to_dict(self):
        return {
            'message_count': self.message_count,
            'user_count': self.user_count,
            'view_count': self.view_count,
            'follower_count': self.follower_count,
        }
Esempio n. 3
0
class UserCounter(MBase):
    id = columns.Integer(primary_key=True)
    follower_count = columns.Counter()
    following_count = columns.Counter()
    karma = columns.Counter()
    up_vote_given = columns.Counter()
    up_vote_received = columns.Counter()
    down_vote_given = columns.Counter()
    down_vote_taken = columns.Counter()
    messages = columns.Counter()

    def to_dict(self):
        return {
            'followers': self.follower_count,
            'following': self.following_count,
            'karma': self.karma,
            'upvotes': self.up_vote_received,
            'downvotes': self.down_vote_taken,
            'messages': self.messages
        }
Esempio n. 4
0
class Counter(BaseModel):
    user_id = columns.Text(primary_key=True)
    message_id = columns.Counter()
    thread_id = columns.Counter()
    rule_id = columns.Counter()
Esempio n. 5
0
class TopicCounter(MBase):
    id = columns.Integer(primary_key=True)
    views = columns.Counter()
    discussions = columns.Counter()
    messages = columns.Counter()
Esempio n. 6
0
class TestCounterModel(Model):
    partition = columns.UUID(primary_key=True, default=uuid4)
    cluster = columns.UUID(primary_key=True, default=uuid4)
    counter = columns.Counter()
Esempio n. 7
0
 class model(Model):
     partition = columns.UUID(primary_key=True, default=uuid4)
     counter = columns.Counter()
     text = columns.Text()
Esempio n. 8
0
class TestIfNotExistsWithCounterModel(Model):

    id = columns.UUID(primary_key=True, default=lambda: uuid4())
    likes = columns.Counter()