Carpetfizz
Carpetfizz

Reputation: 9169

Unable to access all the entities in a data store GAE

I have a simple data model like this:

class Player(db.Model):
    name = db.StringProperty()

To save the player I do this:

player = Player(name="TestUser")
        player.put()

It doesn't error out during this step, but when I try to access all the items using this:

for player in Player.all():
        print(player.name)

I get the following error:

RuntimeError: EventError(ValidationError(u"Unexpected attribute '\u200bindexes' for object of type IndexDefinitions.",),)

My index.yaml contains the following:

​indexes:
- kind: Player
    ancestor: no
    properties:
    - name: name

Any insight on the issue would be great, thanks!

Upvotes: 0

Views: 124

Answers (1)

Hernán Acosta
Hernán Acosta

Reputation: 695

I write here because I can't comment yet.

You don't need a custom index for only one property and no ancestor. They are created automatically. Just remove it.

Note: If you need a custom index without ancestor you don't need to specify that:

- kind: Player
  properties:
  - name: name
  - name: enabled

Upvotes: 2

Related Questions