Re: CSV file

2023-06-11 Thread Mz Gz
te: > >> Hi >> >> I have web app survey that collect data and generate a CSV file, >> I'm using railway to deploy my web app, running on 8GB RAM and each time >> I generate a file, the server goes down and display "Application failed to >> respond&q

Re: CSV file

2023-06-10 Thread Alec Delaney
For server On Thu, Jun 8, 2023, 15:03 Percy Masekwameng wrote: > Hi > > I have web app survey that collect data and generate a CSV file, > I'm using railway to deploy my web app, running on 8GB RAM and each time I > generate a file, the server goes down and display &q

Re: CSV file

2023-06-09 Thread Percy Masekwameng
s else: claim_notes = " " writer.writerow([assessor_details, obj.assessor.email, obj.insurer_name.name, obj.scheme_name.name," ", obj.claim_status, date_submited,obj.created, date_payment,obj.submission_month, obj.capture_month, date_paid_month, obj.policy_number, principal_pr

Re: CSV file

2023-06-08 Thread Peter Benjamin Ani
Try using Python anywhere On Fri, 9 Jun 2023 at 07:15, Muhammad Juwaini Abdul Rahman < juwa...@gmail.com> wrote: > Probably you need to show the code snippet on where you generate the csv > file. > > On Fri, 9 Jun 2023 at 13:51, Percy Masekwameng < > percymasekwameng...@g

Re: CSV file

2023-06-08 Thread Muhammad Juwaini Abdul Rahman
Probably you need to show the code snippet on where you generate the csv file. On Fri, 9 Jun 2023 at 13:51, Percy Masekwameng < percymasekwameng...@gmail.com> wrote: > It depends on the data in the database > > Explain more about workers settings and provide me with an example &g

Re: CSV file

2023-06-08 Thread Prosper Lekia
Ask this question on the Railway Discord community. The expert their will tell you if it's a Railway thing or not. But you should look more at your code, your settings.py. On Thu, Jun 8, 2023, 20:03 Percy Masekwameng wrote: > Hi > > I have web app survey that collect data and

Re: CSV file

2023-06-08 Thread Percy Masekwameng
something to do with your workers' settings? > > On Fri, 9 Jun 2023 at 03:02, Percy Masekwameng < > percymasekwameng...@gmail.com> wrote: > >> Hi >> >> I have web app survey that collect data and generate a CSV file, >> I'm using railway to deplo

Re: CSV file

2023-06-08 Thread Muhammad Juwaini Abdul Rahman
How big is the file? I don't think a mere 2K records can kill an 8GB RAM machine. Probably something to do with your workers' settings? On Fri, 9 Jun 2023 at 03:02, Percy Masekwameng < percymasekwameng...@gmail.com> wrote: > Hi > > I have web app survey that collec

CSV file

2023-06-08 Thread Percy Masekwameng
Hi I have web app survey that collect data and generate a CSV file, I'm using railway to deploy my web app, running on 8GB RAM and each time I generate a file, the server goes down and display "Application failed to respond" the database table has over 2k records Is there any way

Re: help me plz: getting error while importing csv file into database

2021-06-20 Thread Luciano Martins
you have to pass the 'path' variable into open I believe that's it Em sexta-feira, 18 de junho de 2021 às 15:22:41 UTC-3, rammano...@gmail.com escreveu: > Hi > i am trying to import the csv file data into database > my views.py > def Filter(request): >

help me plz: getting error while importing csv file into database

2021-06-18 Thread ram manoj Vuyyuru
Hi i am trying to import the csv file data into database my views.py def Filter(request): if request.method=="POST": form = DataForm(request.POST, request.FILES) if form.is_valid(): initial_obj = form.save(commit=False) data=initial

Re: help me plz: getting error while importing csv file into database

2021-06-18 Thread ram manoj Vuyyuru
t iterable thank you On Fri, Jun 18, 2021 at 10:52 PM ram manoj Vuyyuru < rammanojvuyy...@gmail.com> wrote: > Hi > i am trying to import the csv file data into database > my views.py > def Filter(request): > if request.method=="POST": > form =

Re: Please I am developing an E- voting system but I want the admin to register the voters using CSV file and a random passwords will be sent to their emails, to aid them login

2021-03-16 Thread Kasper Laudrup
Start out by learning how to write an email. The subject should contain the subject of the email with more details in the body. It has to know what you're really asking for here and if you even have a question. Kind regards, Kasper Laudrup -- You received this message because you are subscrib

Re: Please I am developing an E- voting system but I want the admin to register the voters using CSV file and a random passwords will be sent to their emails, to aid them login

2021-03-16 Thread Philip Mutua
Where is the code snippet so that I might help ? On Tue, 16 Mar 2021, 16:11 Ageboba Alexander, wrote: > -- > 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 dj

Re: Please I am developing an E- voting system but I want the admin to register the voters using CSV file and a random passwords will be sent to their emails, to aid them login

2021-03-16 Thread Next Marley
add me on github let me help you https://github.com/Divmarley On Tue, 16 Mar 2021 at 13:11, Ageboba Alexander wrote: > -- > 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

Please I am developing an E- voting system but I want the admin to register the voters using CSV file and a random passwords will be sent to their emails, to aid them login

2021-03-16 Thread Ageboba Alexander
-- 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 view this discussion on the web visit https://groups.google.com/d

Re: Import csv file on django view

2020-07-25 Thread Ronaldo Mata
Hi Naresh Jonnala. Yes, it's work to detect delimiter on csv file, But still I don't know how to detect what is the current encoding of csv file 🤔 I need to know how to implement a good uploading csv file view on django -- You received this message because you are subscribed to

Re: Import csv file on django view

2020-07-25 Thread Naresh Jonnala
t the >>>>>>>>> delimiter is when you read it? If yes, what is the use case for this? >>>>>>>>> You >>>>>>>>> might not need a universal solution, maybe just put all the info into >>>>>>>>> a csv >>>

Re: Import csv file on django view

2020-07-24 Thread Liu Zheng
>>>>>>>> >>>>>>>> Hi Kovy, I'm using csv module, but I need to handle the delimiters >>>>>>>> of the files, sometimes you come separated by "," others by ";" and >>>>>

Re: Import csv file on django view

2020-07-24 Thread Ronaldo Mata
etimes you come separated by "," others by ";" and >>>>>>> rarely >>>>>>> by "|" >>>>>>> >>>>>>> El mié., 22 jul. 2020 a las 10:28, Kovy Jacob () >>>>>>> escribió: >>&g

Re: Import csv file on django view

2020-07-24 Thread Jani Tiainen
t;>> Could you just use the standard python csv module? >>>>>>> >>>>>>> On Jul 22, 2020, at 10:25 AM, Ronaldo Mata >>>>>>> wrote: >>>>>>> >>>>>>> Hi Liu thank for your answer. >>&

Re: Import csv file on django view

2020-07-24 Thread Ronaldo Mata
st use the standard python csv module? >>>>>> >>>>>> On Jul 22, 2020, at 10:25 AM, Ronaldo Mata >>>>>> wrote: >>>>>> >>>>>> Hi Liu thank for your answer. >>>>>> >>>>

Re: Import csv file on django view

2020-07-22 Thread Liu Zheng
some examples: >>>>>> >>>>>> 1. If the files uploaded to your server are all expected to be small >>>>>> csv files (less than a few MB and not many users do it concurrently), you >>>>>> can do the following: >>>>>

Re: Import csv file on django view

2020-07-22 Thread Ronaldo Mata
dict keys when >>>> iterating by rows, and i thought it could be encoding (for this reason i >>>> wanted to prepare the view to use the correct encoding). for that reason I >>>> asked my question. >>>> >>>> 1) your first approach doesn&#

Re: Import csv file on django view

2020-07-22 Thread Liu Zheng
i thought it could be encoding (for this reason i >>>> wanted to prepare the view to use the correct encoding). for that reason I >>>> asked my question. >>>> >>>> 1) your first approach doesn't work, if i send utf-8 file, chardet >>>>

