I've got an app that wants a file upload and some other attributes.
If the user fills in the file but has problems with the other
attributes, it should re-present the form with the attributes filled
with his values, including the name of the file that he selects. In
use the example below
Oh, make sure your upload form specifies the 'enctype' attribute so it
will actually send a file object, like:
{% block content %}
Upload a file...
{{ form.as_p }}
{% endblock %}
--~--~-~--~~~---~--~~
You received this message because you are subscribed
On May 18, 2009, at 12:12 PM, Patrick wrote:
>
> Well, I guess what I'm confused about is adding data that doesn't come
> directly from forms.
> I ended up doing this and it seemed to work.
>
> for line in file:
>b=Book()
>b.title=line
>b.save()
Here is how I do it, Model, Form,
3 matches
Mail list logo