I have the following Django and Flex code:
Django
class Author(models.Model): name = models.CharField(max_length=30) class Book(models.Model): title = models.CharField(max_length=30) author = models.ForeignKeyField(Author)
Flex
package com.myproject.models.vo { [Bindable] [RemoteClass(alias="myproject.models.Book")] public class BookVO { public var id:int; public var title:String; public var author: AuthorVO; } }
As you can see in this example, the author is a foreign key in my book. Now I would like to name the author when I call my BookVO in Flex. Thus, I would expect the code to work as follows, but "author_name" leads to null:
var book = new BookVO(); var author_name = book.author.name;
I understand that I can directly contact AuthorVO, but the essence of this question is how you can retrieve values ββwith a foreign key using Flex when your VOs are attached to a remote object? I am currently using PyAMF to bridge the gap between Flex and Django, but I'm not sure which is relevant.
source share