Re: Import csv file on django view

2020-07-22 Thread Liu Zheng
or that reason I >>> asked my question. >>> >>> 1) your first approach doesn't work, if i send utf-8 file, chardet >>> returns ascii as encoding. it seems request.FILES ['file']. read () returns >>> a binary with that encoding. >>>

Re: Import csv file on django view

2020-07-22 Thread Kovy Jacob
s when >>>> iterating by rows, and i thought it could be encoding (for this reason i >>>> wanted to prepare the view to use the correct encoding). for that reason I >>>> asked my question. >>>> >>>> 1) your first approach doesn'

Re: Import csv file on django view

2020-07-22 Thread Kovy Jacob
;> >>>> #in the view to handle the uploaded file: (assume file input name is just >>>> "file") >>>> file_content = request.FILES['file'].read() >>>> chardet.detect(file_content) >>>> >>>> 2. Also, chardet seem

Re: Import csv file on django view

2020-07-22 Thread Kovy Jacob
uestion. >>> >>> 1) your first approach doesn't work, if i send utf-8 file, chardet returns >>> ascii as encoding. it seems request.FILES ['file']. read () returns a >>> binary with that encoding. >>> >>> 2) In the end I realize

Re: Import csv file on django view

2020-07-22 Thread Kovy Jacob
pproach doesn't work, if i send utf-8 file, chardet returns >> ascii as encoding. it seems request.FILES ['file']. read () returns a binary >> with that encoding. >> >> 2) In the end I realized that the problem was the delimiter of the csv but >> predictin

