Maintain uniqueness of a property in the NDB database

后端 未结 5 2069
太阳男子
太阳男子 2020-12-16 00:56

An NDB model contains two properties: email and password. How to avoid adding to the database two records with the same email? NDB doe

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 01:28

    Maybe you are looking for the webapp2-authentication module, that can handle this for you. It can be imported like this import webapp2_extras.appengine.auth.models. Look here for a complete example.

提交回复
热议问题