Reputation: 2537
I have an ndb.Model class and inside it there is a particular attribute that calls a certain function as validator:
class Article(ndb.Model):
itemList = ndb.StringProperty()
...
penInspc = ndb.IntegerProperty(default=0, indexed=True, validator=minPen)
I want the function minPen() to print the ID of the instance of class Article. How do I do that?
Upvotes: 0
Views: 84
Reputation:
Just use a hook before put. This is as effective as a validator but also won’t mess up your queries in case you don’t have old data that do not respect the new validator rules.
Upvotes: 1