Thanks for your help. I am so close to what I want.

The output that I want is an XML file. So I try:
      reporter = Reporter.objects.get(id=10)
      arts = reporter.article_set.all()
      xmlout = serialize('xml',arts,fields=('date','reporter.name'))

However, it writes date but it does not write reporter.name into the
XML file.

Any help in this regard?

On Nov 7, 2:33 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I tried your suggested solution and instead of printing the result I
> > use Django serializer to create an XML file. But it seems that
> > something is taking too
> > long and my browser just stalls. Is it because of select_related()
> > method? I have about 200 articles per each reporter.
>
> Another possibility might be (since you're only looking at one
> author)
>
>    reporter = Reporter.objects.get(id=10)
>    arts = reporter.article_set
>    for art in arts:
>      print reporter, art
>
> Even that considered, 200 articles/reporter is still pretty
> chump-change.  I've worked with data-sets several orders of
> magnitude larger than that and haven't had performance problems.
>   Alternatively, your templating output might be your bottleneck
> (but you don't mention how you're creating your output, so it's
> hard to tell).
>
> -tim
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to