You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your code does not throw an error because you are saving the same object twice.
class User(Document):
username= StringField(required=True,max_length=10)
email = StringField(required=True,unique=True)
password= StringField(max_length=250,required=True)
u =User('xxx','a@a.com','123')
u.save()
u2 =User('xxx','a@a.com','123')
u2.save()
class User(Document):
#Required
username= StringField(required=True,max_length=10)
email = StringField(required=True,unique=True)
password= StringField(max_length=250,required=True)
u =User('xxx','a@a.com','123')
u.save()
u.save() <-- Not thronging any Exception.
The text was updated successfully, but these errors were encountered: