Mongoengine runs validate also on non changed fields before saving. #208

tabdulradi opened this Issue Jan 3, 2013 · 1 comment


None yet

2 participants

class User(Resource):
    state = IntField(required=True)
    name = SmallStringField(required=True)

u = User()
u.state = 1 = "Tamer"

u1 = User.objects.only('name').first() = "Radian" # Fails because state is required

Mongoengine runs validate on all fields before save, even if there they are not changed. Which cases the above problem. I suggest save should validate changed fields only in case of partial documents.

I am running the stable Mongoengine version from pip.

@rozza I gather that this issue has been grouped under Features we are not sure of but any updates on what has been planned ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment