How to verify object creation in Django ?

Posted by Martin on Stack Overflow See other posts from Stack Overflow or by Martin
Published on 2010-05-22T19:41:30Z Indexed on 2010/05/22 19:50 UTC
Read the original article Hit count: 149

Filed under:
|

So.. this never crossed my head before but now I just can't figure out how to do that !!

I want to verify that the object I created was really created, and return True or False according to that :

obj = object(name='plop')
try:
 obj.save()
 return True
except ???:
  return False

Any idea ? Cheers, -M

© Stack Overflow or respective owner

Related posts about python

Related posts about django