Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ok, Here's an example...</p> <p>Model: </p> <pre><code>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) # # </code></pre> <p>Here's my amfgateway.py</p> <pre><code>def fetch_events(request, source): events = LoggedEvent.objects.select_related().all() return events # services = { 'recall.fetch_events': fetch_events, } gateway = DjangoGateway(services) </code></pre> <p>and here's my Actionscript for the receiving side of the AMF call:</p> <pre><code>protected function onRetrievedEvents(result: Object): void { for each(var evt: Object in result) { var who: Object = evt._who_cache.lname; ... </code></pre> <p>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:</p> <pre><code>TypeError: Error #1010: A term is undefined and has no properties. </code></pre> <p>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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload