Задать вопрос

Тел: +7 965 3737 888

505

Просмотров

1

Ответов

Upload a file using newforms

Django's transition from oldforms to newforms is nearing. If you're using recent trunk source code from Django's subversion repository, you should start using newforms.

But there are still some rough edges as of today. File uploading seems to be one of them. (Adrian and other Django folks are well aware of this. Please don't bother them by asking "Are we there yet?")

The Django mailing lists and Google searching didn't turn up any best practices for this area of newforms, so I muddled through it and here's the result. I omit the urls.py code necessary to hook up the zip_upload method to a URL, but otherwise this should be complete.

And if I haven't loaded this with enough caveats...please be aware this code may be obsoleted soon.

Вопрос полезен? Да0/Нет0
file_3874.py(3.6Кб)
None

Ответы (1):

Ответmagus:11.02.2008
Ответ полезен? Да0/Нет0

This snippet is out of date - newforms now supports file uploads on its own, and does not require you to write your own support as in this snippet.