title: Python sqlite3 cannot make views of views of tables
body: <p>Through python I open an SQLite database and try to access a view of a view of a table. Unfortunately I get an error message. The Python code below demonstrates the problem:</p>
  
  <pre><code>import sqlite3
  
  conn = sqlite3.connect("test.db")
  mydb = conn.cursor()
  
  mydb.execute("CREATE TABLE TestTbl (MRTarget_id int, Fullmodel text)")
  mydb.execute("CREATE TABLE TestTbl2 (Other_id int, Othermodel text)")
  
  mydb.execute("CREATE VIEW TestView AS SELECT m.ROWID, m.MRTarget_id, m.Fullmodel, t.Othermodel FROM TestTbl m, TestTbl2 t")
  mydb.execute("CREATE VIEW TestView2 AS SELECT m.Fullmodel, m.Othermodel FROM TestView m")
  
  mydb.close()
  </code></pre>
  
  <p>Python spits out the error "sqlite3.OperationalError: no such column: m.Fullmodel" after attempting to create TestView2. However, from the Sqlite3 prompt the above SQL statements can be executed without any problem. As my database contains views of views of tables I wonder if it is not possible at all to access these programmatically through Python.</p>