Changes between Version 1 and Version 2 of Ticket #31435, comment 2


Ignore:
Timestamp:
Apr 8, 2020, 8:28:26 AM (5 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31435, comment 2

    v1 v2  
    66
    77You want to do `self._old_frequency = self.__dict__.get('frequency')` in there.
     8
     9For the record the commit that introduced the recursion error for your bogus `Model.__init__` is f110de5c04818b8f915dcf65da37a50c1424c6e6 which started deferring fields of model when possible to avoid fetching large amount of data when unnecessary on deletion (#30191).
     10
     11It is also [https://docs.djangoproject.com/en/3.0/ref/models/instances/#customizing-model-loading documented that the right way to implement custom model loading] should be done using `Model.from_db()`. I guess you could assign `django.db.models.DEFERRED` to `_old_frequency` in there and special case it's access when necessary instead of assigning `None` to it.
Back to Top