#11230: Assigning the super class of a Proxy class to a ForeignKey fails.
---------------------------+------------------------------------------------
Reporter: dpn | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: 1.0
Keywords: | Stage: Unreviewed
Has_patch: 0 |
---------------------------+------------------------------------------------
{{{
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
--
Ticket URL: <http://code.djangoproject.com/ticket/11230>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---