title: Trying to get the next value in sequence from a postgres DB, with django
body: <p>I have a sequence defined in my database that I want to use in my django application.  I assumed I could use the raw sql method specified in the django documentation here:  <a href="http://docs.djangoproject.com/en/1.1/topics/db/sql/" rel="noreferrer">http://docs.djangoproject.com/en/1.1/topics/db/sql/</a>.  My plan was to execute the following SQL statment:</p>
  
  <pre><code>select nextval('winner')
  </code></pre>
  
  <p>where winner is the sequence I want to get the next value from.  Here is my code:</p>
  
  <pre><code>from django.db import connection, transaction
  
  .....
  
  cursor = connection.cursor()
  
  result = cursor.execute("select nextval('winner')")
  </code></pre>
  
  <p>The result is always a NoneType object.  This seems pretty simple and straightforward, but I haven't been able to make this work.  I've tried it in the interactive console with the same results.  If I look in the connection.queries object, i see this:</p>
  
  <pre><code>{'time': '0.000', 'sql': "select nextval('winner')"}
  </code></pre>
  
  <p>The sql generated is valid.  Any ideas?</p>
  
  <p>I'm using:</p>
  
  <ul>
  <li>Django 1.1</li>
  <li>Python 2.6</li>
  <li>Postgres 8.3</li>
  <li>Psycopg2</li>
  <li>Mac OSX</li>
  </ul>