def get(self, request):
    entity_id = request.id
    if not entity_id:
      message = 'Request should specify an id.' % entity_id
      raise endpoints.BadRequestException(message)

    entry = Contact.get_by_id(entity_id)
    
    if not entry:
      message = 'No entity with the id "%s" exists.' % entity_id
      raise endpoints.NotFoundException(message)

    return _BuildContactMessage(entry)
Ejemplo n.º 2
0
  def get(self, request):
    #TODO(abahgat): would this work with placeholders? /_ah/spi/contacts/entity_id
    entity_id = request.id
    if not entity_id:
      message = 'Request should specify an id.' % entity_id
      raise endpoints.BadRequestException(message)

    entry = Contact.get_by_id(entity_id)
    
    if not entry:
      message = 'No entity with the id "%s" exists.' % entity_id
      raise endpoints.NotFoundException(message)

    return _BuildContactMessage(entry)