Search code examples
google-app-enginecloudendpoints

Google app engine - endpoints


Hy I have a question about Google Endpoints when trying to create an Endpoints model method like this:

@DataPoint.method(request_fields=('id',),
                      path='datapoint/{id}',
                      http_method='GET',
                      name='datapoint.get')
    def datapoint_get(self, datapoint):
        if not datapoint.from_datastore:
                raise endpoints.NotFoundException('Datapoint not found.')
        return datapoint

I also have the "_message_fields_schema" overwritten in the model itself:

_message_fields_schema = ('id', 'id_datapoint', 'created')

My question is why can't i replace the "id" with "id_datapoint" in "request_fields" and "path" ? I know it can be done by a simple query method, but I'd just like to know why the above doesn't work.

Thanks !


Solution

  • So the solution was pretty dumb...I had a model in models.py which was named DataPointModelCollection, so when endpoints generated the library there was a conflict, because it wanted to create the DataPointModelCollection class, but it was already existing. The problem was solved by renaming my existing entity to DataPointModelCollectionList. There was no overlapping between entities after that and the class contained all the methods needed to retrieve specific List.