Return to Snippet

Revision: 10174
at December 11, 2008 03:23 by tamuratetsuya


Initial Code
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()

Initial URL


Initial Description


Initial Title
Transactionについて

Initial Tags
google, python, django

Initial Language
Python