title: Output MySQL query results in Django shell
body: <p>I have the following Django Model which retrieves 3 records from a database. The class below represents a Model within a Django application I'm building. I realize that the parameters taken in by the <code>create_hotspots</code> function are not being used. I just simplified what the code looked like previously for the purposes of explaining my problem. </p>
  
  <pre><code>from django.db import models
  from django.db import connection, transaction
  import math
  import MySQLdb
  
  class Victims(models.Model):
  
      def __init__(self):
          self.results=[]
      def create_hotspots(self,radius,latitude,longitude):
  
          self.radius=str(radius)
          self.latitude=str(latitude)
          self.longitude=str(longitude)
  
          db=MySQLdb.connect (host = "localhost", user = "root",passwd = "pass",db = "test")
          cursor = db.cursor ()
          cursor.execute("""SELECT * FROM poi_table""")
          self.results=cursor.fetchall()
          cursor.close ()
          db.close ()
      def __unicode__(self):
          return self.results
  </code></pre>
  
  <p>Now, assume that I open the Django shell and I execute the following instructions:</p>
  
  <pre><code>&gt;&gt;from PyLayar.layer.models import Victims
  C:\Python26\lib\site-packages\MySQLdb\__init__.py:34: DeprecationWarning: the sets module is deprecated
    from sets import ImmutableSet
  &gt;&gt;&gt; v=Victims()
  &gt;&gt;&gt; v.create_hotspots(1000, 42.3931955679, -72.5289916992)
  &gt;&gt;&gt; Victims.objects.all()
  []
  </code></pre>
  
  <p>My question is why does the <code>Victims.objects.all()</code> instruction return no results. The SQL query returns 3 results, and the <code>results</code> variable stores the resulting tuple. </p>