/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class MyModel1(db.Model): text = db.StringProperty() anotherModelInfo = db.NumberProperty() class MyModel2(db.Model): ref = db.ReferenceProperty(MyModel1) class Controller(webapp.RequestHandler): def post(self): datas = [] ... # MyModelã®listã§ã‚ã‚‹datasを作æˆã€‚ db.run_in_transaction(self.insert, datas) def insert(datas): for data in datas: data.put()