def PutChangeLog(self, changed_by):
''' Create a change log for the current state of the hand.
Uses current timestamp in seconds as key.
Args:
changed_by: Integer. Pair number for the user requesting the change.
'''
change_dict = {
"calls" : self.calls_dict(),
"notes" : self.notes,
"ns_score" : self.get_ns_score(),
"ew_score" : self.get_ew_score(),
}
epoch = datetime.datetime.utcfromtimestamp(0)
nowtime = datetime.datetime.now()
change_log = ChangeLog(changed_by=changed_by, change=json.dumps(change_dict))
change_log.key = ndb.Key("ChangeLog", str((nowtime - epoch).total_seconds()),
parent=self.key)
change_log.put()
评论列表
文章目录