Saturday, March 5, 2011

How to get model name from foreignkey field?

I am writing a view that controls multiple models.
I use Model._meta.fields to access model fields and use
value_from_object() to get its value
but for foreignkeys it returns the object_id, but I don't know which
model is this.

Is there any way to get the foreignkey fields model?

--
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


Real Estate