Re: Import csv file on django view

2020-07-22 Thread Ronaldo Mata
rdet >> returns ascii as encoding. it seems request.FILES ['file']. read () returns >> a binary with that encoding. >> >> 2) In the end I realized that the problem was the delimiter of the csv >> but predicting it is another problem. >> >> Anyway, it

Re: Import csv file on django view

2020-07-22 Thread Kovy Jacob
first approach doesn't work, if i send utf-8 file, chardet returns >> ascii as encoding. it seems request.FILES ['file']. read () returns a binary >> with that encoding. >> >> 2) In the end I realized that the problem was the delimiter of the csv but >>

Re: Import csv file on django view

2020-07-22 Thread Ronaldo Mata
ead () returns a > binary with that encoding. > > 2) In the end I realized that the problem was the delimiter of the csv but > predicting it is another problem. > > Anyway, it was a task that I had to do and that was my limitation. I think > there must be a library that does al

Re: Import csv file on django view

2020-07-22 Thread Kovy Jacob
file_handle = request.FILES['file'] > for line in file_handle: > detector.feed(line) > if detector.done: break > detector.close() > # result available as a dict at detector.result > > > > > > On Tuesday, July 21, 2020 at 7:09:35 AM UTC+8, Ronaldo Ma

Re: Import csv file on django view

2020-07-22 Thread Ronaldo Mata
redicting it is another problem. Anyway, it was a task that I had to do and that was my limitation. I think there must be a library that does all this, uploading a csv file is common practice in many web apps. El mar., 21 jul. 2020 a las 13:47, Liu Zheng () escribió: > Hi. First of all, I thi

Re: Import csv file on django view

2020-07-21 Thread Liu Zheng
tector.feed(line) if detector.done: break detector.close() # result available as a dict at detector.result On Tuesday, July 21, 2020 at 7:09:35 AM UTC+8, Ronaldo Mata wrote: > > How to deal with encoding when you try to read a csv file on view. > > I have a view to upload csv f

Import csv file on django view

2020-07-20 Thread Ronaldo Mata
How to deal with encoding when you try to read a csv file on view. I have a view to upload csv file, in this view I read file and save each row as new record. My bug is when I try to upload a csv file with a differente encoding (not UTF-8) how to handle this on django (using request.FILES) I

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-26 Thread jakote lejaha
The file I had created myself but I have realized that the problem was with the path to the file. Django request.POST['file'] uses an "InMemoryUploadedFile" to handle file upload. And I could not explicitly reference the path of the file from the fileupload input, and parse directly into "pandas.r

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-26 Thread Jason Turner
Is the csv something you created? Or was it given to you? I use pandas extensively & the times I've received that error, the issue has been with the file itself. Ard there blank line(s) at the top of the file? On Tue, May 26, 2020, 4:11 AM jakote lejaha wrote: > The same very same file works f

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-26 Thread jakote lejaha
The same very same file works fine for the python "csv.reader" function with the other parameter as (delimiter=",") other than the file itself. I recently added names attribute as a parameter to the "pandas.read_csv" function, but I can still not get my table as expected. Instead, I get an empt

