#31435: RecursionError when deleting a model with one to many relationship.
-------------------------------------+-------------------------------------
     Reporter:  Fabian Allendorf     |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  3.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  delete model defer   |             Triage Stage:
  recursionerror                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Fabian Allendorf):

 Replying to [comment:2 Simon Charette]:
 > Judging by the trace of the exception it seems like you already forked
 `django-timeseries` or are using a different package with the same name
 since the Pypi one doesn't have a `models.py` file.
 >
 > In all cases your code was broken because you are accessing a deferred
 field in your `TimeSeries.__init__` model which is not allowed.
 >
 > You can test it out but on any version of Django doing
 `TimeSeries.objects.defer('frequency')` would cause `N + 1` queries to be
 performed where `N = TimeSeries.objects.count()`.
 >
 > You want to do `self._old_frequency = self.__dict__.get('frequency')` in
 there.

 The package `django-timseries` caused a lot of confusion it seems. I
 should have added that its a private package we have developed at our
 company and **not** this one [https://pypi.org/project/django-
 timeseries/].

 Thank you, I think that is exactly the point I was missing.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31435#comment:4>
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/073.b8a7ae761b58f772c42b490b546e5e19%40djangoproject.com.

Reply via email to