On 8/18/06, Mike <[EMAIL PROTECTED]> wrote:
>
> We have been creating a content management system in Django which
> (despite a few learning bumps) has gone swimmingly. Now, we have
> reached an impasse. We have some applications running elsewhere on the
> site whose xml data we need to access and display from a django view
> function. We read through and experimented with a variety of tutorials
> (since we're all still very new to python) and found several approaches
> that seem to work when written in the shell. Adding them to django
> however has proved to be very difficult. Regardless of what we try, it
> seems impossible to get django to kick out the information we want or
> even to have it generate an error message that would give us some kind
> of feedback. The current iteration that we have experimented with looks
> like this (a shameless ripoff from the Python Cookbook):

sax is generally used when you are dealing with very large xml
documents that you don't want to load in to memory. It's a pain to
work with and you should stay away from it unless you really need it.

I suggest trying elementtree http://effbot.org/zone/element-index.htm
to get your data into some sort of nested list/dict stucture. print
that structure in your view code to make sure it works, then put that
stucture in your template context. Do your <br/> stuff with the {% for
%} tag in your template. Assembling an html string in your view
probably isn't the best way to go about it. That's what the template
system is for :)

Joseph

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

Reply via email to