Ticket #7957: django_extra.diff

File django_extra.diff, 1.3 KB (added by Matthijs, 16 years ago)

patch to fix extra().extra() problem

  • db/models/sql/query.py

     
    15291529        if select:
    15301530            # The extra select might be ordered (because it will be accepting
    15311531            # parameters).
    1532             if (isinstance(select, SortedDict) and
    1533                     not isinstance(self.extra_select, SortedDict)):
     1532            if not isinstance(self.extra_select, SortedDict):
    15341533                self.extra_select = SortedDict(self.extra_select)
    1535             self.extra_select.update(select)
     1534            self.extra_select.append(SortedDict(select))
    15361535        if select_params:
    15371536            self.extra_select_params += tuple(select_params)
    15381537        if where:
  • utils/datastructures.py

     
    121121    def update(self, dict_):
    122122        for k, v in dict_.items():
    123123            self.__setitem__(k, v)
     124   
     125    def append(self, data):
     126        for key, value in data.iteritems():
     127            super(SortedDict, self).__setitem__(key, value)
     128            self.keyOrder.append(key)
    124129
    125130    def setdefault(self, key, default):
    126131        if key not in self.keyOrder:
Back to Top