By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,742 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,742 IT Pros & Developers. It's quick & easy.

adobe flex; return xml via turbogears/django

P: n/a
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 Icannot sell to my team. Also with xml and json, I can do my UI design withthe 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.
---------------------------------------------------------------------------
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sells, Fred wrote:
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
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.