[google-appengine] how to upload/download CSV file on Google App Engine
Hi, I'm new for Python and Google App Engine, So may I ask a very simple or very stupid question ; ( I'm trying to upload a table from a csv file , store to google data store and show this table on the web. then in another page, I need compose the query result to a table and also this table can be downloaded in csv format. is anybody can share the code for the above scenarios? thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: how to upload/download CSV file on Google App Engine
Thanks for your guys guidance. but it's not to use the buIk upload procedure. I should explain more about my project. the first is to edit a table more easier . for example: customer product price CSTM_A PDT_A 1,000.00 CSTM_A PDT_B 2,000.00 CSTM_A PDT_C 1,000.00 CSTM_B PDT_A 1,050.00 CSTM_C PDT_C 950.00 So if I can download/upload this table, then it will more easy for me to edit it through the excel. but I don't know how to set up the download/upload procedure for it ; ( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: how to upload/download CSV file on Google App Engine
Thanks Greg. Can anybody share a full code for this small task? I'm new to Python, GAE and also web application ; ( anyway I can understand GAE's helloword tutorial. I searched a lot online ( including CSV in GAE and also Python) and I did not see a full code for similar task. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: how to upload/download CSV file on Google App Engine
but my problem is there are many details I'm not familiar with. for instance, based on source code of "helloworld", first I can add a form to upload the file, file ( refer from http://groups.google.com/group/google-appengine/browse_thread/thread/fc87a92de8ae1a55) I changed the Guesbook class as below. and it works to show the file name as the content. But I don't know how to tell the code to read inside this file. class Processfile(webapp.RequestHandler): def post(self): greeting = Greeting() thefile = self.request.params['titles_file'] file_name = thefile.filename file_value = thefile.value greeting.author = users.get_current_user() greeting.content = file_name greeting.put() self.redirect('/') That's why I want some source code and then I can modify the code for implement my purpose. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: how to upload/download CSV file on Google App Engine
for instance, can somebody share the code to implement the table like this? http://finance.google.com/finance/historical?q=NASDAQ:GOOG I just need upload the table and download the table. thanks a lot. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] put() doesn't store all entities in the loop!
Hi guys, I'm trying to upload a .csv file and show the entities in a table. but the weird thing is it seems like the put() only stores the last record from the .csv file! here is the code to read the .csv file, store to big table and show the first 10 records: === class Processfile(webapp.RequestHandler): def post(self): cardcost=Cardcost() memfile=StringIO.StringIO(self.request.get('titles_file')) Mylist = csv.reader(memfile,dialect='excel') for row in Mylist: cardcost.Bom=row[0] cardcost.unitprice=row[1] print '%s %s' % (cardcost.Bom, cardcost.unitprice) cardcost.put() print 'record fetched from datastore' cardcosts_query = Cardcost.all().order('-date') cardcosts = cardcosts_query.fetch(10) for cc in cardcosts: if cc.Bom: print '%s %s %s' % (cc.Bom, cc.unitprice,cc.date ) else: print ' No value' class Cardcost(db.Model): Bom = db.StringProperty() unitprice=db.StringProperty() date = db.DateTimeProperty(auto_now_add=True) === here is the .csv file; = BOM,Unit Price 13032341,1000 10421110,1200 23781234,780 34324321,3210 12346553,32 16781234,6789 112,5000 == after clear up the datastore, here is the result after the first running: BOM Unit Price 13032341 1000 10421110 1200 23781234 780 34324321 3210 12346553 32 16781234 6789 112 5000 record fetched from datastore 112 5000 2008-09-05 03:22:11.218000 Status: 200 OK Content-Type: text/html; charset=utf-8 Cache-Control: no-cache Content-Length: 0 Is there anybody have similar problem or solution? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Can C++ code be wrapped up on GAE?
Hi, I'm new to GAE and I'm trying to put a application on GAE. but it was written by C++. Is there any a way to wrap up the C++ code as a class (or others) and then run on GAE? Or any other cloud computing system can support this way? like EC2? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] app upload issues - appcfg.py
im having some trouble uploading a locally running program to appengine. i'm using python release 2.5.4 and appengine sdk version 1.1.9. the trace is as below. help much appreciated - vv - C:\Documents and Settings\venuv\Desktop\google app eng\apps>appcfg.py --noisy --no_cookies update unboxer 2009-04-10 00:26:08,983 INFO appengine_rpc.py:120 Server: appengine.google.com 2009-04-10 00:26:08,983 INFO appcfg.py:319 Checking for updates to the SDK. 2009-04-10 00:26:09,108 INFO appcfg.py:328 Update check failed: 2009-04-10 00:26:09,108 INFO appcfg.py:1178 Reading app configuration. Scanning files on local disk. 2009-04-10 00:26:09,108 INFO appcfg.py:1189 Ignoring file 'app.yaml': File matches ignore regex. 2009-04-10 00:26:09,108 INFO appcfg.py:1189 Ignoring file 'index.yaml': File matches ignore regex. 2009-04-10 00:26:09,125 INFO appcfg.py:1197 Processing file 'main.py' 2009-04-10 00:26:09,140 INFO appcfg.py:1197 Processing file 'stylesheets/main.css' 2009-04-10 00:26:09,155 INFO appcfg.py:1197 Processing file 'gdata/ auth.py' 2009-04-10 00:26:09,171 INFO appcfg.py:1189 Ignoring file 'gdata/ auth.pyc': File matches ignore regex. 2009-04-10 00:26:09,171 INFO appcfg.py:1197 Processing file 'gdata/ service.py' 2009-04-10 00:26:09,171 INFO appcfg.py:1189 Ignoring file 'gdata/ service.pyc': File matches ignore regex. 2009-04-10 00:26:09,187 INFO appcfg.py:1197 Processing file 'gdata/ urlfetch.py' 2009-04-10 00:26:09,187 INFO appcfg.py:1189 Ignoring file 'gdata/ urlfetch.pyc': File matches ignore regex. 2009-04-10 00:26:09,187 INFO appcfg.py:1197 Processing file 'gdata/ __init__.py' 2009-04-10 00:26:09,203 INFO appcfg.py:1189 Ignoring file 'gdata/ __init__.pyc': File matches ignore regex. 2009-04-10 00:26:09,203 INFO appcfg.py:1197 Processing file 'gdata/ youtube/servi ce.py' 2009-04-10 00:26:09,217 INFO appcfg.py:1189 Ignoring file 'gdata/ youtube/service.pyc': File matches ignore regex. 2009-04-10 00:26:09,217 INFO appcfg.py:1197 Processing file 'gdata/ youtube/__init__.py' 2009-04-10 00:26:09,217 INFO appcfg.py:1189 Ignoring file 'gdata/ youtube/__init_ _.pyc': File matches ignore regex. 2009-04-10 00:26:09,217 INFO appcfg.py:1197 Processing file 'gdata/ media/__init_ _.py' 2009-04-10 00:26:09,250 INFO appcfg.py:1189 Ignoring file 'gdata/media/ __init__. pyc': File matches ignore regex. 2009-04-10 00:26:09,250 INFO appcfg.py:1197 Processing file 'gdata/geo/ __init__. py' 2009-04-10 00:26:09,265 INFO appcfg.py:1189 Ignoring file 'gdata/geo/ __init__.py c': File matches ignore regex. 2009-04-10 00:26:09,265 INFO appcfg.py:1197 Processing file 'atom/ service.py' 2009-04-10 00:26:09,296 INFO appcfg.py:1189 Ignoring file 'atom/ service.pyc': Fi le matches ignore regex. 2009-04-10 00:26:09,296 INFO appcfg.py:1197 Processing file 'atom/ __init__.py' 2009-04-10 00:26:09,312 INFO appcfg.py:1189 Ignoring file 'atom/ __init__.pyc': F ile matches ignore regex. 2009-04-10 00:26:09,312 INFO appcfg.py:1189 Ignoring file '.idlerc/ breakpoints.l st': File matches ignore regex. 2009-04-10 00:26:09,312 INFO appcfg.py:1189 Ignoring file '.idlerc/ recent-files. lst': File matches ignore regex. Initiating update. 2009-04-10 00:26:09,328 ERROR appcfg.py:1235 An unexpected error occurred. Aborting. Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\tools \appcfg.p y", line 1213, in DoUpload missing_files = self.Begin() File "C:\Program Files\Google\google_appengine\google\appengine\tools \appcfg.py", line 1009, in Begin version=self.version, payload=self.config.ToYAML()) File "c:\Program Files\Google\google_appengine\google\appengine\tools \appengine_rpc.py", line 303, in Send f = self.opener.open(req) File "C:\Python25\lib\urllib2.py", line 381, in open response = self._open(req, data) File "C:\Python25\lib\urllib2.py", line 399, in _open '_open', req) File "C:\Python25\lib\urllib2.py", line 360, in _call_chain result = func(*args) File "C:\Python25\lib\urllib2.py", line 1107, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Python25\lib\urllib2.py", line 1082, in do_open raise URLError(err) URLError: Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\appcfg.py", line 60, in run_file(__file__, globals()) File "C:\Program Files\Google\google_appengine\appcfg.py", line 57, in run_fil e execfile(script_path, globals_) File "C:\Program Files\Google\google_appengine\google\appengine\tools \appcfg.p y", line 1976, in main(sys.argv) File "C:\
[google-appengine] Re: python app upload issues - appcfg.py
upon adding more debug statements to appcfg.py and urllib2, it seems like the following http request fails. i am *not* behind a firewall, so that is probably not the issue. any thoughts? request = http://appengine.google.com/api/appversion/create?version=1&app_id=unboxer payload = api_version: '1' application: unboxer handlers: - static_dir: stylesheets url: /stylesheets - script: main.py url: .* runtime: python version: '1' On Apr 10, 12:48 am, vv wrote: > im having some trouble uploading a locally running program to > appengine. i'm using python release 2.5.4 and appengine sdk version > 1.1.9. the trace is as below. help much appreciated - vv > > - > C:\Documents and Settings\venuv\Desktop\google app eng\apps>appcfg.py > --noisy --no_cookies update unboxer > 2009-04-10 00:26:08,983 INFO appengine_rpc.py:120 Server: > appengine.google.com > 2009-04-10 00:26:08,983 INFO appcfg.py:319 Checking for updates to the > SDK. > 2009-04-10 00:26:09,108 INFO appcfg.py:328 Update check failed: > > 2009-04-10 00:26:09,108 INFO appcfg.py:1178 Reading app configuration. > Scanning files on local disk. > 2009-04-10 00:26:09,108 INFO appcfg.py:1189 Ignoring file 'app.yaml': > File matches ignore regex. > 2009-04-10 00:26:09,108 INFO appcfg.py:1189 Ignoring file > 'index.yaml': File matches ignore regex. > 2009-04-10 00:26:09,125 INFO appcfg.py:1197 Processing file 'main.py' > 2009-04-10 00:26:09,140 INFO appcfg.py:1197 Processing file > 'stylesheets/main.css' > 2009-04-10 00:26:09,155 INFO appcfg.py:1197 Processing file 'gdata/ > auth.py' > 2009-04-10 00:26:09,171 INFO appcfg.py:1189 Ignoring file 'gdata/ > auth.pyc': File matches ignore regex. > 2009-04-10 00:26:09,171 INFO appcfg.py:1197 Processing file 'gdata/ > service.py' > 2009-04-10 00:26:09,171 INFO appcfg.py:1189 Ignoring file 'gdata/ > service.pyc': File matches ignore regex. > 2009-04-10 00:26:09,187 INFO appcfg.py:1197 Processing file 'gdata/ > urlfetch.py' > > 2009-04-10 00:26:09,187 INFO appcfg.py:1189 Ignoring file 'gdata/ > urlfetch.pyc': > File matches ignore regex. > 2009-04-10 00:26:09,187 INFO appcfg.py:1197 Processing file 'gdata/ > __init__.py' > > 2009-04-10 00:26:09,203 INFO appcfg.py:1189 Ignoring file 'gdata/ > __init__.pyc': > File matches ignore regex. > 2009-04-10 00:26:09,203 INFO appcfg.py:1197 Processing file 'gdata/ > youtube/servi > ce.py' > 2009-04-10 00:26:09,217 INFO appcfg.py:1189 Ignoring file 'gdata/ > youtube/service.pyc': File matches ignore regex. > 2009-04-10 00:26:09,217 INFO appcfg.py:1197 Processing file 'gdata/ > youtube/__init__.py' > 2009-04-10 00:26:09,217 INFO appcfg.py:1189 Ignoring file 'gdata/ > youtube/__init_ > _.pyc': File matches ignore regex. > 2009-04-10 00:26:09,217 INFO appcfg.py:1197 Processing file 'gdata/ > media/__init_ > _.py' > 2009-04-10 00:26:09,250 INFO appcfg.py:1189 Ignoring file 'gdata/media/ > __init__. > pyc': File matches ignore regex. > 2009-04-10 00:26:09,250 INFO appcfg.py:1197 Processing file 'gdata/geo/ > __init__. > py' > 2009-04-10 00:26:09,265 INFO appcfg.py:1189 Ignoring file 'gdata/geo/ > __init__.py > c': File matches ignore regex. > 2009-04-10 00:26:09,265 INFO appcfg.py:1197 Processing file 'atom/ > service.py' > 2009-04-10 00:26:09,296 INFO appcfg.py:1189 Ignoring file 'atom/ > service.pyc': Fi > le matches ignore regex. > 2009-04-10 00:26:09,296 INFO appcfg.py:1197 Processing file 'atom/ > __init__.py' > 2009-04-10 00:26:09,312 INFO appcfg.py:1189 Ignoring file 'atom/ > __init__.pyc': F > ile matches ignore regex. > 2009-04-10 00:26:09,312 INFO appcfg.py:1189 Ignoring file '.idlerc/ > breakpoints.l > st': File matches ignore regex. > 2009-04-10 00:26:09,312 INFO appcfg.py:1189 Ignoring file '.idlerc/ > recent-files. > lst': File matches ignore regex. > Initiating update. > 2009-04-10 00:26:09,328 ERROR appcfg.py:1235 An unexpected error > occurred. Aborting. > Traceback (most recent call last): > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \appcfg.p > y", line 1213, in DoUpload > missing_files = self.Begin() > File "C:\Program Files\Google\google_appengine\google\appengine\tools > \appcfg.py", line 1009, in Begin > version=self.version, payload=self.config.ToYAML()) > File "c:\Program Files\Google\google_appengine\google\appengine\tools > \appengine_rpc.py", line 303, in Send > f = self.opener.op