Пример #1
0
 def to_model(self):
     return EventModel(
         event_type=EventType.START,
         user_id=None,
         village_id=self.village.identity,
         generation=self.village.generation,
         content=self.content);
Пример #2
0
 def to_model(self):
     return EventModel(
         event_type=EventType.MESSAGE,
         user_id=self.user.identity,
         village_id=self.village.identity,
         generation=self.village.generation,
         content=self.content);
Пример #3
0
 def to_model(self):
     return EventModel(
         event_type=EventType.LEAVE,
         user_id=self.resident.user_id,
         village_id=self.resident.village_id,
         generation=self.resident.generation,
         content=self.content);
Пример #4
0
 def to_model(self):
     return EventModel(
         event_type=EventType.RESET,
         user_id=None,
         village_id=self.new_village.identity,
         generation=self.new_village.generation-1,  # record previous generation
         content=self.content);