Fwd: upload csv file from different directories

2015-05-02 Thread sum abiut
-- Forwarded message -- From: sum abiut Date: Thu, Apr 30, 2015 at 2:18 PM Subject: upload csv file from different directories To: django-users@googlegroups.com Hi I am writing an app that upload csv file and write csv data to models. So far everything is working fine. What i

upload csv file from different directories

2015-04-29 Thread sum abiut
Hi I am writing an app that upload csv file and write csv data to models. So far everything is working fine. What i want to do now is to be able get the users to be able to upload csv files from different directories. I cannot seem to figure this out, i need directions. form the function

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
That was it, I managed Thank you -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: Upload csv file

2013-04-24 Thread Shawn Milochik
http://docs.python.org/2/library/csv.html#csv.DictReader -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to th

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
I have a problem that I am not able to resolve. With the code I left in the previous post, you are entering data in csv db without problems, but for example the csv file looks like this: Namo,Sobrenome Rui,Gomes Renato,Aimar And I just want it to be inserted into the db (Renato Aimar and Rui Gom

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
I have a problem that I am not able to resolve. With the code I left in the previous post, you are entering data in csv db without problems, but for example the csv file looks like this: Name, Surname Rui Gomes Renato, Aimar And I just want it to be inserted into the db (Renato Gomes and Rui, Ai

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
It was because I first had to enter the fields and now wanted by csv. So now I removed the fields, and only got the upload. How are here: http://plnkr.co/edit/hoaPt2ljRDZbw7XdW80Q And it's ok. Already inserting data from csv. Thank you for your help -- You received this message because you are

Re: Upload csv file

2013-04-24 Thread abhijeet shete
According to form you used in your template it will send only csv file after clicking on submit button. {% csrf_token %} Submit If you want to access Nome and Sobrenome in views on submit button, then you need to pass these inputs in the same form you used for submit as {% csr

Re: Upload csv file

2013-04-24 Thread abhijeet shete
According to form you used in your template it will send only file {% csrf_token %} Submit -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-u

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
Ok, I made the changes as you said. But when I choose the csv file and then I click the submit button, it gives me the following error has: *"Key 'Nome' not found in "* * * I do not know why* * -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: Upload csv file

2013-04-24 Thread abhijeet shete
1. In your views.index function you have written something like this file = request.FILES for line in file: You cant use file object directly instead try some thing like this file = request.FILES['file'] for line in file.readlines(): line = line.split(';') 2. Y

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
What I'm doing is the following link: http://plnkr.co/edit/hoaPt2ljRDZbw7XdW80Q I can input the registration, filling and pressing the add. But now, I wanted to select a csv file and insert the data. I'm trying the way the link is there, but do not know if it's correct, because I'm starting in

Re: Upload csv file

2013-04-24 Thread abhijeet shete
Can you please briefly explain your model structure and how you are trying to save csv in MongoDB so that we can check whats going wrong. > Cheers. Abhijeet Shete -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: Upload csv file

2013-04-24 Thread Hélio Miranda
I mogodb to enter data in, can not pass data from csv into a model, you must be a Document -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr

Re: Upload csv file

2013-04-23 Thread Mario Gudelj
Have you looked at http://django-csv-importer.readthedocs.org/en/latest/? On 24 April 2013 05:38, Hélio Miranda wrote: > I have a Django application that interacts with the mongodb data entry. > But now he wanted to be able to insert data from a csv file upload. > > Someone can help me? > > -

Re: Upload csv file

2013-04-23 Thread Hélio Miranda
I have a Django application that interacts with the mongodb data entry. But now he wanted to be able to insert data from a csv file upload. Someone can help me? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Upload csv file

2013-04-23 Thread Shawn Milochik
MongoDB documents are practically indistinguishable from Python dictionaries. You can use the csv module (csv.DictReader) to read in the CSV file and the pymongo library to write those dicts to Mongo. This really has nothing at all to do with Django. -- You received this message because you are

Upload csv file

2013-04-23 Thread Hélio Miranda
Hi I am having a problem which is as follows: In django want to upload a csv file, read that file and enter the data in DB MongoDB. Can anyone help me do this? I am new to django and I'm not quite see how I can do this ... thank you -- You received this message because you are subscribed to t