Ticket #17634: master...ticket-17634-multivalue-dict-optimisation.diff

File master...ticket-17634-multivalue-dict-optimisation.diff, 592 bytes (added by Simon Charette, 13 years ago)
  • django/utils/datastructures.py

    diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py
    index 46f705f..5d75682 100644
    a b def setlistdefault(self, key, default_list=()):  
    331331
    332332    def appendlist(self, key, value):
    333333        """Appends an item to the internal list associated with key."""
    334         self.setlistdefault(key, [])
    335         super(MultiValueDict, self).__setitem__(key, self.getlist(key) + [value])
     334        super(MultiValueDict, self).setdefault(key, []).append(value)
    336335
    337336    def items(self):
    338337        """
Back to Top