def exist_by_sender_recipient( cls, sender_id, recipient_id ): count = cls.query( ndb.AND( cls.sender == sender_id, cls.recipient == recipient_id )).count( 1 ) return count > 0