473,399 Members | 2,774 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,399 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 1447
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.