2009/5/17 Patrick <whya...@gmail.com>: > > How do I add data from a fileupload to a database? > For example, if I have a Book model that is for names of books and a > FileNames model that is used on a form, how do I populate Book.title. > > class FileNames(models.Model): > title = models.FileField(upload_to='tmp', blank=False) > > > class Book(models.Model): > title = models.CharField(max_length=30) > > I'm able to upload and parse the file. I'm just not sure how to add > the parsed data to Book. > So FileNames is not a real table? I'm confused ...
Please check http://docs.djangoproject.com/en/dev/topics/http/file-uploads/ it would help you a lot to deal with file uploads. -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net --~--~---------~--~----~------------~-------~--~----~ 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 at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---