def insert(self, participant_dto): logging.debug('insert %s' % (participant_dto)) participant = ProjectParticipant() participant.project = Project.get(participant_dto.project_key) participant.name = participant_dto.name participant.put() return self.to_dto(participant)
def get_all(self): logging.debug('get_all') participants = ProjectParticipant.all().fetch(1000) participants_dto = [] for participant in participants: participants_dto.append(self.to_dto(participant)) return participants_dto
def get(self, key): logging.debug('get %s' % (key)) return self.to_dto(ProjectParticipant.get(key))
def delete(self, participant_dto): logging.debug('delete %s' % (participant_dto)) participant = ProjectParticipant.get(participant_dto._key) participant.delete()
def update(self, participant_dto): logging.debug('update %s' % (participant_dto)) participant = ProjectParticipant.get(participant_dto._key) participant.name = participant_dto.name participant.put() return self.to_dto(ProjectParticipant.get(participant_dto._key))