#34847: Serializer infinite recursion on M2M field if reference vars in init
--------------------------------------+------------------------------------
     Reporter:  Arthur Hanson         |                    Owner:  nobody
         Type:  Bug                   |                   Status:  new
    Component:  Core (Serialization)  |                  Version:  4.2
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by David Sanders):

 Hi Arthur,

 Just FYI this appears to make it work if you're looking for an immediate
 fix:

 {{{
 serializers.serialize("json", Item.objects.prefetch_related('tags'))
 }}}

 The docs state that `serialize()` expects a queryset rather than a
 material list, however, without prefetching we get the same infinite
 recursion… so I'd wager this will remain accepted.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34847#comment:3>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018aa91aa852-6ea1ccfe-a3f6-4dd6-a056-3c073d1dbad1-000000%40eu-central-1.amazonses.com.

Reply via email to