News for hackers. Stuff that matters.
Re:I Accidentally Deleted All Our Data by JonnieCache on Friday November 18, 2011 @03:13PM (#3253202)
OUCH.

Doesn't django let you check if models are valid without saving them?

In rails I can do:

    Family.all.select {|f| !f.valid?}
Re:I Accidentally Deleted All Our Data by kingkilr on Friday November 18, 2011 @03:15PM (#3253214)
Django's ORM does (obj.full_clean()), but he's not using Django's ORM, he's using mongoengine, I have no idea if it does.
Re:I Accidentally Deleted All Our Data by sibsibsib on Friday November 18, 2011 @08:12PM (#3254237)
mongoengine does do validation. It can be disabled on a per-model basis though.
Re:I Accidentally Deleted All Our Data by taylorfausak on Friday November 18, 2011 @03:24PM (#3253255)
Django offers a validate function that does exactly that. Unfortunately, the email uniqueness constraint is handled in our save function, due to some backend complexity. So it wouldn't have helped here. Plus, it was a typo that caused the problem, not the function :)
Re:I Accidentally Deleted All Our Data by charliesome on Friday November 18, 2011 @11:06PM (#3254536)
I'm struggling to think of what kind of backend complexity would make it infeasible to check email uniqueness in validation.

Care to elaborate?