For the reference of future generations, the following seems to work:
class MyAdminForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(MyAdminForm, self).__init__(*args, **kwargs)
self.fields['some_fpath_field'].choices = [('','--'),]
This is driving me batty...
Because there's no blank option in the form field for a FilePathField
with blank=False, then if you:
- Have an Admin Inline with a FilePathField and another required field
- Have extra (i.e. intentionally blank) inlines in your form
You will get an error upon saving b
2 matches
Mail list logo