[Django]-How to get all available values for FilePathField in Django 1.5?

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

Leave a comment