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))
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))