Monday, December 13, 2010

Display related field in queryset

Hello,

I'm using http://code.google.com/p/django-jqgrid/ to display grids
into a Django application. Since I'm pretty new to Django I don't know
how to tell Django to retrurn the value of the related field instead
of the id of the related field. What I do now is: travels =
Travel.objects.values('date','destination'), but that returns the date
of the travel and the id of the destination, FK to Destination model/
table. How should I query Django so it returns the description of the
destination instead of its id?

Thanks in advance.

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