Re: Load ForeignKey label instead of ID in Charfield
Well, I'm guessing that what is displayed is what the unicode method
returns for the model that the ForeignKey points to (can't remember
for sure offhand, but I know that the admin interface works that
way). Of course, it might also be changing the display because you're
putting it in a TextField instead of a ChoiceField.
The whole point of a ForeignKey is to store a relationship between two
objects from different models. I really don't see how you would be
gaining anything by having users edit this data via a TextField. If
you don't like the widget that a form uses by default to select the
other model instance, you can change that fairly easily.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home