Yes, and then I also need to import that class into every place that I
want to use it, no?

The benefit of making it part of the model is that any place I'm using
it, I already have the exception handy:

try:
    # ... do some things
    m = MyModel(foo=bar, baz=bling)
    m.save()
except MyModel.FrobNotAllowed:
    # handle the exception...

It's not a big deal but I figured that emulating the framework isn't a
bad idea.

On Aug 19, 5:03 pm, Joshua Russo <josh.r.ru...@gmail.com> wrote:
> All you really need is:
>
> class DoesNotExist(Exception):
>     pass

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

Reply via email to