#17776: DoesNotExist is not picklable
-------------------------------------+-------------------------------------
     Reporter:  ambv                 |                    Owner:  nobody
         Type:  Bug                  |                   Status:  reopened
    Component:  Database layer       |                  Version:  1.3
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by ask@…):

 You can make this pickleable by defining __reduce__, e.g.

 {{{
 class DoesNotExist(..):

      def __reduce__(self):
          return _unpickle_DoesNotExist, (self.app_label, self.model,
 self.args)


  def _unpickle_DoesNotExist(app_label, model, args):
      return get_model(app_label, model).DoesNotExist(*args)

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17776#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to