Re: EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-25 Thread Jason Turner
Are you sure the file is coma delimited? This error is usually because the file is not coma separated. On Mon, May 25, 2020, 5:04 PM jakote lejaha wrote: > Ideally I would have wanted to use the "csv.reader" function, but in this > case it becomes complicated as I would like to load the cvs file

EmptyDataError at /upload_reading while reading csv file using pandas

2020-05-25 Thread jakote lejaha
Ideally I would have wanted to use the "csv.reader" function, but in this case it becomes complicated as I would like to load the cvs file to my web template before I decide if I want to save it to the database or not. So I opt for reading the file using pandas as it's easy to display the record

Need to work with csv file

2020-05-06 Thread Sherif Adigun
Have you checked the python csv module? You may also want to read this: https://docs.djangoproject.com/en/3.0/howto/outputting-csv/ -- 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 i

Re: Need to work with csv file

2020-05-06 Thread Robert Rajendra
g on that image i need > to find the color of that pixel position. > So i need to work with csv file. > In my views. Py file i have a function. In that function i need to open a > csv file which already created and data stored > > -- > You received this message because you are s

Need to work with csv file

2020-05-06 Thread sharu kuriakose
Hi guys Iam a student... doing a project in django. In my project i need to open an image, while clicking on that image i need to find the color of that pixel position. So i need to work with csv file. In my views. Py file i have a function. In that function i need to open a csv file

Help for reading data from csv file and store the data in json format in Django

2019-04-25 Thread Aakash Baranwal
Hi Everybody, I have a CSV file in media folder inside my django project. I want to read the data from the CSV file and store it in JSON format either directly in the database or convert it into JSON from CSV file and then store it, and enable me to view it on an html page, in my Django Web

Re: Django csv file

2019-03-13 Thread Chetan Ganji
n Ganji >> +91-900-483-4183 >> ganji.che...@gmail.com >> http://ryucoder.in >> >> >> On Wed, Mar 13, 2019 at 12:42 AM Ryan Nowakowski >> wrote: >> >>> If I were you, I'd work through the Django tutorial first. Then ask >>> specific q

Re: Django csv file

