zjm1126
zjm1126

Reputation: 66647

how to make the StringListProperty's value unique in google-app-engine

the next code is error:

class Thread(db.Model):
  members = db.StringListProperty(unique =True)

thanks

Upvotes: 0

Views: 136

Answers (2)

Wooble
Wooble

Reputation: 89897

You can make a single property unique to a kind and entity group by making it the entity's key_name. The datastore will not enforce uniqueness for you in any other way.

Upvotes: 1

Emilien
Emilien

Reputation: 3051

There is no unique parameter for the constructor of a property. This is why your code crashes.

There is unfortunately no built-in mechanism on the datastore level. You will need to implement that in your code.

Upvotes: 3

Related Questions