On Fri, Aug 21, 2009 at 15:18, Daivd<[email protected]> wrote: > > Hi,all~How can return a nested object from backstage to my flex > project? For example, > I have defined an "author" model, and then a "book" model. author is > the reference key of book. > after query, I want to return the object of "book" to my flex project, > but it always wrong... why? Any idea? > I can sure that there isn't any wrong with my code, because when > return the "author" of the "book", it works. the code is like the > flowing: > def getBook(b): > return book.objects.get(bookname = b)
I usually use PyAMF to communicate between Django and Flex/Flash. I create simple ValueObjects that set attributes from model instances they get through their constructor, then generate AS3 versions of that classes and register them with the AMF stacks on both sides. That way, nicely typed objects go over the wire both ways. I know this is a bit vague, but so is your question. I still hope it gives you a nudge in the right direction. Use PyAMF. Use ValueObjects. ~jan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

