Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In order to support this, PyAMF needs to provide a synonym mapping between fields. Until then, you could use <a href="http://livedocs.adobe.com/flex/3/langref/flash/utils/IExternalizable.html" rel="nofollow noreferrer">IExternalizable</a> (although clumsily):</p> <pre><code>class UserProfile(model.Model): user = models.ForeignKey( User, unique=True ) blurb = models.CharField( max_length=200, null=True, blank=True ) public = models.BooleanField( default=True ) class __amf__: external = True def __writeamf__(self, output): output.writeObject(self.id) output.writeObject(self.blurb) output.writeObject(self.public) def __readamf__(self, input): self.id = input.readObject() self.blurb = input.readObject() self.public = input.readObject() </code></pre> <p>With the corresponding Flex code:</p> <pre><code>[RemoteClass(alias="...")] [Bindable] public class UserProfile implements IExternalizable { public function UserProfile() { } public var id:int; public var blurb:String; public var _public:Boolean; public function writeExternal(output:IDataOutput) { output.writeObject(id); output.writeObject(blurb); output.writeObject(_public); } public function readExternal(input:IDataInput) { id = input.readObject(); blurb = input.readObject(); _public = input.readObject(); } } </code></pre> <p>Note I haven't tested the above code, but should work in principle.</p> <p>Btw, can you go into greater detail about what was confusing about the <a href="http://docs.pyamf.org/architecture/attributecontrol.html" rel="nofollow noreferrer">documentation</a>? I would love to make that as clear possible for new users.</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