Ticket #9208: query.py.diff

File query.py.diff, 386 bytes (added by mstamat@…, 16 years ago)

fix for the behaviour of latest() when there are more than one entries that have the same "latest" timestamp

  • ./django/db/models/query.py

    old new  
    352352        obj = self._clone()
    353353        obj.query.set_limits(high=1)
    354354        obj.query.add_ordering('-%s' % latest_by)
     355        obj.query.add_ordering('-%s' % 'pk')
    355356        return obj.get()
    356357
    357358    def in_bulk(self, id_list):
Back to Top