Django How to catch ModelForm unique together errors -


i have modelform has unique_together constraint on fields. when pass data form , call form.is_valid(), returns false if record exists , if other error occurs.

so, want in case record exists(unique_together validation fails) , thing in case form.is_vaid() returns false due other reasons. how achieve ?

it have modelform code , traceback errors in both cases give more accurate answer, workaround parse form.errors, corresponding type error or message error , write corresponding code.

ps : message should comment under post lack few reputation points, sorry that.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -