﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1790	Can't find objects when using subclassed model	anonymous	Adrian Holovaty	"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>]
}}}
"	enhancement	closed	Tools		blocker	duplicate			Unreviewed	0	0	0	0	0	0
