title: Python, Flask, SQLAlchemy: cannot import from models
body: <p>I've got a weird problem.</p>
  
  <p>I am building a Flask app with SQLAlchemy. I have a file with models, namely, models.py. And I have a User model there.</p>
  
  <p>If I open my "views.py" and insert a string</p>
  
  <pre><code>import models
  </code></pre>
  
  <p>and then use the User model like</p>
  
  <pre><code>u=models.User.query.filter_by(name='John',password='Doe').first()
  </code></pre>
  
  <p>everything works fine.</p>
  
  <p>But if instead of "import models" i put</p>
  
  <pre><code>from models import User
  </code></pre>
  
  <p>Python crashes and says:</p>
  
  <pre><code>ImportError: cannot import name User
  </code></pre>
  
  <p>how can this be possible?</p>