title: How to insert data with SQlAlchemy declarative way
body: <p>I can add data to my db this way:</p>
  
  <pre><code>a = Model_tbl_name("3", "da", "3", "eheeee", "", "", "", "", "", "", "", "", func.now(), func.now()) 
  
  db_session.add(a) 
  db_session.commit()
  </code></pre>
  
  <p>But i can't do it this way:</p>
  
  <pre><code>data = Model_tbl_name.insert().values({"title_hr":request.form['title_hr'],"text_hr":request.form['text_hr']})
  </code></pre>
  
  <p>I tried similar, but no help:</p>
  
  <pre><code>data = db_session.Model_tbl_name.insert().execute({"title_hr":request.form['title_hr'],"text_hr":request.form['text_hr']})
  </code></pre>
  
  <p>My initial motivation is to pass all form data like JSON, i would like to have it like this to work:</p>
  
  <pre><code>data = db_session.Model_tbl_name.insert().execute(json.loads(new_request_form))
  </code></pre>
  
  <p>In documentation, it is stated it can be done:
  <a href="http://docs.sqlalchemy.org/en/rel_0_9/core/dml.html?highlight=insert%20values#sqlalchemy.sql.expression.Insert.values" rel="nofollow">http://docs.sqlalchemy.org/en/rel_0_9/core/dml.html?highlight=insert%20values#sqlalchemy.sql.expression.Insert.values</a></p>
  
  <p>like this: </p>
  
  <pre><code>users.insert().values({"name": "some name"})
  </code></pre>
  
  <p>But no help, I just can't get it. How can i make it to work, must i provide all JSON data in values() method? How should I write that command to make it work?</p>
  
  <p>Second, how can I grab that error, because, I get no error in Flask, only stops working. I can figure out how to display errors when working with SQLAlchemy declarative way.</p>
  
  <p>P.S. I am using Flask framework, SQLAlchemy, and Python version is 3.4</p>