title: Error in python - object of type 'NoneType' has no len()
body: <p>I am not sure what is wrong with my python code:</p>
  
  <pre><code>geneid=request.args.get('geneid')
  sql=text('select * from INFO where name=:ident')
  genes=engine.execute(sql,ident=geneid).fetchone()
  params['objs']=genes
  if len(genes)==0:
      flash('NO RESULTS')
  return render_template('info.html', **params)
  </code></pre>
  
  <p>The error message is: 
  TypeError: object of type 'NoneType' has no len()</p>
  
  <p>Any suggestion? I would like to show a flash message when there is no result in my query.
  I tried also (but did not work):</p>
  
  <pre><code>geneid=request.args.get('geneid')
  sql=text('select * from INFO where name=:ident')
  genes=engine.execute(sql,ident=geneid).fetchone()
  params['objs']=genes
  if no genes:
      flash('NO RESULTS')
  return render_template('info.html', **params)
  </code></pre>