Hi,
I am kinda stuck, I've been using Django for a while now, but I cant actually seem to find this thing out. And thats weird because it should be a simple thing.
I've been googling around and can't seem to find a solution, it maybe because it is a simple thing.
The problem is, I have a ModelForm, and it has a FileField, when I render this form with an instance of the model, and the object contains an uploaded file, I would like to show the current file, (like the admin does), but I cant seem to do that.
Neither of these techniques work:
{{ form.as_p }}
{{ field.label_tag }}
I've been searching around in the admins templates, but can't seem to find the magic. The form renders all the other data of the object correctly
Problem number 2 is that since the uploaded file doesn't show when rendering a change form with a instance of an object, the forms fail to validate when i try to save since it knows nothing about the file that was previously uploaded.
So how do you handle filefields in a change form in Django, how to show the current uploaded file, and how to validate the form.