pyamf

How to deserialize and serialize AMF Packets in Python?

点点圈 提交于 2020-01-17 05:18:14
问题 I am rewriting the following Perl code in Python: my $data = Data::AMF::Packet->new->deserialize($packet); $data->messages->[0]->{value}->[1] = $data->messages->[1]->{value}->[1] = $mid; $data = $data->serialize; I would like to know how to write this in Python? I am new to PyAMF and the examples I googled wont help. Thanks a lot! 回答1: Something along the lines of: from pyamf import remoting packet = remoting.decode(bytes) packet['/1'][1] = packet['/2'][1] stream = remoting.encode(packet)

Flex 4 + Django: Testing and Release Options

与世无争的帅哥 提交于 2019-12-25 03:16:49
问题 I am creating a django-based site that will serve flash apps that occasionally access data via pyamf. I need to be able to easily test the flash in the context of the django framework, i.e. with all the login cookies and everything available, so that when I make a pyamf call, it has all the user context there. And I need to be able to test and release both the swf's and the wrapper html's in a sane way. However: The html templates in flex are already templates, so if I put template code in

How can I use Flex to access foreign-keyed fields in Django?

╄→гoц情女王★ 提交于 2019-12-06 04:10:26
问题 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