title: How to save all instances in a single transaction in the peewee (python)?
body: <p>How to save all instances in a single transaction in the <a href="http://peewee.readthedocs.org/en/latest/" rel="nofollow">peewee</a> (python orm library)? For example:</p>
  
  <pre><code>from peewee import SqliteDatabase, Model, TextField
  
  DB_NAME = 'users.db'
  db = SqliteDatabase(os.path.join(os.path.dirname(__file__), DB_NAME))
  
  
  class Users(Model):
  
      user_id = IntegerField(index = True)
      name = TextField(null = True, index = True)
      password = TextField(null = True)
      description = TextField(null = True)
      class Meta:
          database = db
  
  if not Drugs.table_exists():
      Drugs.create_table()
  
  data_to_save = [('user1', 'pass1'), ('user2', 'pass2'), ('user3', 'pass3')]
  
  for user_name, user_password in data_to_save:
      user_data = Users.get_or_create(name=user_name, password=user_password)
      user_data.save()
  </code></pre>
  
  <p>how to rewrite in a single transaction?</p>