﻿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
21848	Some strange problem in Model inheritance and selected_related	davydov.ilya@…	nobody	"Hi.
I've found some strange problem.
I have 2 models. 

class Product(models.Model):
    id = models.AutoField(primary_key=True)
    price = models.IntegerField(db_column='price', default=0)

    class Meta:
        db_table = 'product'

class CurrentProduct(Product):
    parent_product = models.OneToOneField(Product, parent_link=True, related_name='current_product', db_column='parent')
    price_test = models.IntegerField(default=0, db_column='price_frame')

    class Meta:
        db_table = 'door'


Product.objects.selected_related('current_product').all()

The above query return all products. But price_test in subobjects current_product will be casted to:
1) if price_test >= 2 - long
2) if price_test == 1 or price_test == 0 - bool !!!!!!!!!!

It's very strange.

It doesn't repeat if selected_related isn't specified!

What do you mean about it?"	Bug	closed	Database layer (models, ORM)	1.6	Normal	fixed	model,inheritance,selected_related		Unreviewed	0	0	0	0	0	0
