On Dec 4, 2007 11:21 AM, Travis Terry <[EMAIL PROTECTED]> wrote:

> Otherwise, if it lets the exception escape, then everywhere I call
> get_or_create() will have to implement a very non-DRY piece of identical
> code to handle the situation.
>
> Travis
>


Couldn't you implement your own DRY solution?  Write a decorator for the
get_or_create() method that catches exception thrown during the call to
create() and calls get() again.

Jordan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to