model_to_dict including foreign key's fields

323 views
Skip to first unread message

Panos Laganakos

unread,
Apr 15, 2008, 2:38:03 PM4/15/08
to Django users
I am using 0.96.1, but I wanted to prepopulate a form from a model. So
I grabbed
`model_to_dict` from trunk. It works (I just had to replace `pk` with
`id`),
but, I need to be able to get data from a foreign key field.

The model is a profile, which has a ForeignKey to `User`. Is it
possible to make
`model_to_dict`, grab the `User` fields too?
Reply all
Reply to author
Forward
0 new messages