On Fri, Sep 16, 2011 at 10:35 AM, David <[email protected]> wrote:
> def companyedit(request, pk):
>    if request.method == 'POST':
>        a = Company.objects.get(pk=pk)
......
> I would like to fetch the related Person objects that are related to
> Company (ie. those who work for said company). I don't intend to use
> this information in my form but intend to use it in the template.

just change from:

   a = Company.objects.get(pk=pk)

to:

   a = Company.objects.select_related().get(pk=pk)







-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en.

Reply via email to