Changes between Initial Version and Version 3 of Ticket #32336


Ignore:
Timestamp:
Jan 9, 2021, 7:14:40 PM (4 years ago)
Author:
Tim McCurrach
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32336

    • Property Owner changed from nobody to Tim McCurrach
    • Property Has patch set
  • Ticket #32336 – Description

    initial v3  
    3838=== Proposed Solution ===
    3939Cache the return value of `get_readonly_fields` in some instance variable `self._readonly_fields`, and reset this value at the beginning of every request. This way the various variables that store readonly fields will all be referring to the same objects. For `InlineModelAdmin`s the value of `self._readonly_fields` would need to be set to `None` on instantiation (which happens for every new change view request).
     40
     41=== Tests ===
     42I'm not sure if this needs a separate test. I have adapted `PostAdmin` (used in lots of admin tests, in particular the ones that test readonly_fields) to cater for this case. So although no tests are added, there are plenty of failing tests before the fix.
Back to Top