Changes between Version 1 and Version 2 of Ticket #29226, comment 4


Ignore:
Timestamp:
Mar 18, 2018, 12:09:47 PM (7 years ago)
Author:
benjaoming

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29226, comment 4

    v1 v2  
    33Sounds like a time-consuming issue for those who might encounter it. I agree with Tim that hopefully someone would think twice about this, but having dealt with issues related to dict key ordering myself, I have to admit that you get it wrong sometimes.
    44
    5 Also, the example in the docs [1] would directly lead to the issue, except that it does append/remove/prepend the same items, but it stills seems like it would easily misguide someone to do that
     5Also, the example in the docs (1) would directly lead to the issue, except that it does append/remove/prepend the same items, but it stills seems like it would easily misguide someone to do that
    66
    77The solution that Markus and I just discussed was that you can A) use `OrderedDict` or B) add `modify_settings` twice like this:
     
    2828Two suggestions:
    2929
    30 1. Updating the (misguiding) docs example [1] so it applies `modify_settings` several times without elaborating lots about why-
     301. Updating the (misguiding) docs example (1) so it applies `modify_settings` several times without elaborating lots about why-
    31311. Add a warning box about doing append+reject on the same items (re-ordering)
    3232
    3333As I understand Tim's comment, the latter would be a bit over the top, but the former could be preferable as it wouldn't complicate the docs much?
    3434
    35 [1] https://docs.djangoproject.com/en/2.0/topics/testing/tools/#django.test.SimpleTestCase.modify_settings
     35(1) https://docs.djangoproject.com/en/2.0/topics/testing/tools/#django.test.SimpleTestCase.modify_settings
Back to Top