mirror of
https://github.com/django/django.git
synced 2025-09-28 17:39:10 +00:00
Fixed #3629 -- In oldforms, differentiate files in a recursive FilePathField.
Thanks, James Turnbull. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4896 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
78b86d7eeb
commit
96bf5e853c
@ -923,7 +923,8 @@ class FilePathField(SelectField):
|
|||||||
for root, dirs, files in os.walk(path):
|
for root, dirs, files in os.walk(path):
|
||||||
for f in files:
|
for f in files:
|
||||||
if match is None or match_re.search(f):
|
if match is None or match_re.search(f):
|
||||||
choices.append((os.path.join(root, f), f))
|
f = os.path.join(root, f)
|
||||||
|
choices.append((f, f.replace(path, "", 1)))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
for f in os.listdir(path):
|
for f in os.listdir(path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user