adobe flex; return xml via turbogears/django

S

Sells, Fred

please excuse slightly off-topic; cannot access turbogears mailing list at the moment.

There was an excellent video by James Ward that showed using turbogears to return json data to adoble's flex UI. It simply used

@expose("JSON")
def xxxx():
...
return dict(x=1, ...)

Is there any equivalent for xml, such as
@expose("XML")
def ....
return myElementTreeRoot

I need to have more attribute data (for a grid) than I can cleanly do in json and while pyamf might do the trick, It adds a layer of "magic code" that I cannot sell to my team. Also with xml and json, I can do my UI design with the url pointing to a test data file, then build the backend to match.

any ideas?

thanks

---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------
 
D

Diez B. Roggisch

please excuse slightly off-topic; cannot access turbogears mailing list at
the moment.

There was an excellent video by James Ward that showed using turbogears to
return json data to adoble's flex UI. It simply used

@expose("JSON")
def xxxx():
...
return dict(x=1, ...)

Is there any equivalent for xml, such as
@expose("XML")
def ....
return myElementTreeRoot

I need to have more attribute data (for a grid) than I can cleanly do in
json and while pyamf might do the trick, It adds a layer of "magic code"
that I cannot sell to my team. Also with xml and json, I can do my UI
design with the url pointing to a test data file, then build the backend
to match.

any ideas?

Why don't you create KID-template like this:

<div py:strip="True">${root}</div>

and in the controller say

@expose("thexmltemplate")
def ...
return dict(root=myElementTreeRoot)

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top