Пример #1
0
    def _rel(cls, thing1_cls, thing2_cls):
        if (thing1_cls, thing2_cls) == (Account, Link):
            return CassandraLinkVote
        elif (thing1_cls, thing2_cls) == (Account, Comment):
            return CassandraCommentVote

        raise TdbException("Can't find relation for %r(%r,%r)" %
                           (cls, thing1_cls, thing2_cls))
Пример #2
0
    def rel(cls, thing1_cls, thing2_cls):
        if (thing1_cls, thing2_cls) == (Account, Link):
            return LinkVotesByAccount
        elif (thing1_cls, thing2_cls) == (Account, Comment):
            return CommentVotesByAccount

        raise TdbException("Can't find relation for %r(%r,%r)" %
                           (cls, thing1_cls, thing2_cls))