Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » File Uploads Form Field "title" Questions [RSS Feed]

#1 Jan. 27, 2011 15:54:04

h.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

File Uploads Form Field "title" Questions


I'm trying to code and implement a file upload screen. I've looked at
the documentation at:http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/and the document shows a simple upload form called UploadFileForm
which is shown with two fields coded for it. I'm assuming that the
field named "file" of type forms.FileField is just the file
itself(location, name, and data), but if so what's the "title" field
of type forms.CharField used for and how is it processed? I don't
think it's mentioned at all in the documentation except for being
shown to be part of the form. Can someone please explain its use and
how it should be processed? Thanks.

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

Offline

#2 Jan. 27, 2011 16:10:02

Rob M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

File Uploads Form Field "title" Questions


I think this is trivial considering that the example does not use
request.POST They must of just forgot to use the title field in the
view?

One practical example could be to use the title as the filename which you
intend to store in your filesystem. You can do this by changing the filename
of the file object to the "title" string you stored in the request. This
would be done in a view method.

-Rob

On Thu, Jan 27, 2011 at 10:53 AM, hank23 <hversem...@stchas.edu> wrote:

> I'm trying to code and implement a file upload screen. I've looked at
> the documentation at:
>
>http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/>
> and the document shows a simple upload form called UploadFileForm
> which is shown with two fields coded for it. I'm assuming that the
> field named "file" of type forms.FileField is just the file
> itself(location, name, and data), but if so what's the "title" field
> of type forms.CharField used for and how is it processed? I don't
> think it's mentioned at all in the documentation except for being
> shown to be part of the form. Can someone please explain its use and
> how it should be processed? Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>


--
Robert McQueen
Massachusetts Institute of Technology
Class of 2012, Course 6.3 - Computer Science

rmcqu...@mit.edu

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

Offline

#3 Jan. 27, 2011 16:51:22

Daniel R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

File Uploads Form Field "title" Questions


On Thursday, January 27, 2011 3:53:57 PM UTC, hank23 wrote:
>
> I'm trying to code and implement a file upload screen. I've looked at
> the documentation at:
>
>http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/>
> and the document shows a simple upload form called UploadFileForm
> which is shown with two fields coded for it. I'm assuming that the
> field named "file" of type forms.FileField is just the file
> itself(location, name, and data), but if so what's the "title" field
> of type forms.CharField used for and how is it processed? I don't
> think it's mentioned at all in the documentation except for being
> shown to be part of the form. Can someone please explain its use and
> how it should be processed? Thanks.


It's just another field on the form. It's got nothing whatsoever to do with
the file. It's just to show you can have as many fields on a form as you
like, and they can be all different types.
--
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-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Jan. 27, 2011 16:59:15

h.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

File Uploads Form Field "title" Questions


So then the "title" field isn't really related to the file field which
will represent the actual file that I'm trying to upload then right?
And my form really needs to have only the FileField for the file that
I plan to upload then right?

On Jan 27, 10:51 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Thursday, January 27, 2011 3:53:57 PM UTC, hank23 wrote:
>
> > I'm trying to code and implement a file upload screen. I've looked at
> > the documentation at:
>
> >http://docs.djangoproject.com/en/1.2/topics/http/file-uploads/>
> > and the document shows a simple upload form called UploadFileForm
> > which is shown with two fields coded for it. I'm assuming that the
> > field named "file" of type forms.FileField is just the file
> > itself(location, name, and data), but if so what's the "title" field
> > of type forms.CharField used for and how is it processed? I don't
> > think it's mentioned at all in the documentation except for being
> > shown to be part of the form. Can someone please explain its use and
> > how it should be processed? Thanks.
>
> It's just another field on the form. It's got nothing whatsoever to do with
> the file. It's just to show you can have as many fields on a form as you
> like, and they can be all different types.
> --
> 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-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » File Uploads Form Field "title" Questions [RSS Feed]

Board footer

Moderator control

Enjoy the 17th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support