@@ -0,0 +1,1386 @@
+from schematics import models, types%0Aimport msgpack%0A%0A%0Aclass MsgpackModel(models.Model):%0A%0A    def pack(self):%0A        return msgpack.packb(self.to_primitive())%0A%0A    @classmethod%0A    def unpack(cls, bytes):%0A        return cls(%7Bk.decode(): value for k, value in msgpack.unpackb(bytes).items()%7D)%0A%0A%0Aclass LogEntry(MsgpackModel):%0A    index = types.IntType()%0A    term = types.IntType()%0A    command = types.StringType()%0A%0A%0Aclass AppendEntriesRPCRequest(MsgpackModel):%0A    term = types.IntType()%0A    leader_id = types.StringType()%0A    prev_log_index = types.IntType()%0A    prev_log_term = types.IntType()%0A    leader_commit = types.IntType()%0A    entries = types.ListType(types.ModelType(LogEntry))%0A%0A%0Aclass AppendEntriesRPCResponse(MsgpackModel):%0A    term = types.IntType()%0A    success = types.BooleanType()%0A    index = types.IntType()%0A%0A%0Aclass RequestVoteRPCRequest(MsgpackModel):%0A    term = types.IntType()%0A    candidate_id = types.StringType()%0A    last_log_index = types.IntType()%0A    last_log_term = types.IntType()%0A%0A%0Aclass RequestVoteRPCResponse(MsgpackModel):%0A    term = types.IntType()%0A    success = types.BooleanType()%0A%0A%0Aclass RaftMessage(MsgpackModel):%0A    content = types.PolyModelType(%5BAppendEntriesRPCRequest,%0A                                   AppendEntriesRPCResponse,%0A                                   RequestVoteRPCRequest,%0A                                   RequestVoteRPCRequest%5D)%0A

Add rafter/models.py