Ticket #8217: FilePathField-sorted_py2.3.diff

File FilePathField-sorted_py2.3.diff, 746 bytes (added by davidb, 16 years ago)
  • django/forms/fields.py

     
    841841
    842842        if recursive:
    843843            for root, dirs, files in os.walk(self.path):
     844                files.sort(lambda x, y: cmp(x.lower(), y.lower()))
    844845                for f in files:
    845846                    if self.match is None or self.match_re.search(f):
    846847                        f = os.path.join(root, f)
     
    854855            except OSError:
    855856                pass
    856857
     858        self.choices.sort(lambda x, y: cmp(x[1].lower(), y[1].lower()))
    857859        self.widget.choices = self.choices
    858860
    859861class SplitDateTimeField(MultiValueField):
Back to Top