Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 111379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:22:33+00:00 2026-05-11T02:22:33+00:00

I have the following Django and Flex code: Django class Author(models.Model): name = models.CharField(max_length=30)

  • 0

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, Author is a foreign key in my Book model. Now I’d like to acccess the author’s name when I call my BookVO in Flex. As such, I’d expect code like the following to work, but ‘author_name’ results in a null:

var book = new BookVO(); var author_name = book.author.name; 

I realize I could call an AuthorVO directly, but the crux of this question is how can you retrieve foreign-keyed values using Flex when your VOs are bound to a remote object? I’m currently using PyAMF to bridge the gap between Flex and Django, but I’m not sure that’s relevant.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:22:33+00:00Added an answer on May 11, 2026 at 2:22 am

    Ok, Here’s an example…

    Model:

    class Logger(models.Model):     lname = models.CharField(max_length=80)      def __unicode__(self):         return self.lname     # #  class DataSource(models.Model):     dsname = models.CharField(max_length=80)     def __unicode__(self):         return self.dsname     # #  class LoggedEvent(models.Model):     # who's data is this?     who = models.ForeignKey(Logger)     # what source?     source = models.ForeignKey(DataSource)     # the day (and, for some events also the time)     when = models.DateTimeField()     # the textual description of the event, often the raw data     what = models.CharField(max_length=200)     # from -1.0 to 1.0 this is the relative     # importance of the event     weight = models.FloatField()      def __unicode__(self):         return u'%2.2f %s:%s - %s' % (self.weight, self.source, self.who, self.what)     # # 

    Here’s my amfgateway.py

    def fetch_events(request, source):     events = LoggedEvent.objects.select_related().all()     return events #  services = {     'recall.fetch_events': fetch_events, }  gateway = DjangoGateway(services) 

    and here’s my Actionscript for the receiving side of the AMF call:

    protected function onRetrievedEvents(result: Object): void {      for each(var evt: Object in result) {         var who: Object = evt._who_cache.lname;  ... 

    The evt._who_cache.lname is populated with the select_related() and missing when the select related is missing. If I get rid of the select_related() call, then I see the error:

    TypeError: Error #1010: A term is undefined and has no properties. 

    You must be trying a different technique with your RemoteClass… so the select_related might not be the problem at all… (otherwise my first answer wouldn’t have gotten negged.) The rest is up to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 90k
  • Answers 90k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Here's a stupid hack that solves the problem. Prepend a… May 11, 2026 at 6:04 pm
  • Editorial Team
    Editorial Team added an answer Turns out that this was a bug in the mono… May 11, 2026 at 6:04 pm
  • Editorial Team
    Editorial Team added an answer It seemed like the RS232 cable (adapter) caused the crashes… May 11, 2026 at 6:04 pm

Related Questions

So far, I've had great success using PyAMF to communicate between my Flex front-end
I have the following post-commit hook setup and running: #!/bin/bash /usr/bin/svn update /var/www/html/dev >
I have worked a bit with Django and I quite like its project/applications model
I have a pretty standard django app, and am wondering how to set the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.