On Jul 8, 7:25 pm, Rodion Raskolnikiv <noah...@gmail.com> wrote:
> To be more specific, here is what I have tried:
>
> # in models.py
> from django import forms
>
> class UploadFileForm(forms.Form):
>     title = forms.CharField(max_length=50)
>     file  = forms.FileField()
>
> # in admin.py
> from proj.app.models import UploadFileForm
>
> admin.site.register(UploadFileForm)
>
> Which gives me the error message:
> TypeError at /admin/
> 'DeclarativeFieldsMetaclass' object is not iterable
>
> Am I heading in the wrong direction?

I don't know what this message has to do with your original question
about file uploads. This is simply a matter of admin configuration -
for some reason you are trying to register a Form as a model in the
admin, which of course won't work. If you revert to the syntax of
declaring the class as a subclass of models.Model, and the fields as
models.CharField and models.FileField etc, all should be well.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to