Using the latest version from SVN, there seems to be a problem with fetching objects created with a subclassed model.
# Model Definitions
from django.db import models
class Animal(models.Model):
owner = models.CharField(maxlength=30)
class Cat(Animal):
name = models.CharField(maxlength=30)
breed = models.CharField(maxlength=30)
def __repr__(self):
return self.name
Testing the model:
(InteractiveConsole)
>>> from project.test.models import Cat
>>> my_cat = Cat(id=1, owner='Johnny', breed='Persian', name='Kitty')
>>> my_cat.save()
>>>
>>> Cat.objects.all()
[]
>>>
>>> from django.db import connection
>>> cursor = connection.cursor()
>>> cursor.execute("""SELECT * FROM test_cat""")
>>> for row in cursor.fetchall(): print row
(1, 'Johnny', 'Kitty', 'Persian')
>>>
>>> # creating (and fetching) Animal objects works just fine
>>> animal = Animal(id=1, owner='Sarah')
>>> animal.save()
>>> Animal.objects.all()
[<Animal object>]
>>> Cat.objects.all()
[<Animal object>]