简体   繁体   English

从 csv 文件或来自 google 文档的电子表格填充 appengine 数据库中的数据

[英]Populating data in appengine database from a csv file or spreadsheet from google docs

I am uisng webapp2 on google app engine my database model has the following schema:我在谷歌应用引擎上使用 uisng webapp2 我的数据库 model 具有以下架构:

class Match(db.Model):
    start_date = db.DateProperty()
    start_time = db.TimeProperty()
    team1 = db.StringProperty()
    team2 = db.StringProperty()
    venue = db.StringProperty()
    result = db.IntegerProperty()

And i have a csv file or say google spreadsheet, with all the data there are around 150 rows.我有一个 csv 文件或谷歌电子表格,所有数据大约有 150 行。

Putting all the values manually is a big pain.手动输入所有值是一件很痛苦的事情。 Could anyone please suggest me how to update the database?谁能建议我如何更新数据库?

You could create a page that you can POST the contents of the CSV file to, and then use the Python csv module to read the file and loop over the rows, inserting model instances as you go.您可以创建一个页面,您可以将 CSV 文件的内容发布到该页面,然后使用 Python csv模块读取文件并循环遍历行,插入 model 实例作为 go。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 excel 或 google 电子表格或 CSV 使用 excel 导入 firebase firestore 数据库中的批量数据 - How to import bulk data in firebase firestore database from excel or google spreadsheet or CSV using flutter 由于缺少 api 代理,从 Google Appengine 发送电子邮件失败 - Sending emails from Google Appengine fails because of missing api proxy 将 EAR 应用程序从 AppEngine 迁移到 Google Cloud SDK - Migrating an EAR application from AppEngine to Google Cloud SDK Google Docs importXML from Amazon.com 错误 - Google Docs importXML from Amazon.com error Flutter 从 firebase 在 DropDown 中填充数据 - Flutter populating data in DropDown from firebase 从 Google Cloud Storage 加载 csv 文件时出现 BigQuery 错误 - BigQuery error when loading csv file from Google Cloud Storage 从树莓派 CSV 文件到 Bigquery 表的数据流 - Data streaming from raspberry pi CSV file to Bigquerry table 显示来自 firestore 集合中特定文档的数据 - displaying data from a specific docs within firestore collection 从 Java 中的云函数访问 Google Firebase 数据库中的数据 - Access data in Google Firebase database from a cloud function in Java Google Data Studio:刷新上传的 CSV 文件的数据 - Google Data Studio: Refreshing data of uploaded CSV file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM