3👍
✅
No, there isn’t one. You can write your own using path
, match
and recursive
. However, this is how the admin widget form for FilePathField
gets all the paths – https://github.com/django/django/blob/master/django/forms/fields.py#L999
from django.forms.fields import FilePathField
a = FilePathField(path='/path')
print a.choices
Source:stackexchange.com