﻿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
11230	Assigning the super class of a Proxy class to a ForeignKey fails.	David Novakovic	nobody	"
{{{
from django.db import models
from proj.myapp.models import ProxyClass


class NewClass(models.Model):
    proxy = models.ForeignKey(ProxyClass,related_name=""newclass"",unique=True)

}}}

Failure stacktrace on save():
{{{
>> n.proxy = p  # p is actually an instance of SuperClass
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""...lib/common/django/db/models/fields/related.py"", line 272, in __set__
    self.field.name, self.field.rel.to._meta.object_name))
ValueError: Cannot assign ""SuperClass"": ""NewClass.proxy"" must be a ""Proxy"" instance.
}}}

First ticket for me, so let me know if I can provide more info.

Cheers

"		closed	Database layer (models, ORM)	1.0		invalid			Unreviewed	0	0	0	0	0	0
