#11062: Problem with django/forms/models.py
--------------------+-------------------------------------------------------
Reporter: beaver | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: 1.0
Keywords: | Stage: Unreviewed
Has_patch: 0 |
--------------------+-------------------------------------------------------
Hi!
When I describe my own model field I can return value of any kind. In my
own widget I can process that value
But if I want to describe a field inherits from ManyToManyField I can't do
this because of that code (forms.models.py):
{{{
if isinstance(f, ManyToManyField):
if instance.pk is None:
data[f.name] = []
else:
data[f.name] = [obj.pk for obj in
f.value_from_object(instance)]
else:
data[f.name] = f.value_from_object(instance)
}}}
When I trying pass my own value (not sequence of models) this code
prevents this.
I offer to change method {{{ value_from_object }}} for ManyToManyField,
that it returns not list of models but list of identifiers.
And above-cited code changes to
{{{
data[f.name] = f.value_from_object(instance)
}}}
But I think it damages other parts of Django.
Please solve this problem and send me an email.[[BR]]
Sorry for my bad English.
Kirill
--
Ticket URL: <http://code.djangoproject.com/ticket/11062>
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
-~----------~----~----~----~------~----~------~--~---