2019-03-13 Thread Cigi Sebastine
>> specific questions if you have any. >> >> On March 12, 2019 5:32:08 AM CDT, Cigi Sebastine >> wrote: >>> >>> >>> Hi all >>> >>> I am trying to insert data from csv file to mongodb4 using python3.7 >>> (Bulk data i

Re: Django csv file

2019-03-12 Thread Chetan Ganji
19 at 12:42 AM Ryan Nowakowski wrote: > If I were you, I'd work through the Django tutorial first. Then ask > specific questions if you have any. > > On March 12, 2019 5:32:08 AM CDT, Cigi Sebastine > wrote: >> >> >> Hi all >> >> I am trying to ins

Re: Django csv file

2019-03-12 Thread Ryan Nowakowski
If I were you, I'd work through the Django tutorial first. Then ask specific questions if you have any. On March 12, 2019 5:32:08 AM CDT, Cigi Sebastine wrote: >Hi all > >I am trying to insert data from csv file to mongodb4 using python3.7 >(Bulk >data insertion 47lakhs

Django csv file

2019-03-12 Thread Cigi Sebastine
Hi all I am trying to insert data from csv file to mongodb4 using python3.7 (Bulk data insertion 47lakhs records) i need to implement in django Can please anyone share ur idea import pandas as pd import json mng_client = MongoClient('localhost', 27017) mng_db = mng_clien

Re: Create data from django models from .csv file using pandas library

2018-10-15 Thread Gaurav Toshniwal
import pandas as pd df = pd.read_csv(RESOURCE_ROOT + '/data_files/102018_core_business.csv') for index, row in df.iterrows(): business_instance, created = Business.objects.get_or_create(business_id=row['id'], business_name=row['name']) On Monday, October 15, 2018 at 3:12:45 PM UTC+4, Moh

Re: Create data from django models from .csv file using pandas library

2018-10-15 Thread Mohammad Aqib
Myslq database On Mon, 15 Oct 2018, 5:05 pm ansh srivastav, wrote: > Which database are you referring to? > > > [image: Mailtrack] > > Sender > notified by > Mailtrack >

Re: Create data from django models from .csv file using pandas library

2018-10-15 Thread ansh srivastav
Which database are you referring to? [image: Mailtrack] Sender notified by Mailtrack 10/15/18, 5:03:59 PM

Create data from django models from .csv file using pandas library

2018-10-15 Thread Mohammad Aqib
I have multiple .csv files to create data from django models into a database using python pandas library. Can anyone suggest me how to do perform this task. import pandas as pd df = pd.read_csv(RESOURCE_ROOT + '/data_files/102018_core_business.csv') business_instance, created = Business.objects.

Re: Problem emailing CSV file that was read as a binary file

2018-06-25 Thread Jason
Why not upload the file to S3 or some storage and include the download link in the email? -- 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+unsubsc

Re: Problem emailing CSV file that was read as a binary file

2018-06-25 Thread Shu Latif
Did you ever get this working? I am having the same issue with django 1.8. I see there was some sort of bug reported but I think the fix was in a later release. Not sure what I can do since I cannot upgrade. -- You received this message because you are subscribed to the Google Groups "Django

Django generate bar chart by reading CSV file data

2018-01-16 Thread sam kavuri
Hi, I am new to Django and working on some web project. I want to generate a dynamic bar chart (using Chart Js library) by reading CSV file data. Could you please somebody help on this... -- You received this message because you are subscribed to the Google Groups "Django users"

Saving data from csv file in a database

2017-06-03 Thread Arshdeep Singh
What I want to do is a user to go to a page where he can add some objects(Model) like a hostel which has some fields, otherwise what he can do is upload a CSV file and what I will do is accept upload of that CSV file and save data in a database. I have been trying to do this for past two days

Re: reading CSV file with non ASCII characters

2016-02-06 Thread paul . hermeneutic
On Sat, Feb 6, 2016 at 5:38 AM, Tim Chase wrote: > On 2016-02-06 03:06, elcaiaimar wrote: >> import unicodecsv as csv >> >> csvfile=open("mediosdigitales.csv") > >> > reader = csv.DictReader(open("file.csv", "rb")) > >> reader = csv.reader(csvfile, encoding='utf-8', delimiter=',') Do you actually

Re: reading CSV file with non ASCII characters

2016-02-06 Thread Tim Chase
On 2016-02-06 03:06, elcaiaimar wrote: > import unicodecsv as csv > > csvfile=open("mediosdigitales.csv") > > reader = csv.DictReader(open("file.csv", "rb")) > reader = csv.reader(csvfile, encoding='utf-8', delimiter=',') > for row in reader: > titulo=row['titulo'] > pais=row['pais'] >

Re: reading CSV file with non ASCII characters

2016-02-06 Thread elcaiaimar
;titulo'] pais=row['pais'] print titulo print pais However, when I compile it I get this error: *list indices must be integers, not str* How could I solve this problem? Thank you again El sábado, 6 de febrero de 2016, 3:14:01 (UTC+1), elcaiaimar escribió: > > He

Re: reading CSV file with non ASCII characters

2016-02-05 Thread Erik Cederstrand
> Den 6. feb. 2016 kl. 09.14 skrev elcaiaimar : > > Hello, > > I have a CSV File and I want read it. The problem is that it has non ASCII > characters such as 'Ñ' and accents and I need that they are recognised to > save the CSV content in a DB. > > T

Re: reading CSV file with non ASCII characters

2016-02-05 Thread Bill Blanchard
Try this: https://github.com/jdunck/python-unicodecsv On Fri, Feb 5, 2016 at 9:14 PM, elcaiaimar wrote: > Hello, > > I have a CSV File and I want read it. The problem is that it has non ASCII > characters such as 'Ñ' and accents and I need that they are recognised to >

reading CSV file with non ASCII characters

2016-02-05 Thread elcaiaimar
Hello, I have a CSV File and I want read it. The problem is that it has non ASCII characters such as 'Ñ' and accents and I need that they are recognised to save the CSV content in a DB. To simplify, I've summed up my code in django to the next: ​import csv reader = csv.

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: Read a csv file and save data in postgresql

2015-02-24 Thread carlos
, which you can make into a object by feeding > it to a modelform. > > K > > > On Tuesday, February 24, 2015 at 3:53:19 PM UTC-8, elcaiaimar wrote: >> >> Hello, >> >> I have a website and I need that users can introduce a csv file and save >> their data

Re: Read a csv file and save data in postgresql

2015-02-24 Thread Kelvin Wong
website and I need that users can introduce a csv file and save > their data in a postgresql database. I can introduce a file and save it in > media_dir and in the database (only the url). But what I want is save each > row as a register in a table. I've searched some examples but

Re: Read a csv file and save data in postgresql

2015-02-24 Thread Vijay Khemlani
Parsing a CSV file is not a particularly hard thing to do https://docs.python.org/2/library/csv.html You can change the example to read from the file in your model an instead of printing to the console, to store it in the database. On Tue, Feb 24, 2015 at 8:53 PM, elcaiaimar wrote: > He

Read a csv file and save data in postgresql

2015-02-24 Thread elcaiaimar
Hello, I have a website and I need that users can introduce a csv file and save their data in a postgresql database. I can introduce a file and save it in media_dir and in the database (only the url). But what I want is save each row as a register in a table. I've searched some examples

Re: Write Multiple Text Files into a Single CSV File

2014-12-31 Thread Scot Hacker
sk that all have the same basic >format: first line is the *title* and the rest is the *body* >- I want to create one CSV file with the first column being populated >from the first line of each text file (title) and the second column being >populated from the rest of the text

Re: Write Multiple Text Files into a Single CSV File

2014-12-31 Thread Vijay Khemlani
Martin Mirero wrote: > Hi folks, > > I'm just cutting my teeth on Python/Django and need some assistance on > something I've been grappling with for a few days: > >- I have a bunch of text files on disk that all have the same basic >format: first line is the *ti

Write Multiple Text Files into a Single CSV File

2014-12-31 Thread Martin Mirero
create one CSV file with the first column being populated from the first line of each text file (title) and the second column being populated from the rest of the text file contents (body) - Once I have the CSV file, I'm good to import that into my django model Any help would be m

Problem emailing CSV file that was read as a binary file

2014-11-13 Thread Joshua Fialkoff
Hi all, I have this function that helps send emails with attachments: def send_email(…): … msg = EmailMessage( subject, body, send_from, recipients_list, cc=cc, bcc=bcc, headers={'Reply-To': reply_to}) msg.attach_alternative(html_body, "text/html")

Re: Django export the CSV file from database

2014-05-21 Thread hito koto
Sorry, It was my mistake This is correct This is my full views.py: from datetime import datetime, time, date, timedelta class workLog(object): def __init__(self, name, day, attTime, leaveTime): self.name = name self.day = day self.attTime = attTime self.leaveT

Re: Django export the CSV file from database

2014-05-21 Thread Andrew Farrell
So the error is somewhere here: for att in attendance: day = att[2].day But I can't see where `attendance` is defined. I suspect you'll have a similar error in for leav in leavework: day = leav[2].day But also can't see where `leavework` is defined. On Wed, May 21, 2014 at 10:24 PM, hito

Django export the CSV file from database

2014-05-21 Thread hito koto
Hello, I have the errors in the following: I don't know how can i to do ? Request Method: GET Request URL: http://articlet/export_excel/ Django Version: 1.6.2 Exception Type: AttributeError Exception Value: 'datetime.time' object has no attribute 'date' Exception Location: /var/www/

Re: Django export the CSV file of objects form databas

2014-05-21 Thread hito koto
Ok, thank you! 2014年5月21日水曜日 15時04分09秒 UTC+9 Erik Cederstrand: > > Den 21/05/2014 kl. 05.21 skrev hito koto >: > > > > Hello, > > > > I have the following errors: why append is not done? > > > > row = [[0 for i in range(5)] for i in range(31)] > > Here you are creating a list of lists of

Re: Django export the CSV file of objects form databas

2014-05-20 Thread Erik Cederstrand
Den 21/05/2014 kl. 05.21 skrev hito koto : > Hello, > > I have the following errors: why append is not done? > > row = [[0 for i in range(5)] for i in range(31)] Here you are creating a list of lists of 0's (a 2-dimensional matrix of ints). > for a in obj_all.filter().values_list('user

Django export the CSV file of objects form databas

2014-05-20 Thread hito koto
Hello, I have the following errors: why append is not done? AttributeError at /export_excel/ 'int' object has no attribute 'append' Request Method: GET Request URL: http://article/export_excel/ Django Version: 1.6.2 Exception Type: AttributeError Exception Value: 'int' object has no at

Re: Django export CSV file of two objects

2014-05-15 Thread hito koto
Hi, i also write the views but the column was freaking After output to excel in this code. def export_excel(request): response = HttpResponse(mimetype='application/vnd.ms-excel; charset="Shift_JIS"') response['Content-Disposition'] = 'attachment; filename=file.csv' writer = csv.wri

Django export CSV file of two objects

2014-05-15 Thread hito koto
Hello, I want to export file from database and from two objects; I'm use MYSQL, I have two objects: 1, attendance object: 2. get_work object: I now can export one object's datas; So, i how can export datas of two objects; My the views.py is here: def export_excel(request): response = Htt

Re: export .csv file from database

2013-07-19 Thread Peter of the Norse
> data = self.queue.getvalue() > data = data.decode("utf-8") > # ... and reencode it into the target encoding > data = self.encoder.encode(data) > # write to the target stream > self.stream.write(data) > # empty queue >

Re: export .csv file from database

2013-06-19 Thread Radomir Wojcik
> > this might come of use, it exports any query set to csv. I use it a lot: > > def queryset_export_csv(qs): import csv #from django.db.models.loading import get_model response = HttpResponse(mimetype='text/csv') # force download. response['Content-Disposition'] = 'attachmen

Re: export .csv file from database

2013-06-19 Thread Vernon D. Cole
t; data = data.decode("utf-8") > # ... and reencode it into the target encoding > data = self.encoder.encode(data) > # write to the target stream > self.stream.write(data) > # empty queue > self.queue.truncate(0) > &

Re: export .csv file from database

2013-06-19 Thread Derek
utf-8") > # ... and reencode it into the target encoding > data = self.encoder.encode(data) > # write to the target stream > self.stream.write(data) > # empty queue > self.queue.truncate(0) > > def writerows(self, rows)

export .csv file from database

2013-06-17 Thread roopasingh250
encoding data = self.encoder.encode(data) # write to the target stream self.stream.write(data) # empty queue self.queue.truncate(0) def writerows(self, rows): for row in rows: self.writerow(row) The above code is exporting the d

Re: Upload data in csv file to bd

2013-04-26 Thread Hélio Miranda
But when I do this: Código (Python): for obj in gen: genres [obj.GenreType] = obj.id print genres [obj.GenreType] Prints the id of the genre, so it is wrong right? Now I am not going to achieve is check if the genre that I have the csv is in the dictionary and if it gets the

Re: Upload data in csv file to bd

2013-04-26 Thread Tom Evans
On Fri, Apr 26, 2013 at 1:56 PM, Hélio Miranda wrote: > I am uploading a csv file with movies for bd. > Ok, I'm getting it, but my problem is that the movie has genre, but I can > not insert the genre, I have to insert the id of the genre, so I'm going to > fetch the genr

Upload data in csv file to bd

2013-04-26 Thread Hélio Miranda
I am uploading a csv file with movies for bd. Ok, I'm getting it, but my problem is that the movie has genre, but I can not insert the genre, I have to insert the id of the genre, so I'm going to fetch the genres to put a dictionary, GenreType = id. When I want to see the insert there

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

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

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

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 G

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

  1   2   >