473,287 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

adobe flex; return xml via turbogears/django

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
1 1433
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vincent Delporte | last post by:
Hi I'm trying to find out whether to use Python or PHP to write web apps. Since PHP is available on just about every web hoster while Python is much more rare, I'd like to check if some...
42
by: kenneth.m.mcdonald | last post by:
First, I don't intend this to be a flame war, please. Python and Ruby are the only two languages I'd willingly work in (at least amongst common languages), and TurboGears and Rails seem roughly...
5
by: ASP.NET explorer | last post by:
I have been asked to create some simple animation using Adobe Flash player in ASP.NET(C#) web application. While I am fairly well versed with ASP.NET C#, I absolutely have NO IDEA about how to...
10
by: Jules Winfield | last post by:
Guys, I've been designing applications for the financial services industry using MSFT technologies for many years (Win32 API, MFC, and now .NET WinForms). All applications are Internet-based,...
1
by: abbasnaqvi | last post by:
Hi All, I am developing Employee Management system in Adobe Flex and I am coding a web service to get data from the database and return it to Adobe Flex...
1
by: Sells, Fred | last post by:
Diez wrote: sounds good. Does that "py:strip" remove the <divand anything outside it. I'll be doing a flex style ajax call and it wants just the xml data tree.
1
by: Kirk Strauser | last post by:
We're looking to migrate a Zope site to Django, but before getting beyond the dreaming stage, I thought I'd see what others are doing these days. If you were going to start a fairly complex site...
1
by: Aspersieman | last post by:
On Wed, 05 Nov 2008 08:35:23 +0200, 3000 billg <billg3000@hos.twgg.org> wrote: Hi Excellent choice :)
0
by: susheela s | last post by:
Hi. I followed the link which is given below to develop an air application .The procedure i followed is there in this link...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.