mixkorshun / django-safe-filefield

Secure file field, which allows you to restrict uploaded file extensions.
MIT License
53 stars 10 forks source link

Cannot override label in form #7

Open dpenztech opened 5 years ago

dpenztech commented 5 years ago

If using SafeFileField in model.py, I cannot make using the meta label dictionary override the default label on the rendered form. It works correctly with FileField. Code snippets follow:

models.py -

from safe_filefield.models import SafeFileField class Quote(models.Model): jobfile = SafeFieldField(upload_to='blah/', blank=True, allowed_extensions=(pdf))

forms.py - class QuoteForm(ModelForm): class meta: model = Quote fields = ('jobfile',) labels = { 'jobfile': 'Job File', }

The resulting label is 'Jobfile' when using SafeFieldField and 'Job File' when using FileField.