pyamf

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

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")] ...

Issue with PyAMF, Django, and Python's "property" feature

So far, I've had great success using PyAMF to communicate between my Flex front-end and my Django back-end. However, I believe I've encountered a bug. The following example (emphasis on the word "example") demonstrates the (potential) bug: My Flex app contains the following VO: package myproject.model.vo { [Bindable] [RemoteC...

Hello world Pyamf small error message

Hi i am trying to link flex to django with Pyamf As a first step i tried the basic Hello World http://pyamf.org/wiki/DjangoHowto But that results in an ErrorFault. I use django 1.0.2 amfgateway.py in the root folder of my project (same level as settings) import pyamf from pyamf.remoting.gateway.django import DjangoGateway from djan...

Flex Tree Dynamic data and Python, use case questions

Hi, On the flex side i have a tree component which gets his Tree data from the backend. On the backend side we have Django using Pyamf for communication with Flex. We use MPTT (Modified Preorder Tree Traversal) Dango app to store Categories in a tree like fashion (a category Class has a parent field). We also have an Item Model Class w...

File handling in Django when posting image from service call

Hi all, I am using PyAMF to transfer a dynamically generated large image from Flex to Django. On the Django side i receive the encodedb64 data as a parameter: My Item model as an imagefield. What i have trouble to do is saving the data as the File Django Field. def save_item(request, uname, data): """ Save a new item """ i...

PyAMF / Django - Flex class mapping errors

Hey there, I'm using PyAmf to communicate with a Flex app. But I keep getting errors. My model: from django.contrib.auth.models import User class Talent(User): street = models.CharField(max_length=100) street_nr = models.CharField(max_length=100) postal_code = models.PositiveIntegerField() city = models.CharField(max_...

BlazeDS - AMFConnection.call giving HTTP 400 status.

I'm trying to use BlazeDS's AMFConnection class to connect to pyamf, but when I call AMFConnection.call(), I get HTTP status 400 (Bad Request - "The request body was unable to be successfully decoded."). I'm more or less following this example: (pyamf.org/wiki/ClientHowTo ... sorry, I'm a new user so I guess I can't use hyperlinks. appen...

Using mx:RemoteObject with web2py's @service.amfrpc decorator.

I am using web2py (v1.63) and Flex 3. web2py v1.61 introduced the @service decorators, which allow you to tag a controller function with @service.amfrpc. You can then call that function remotely using http://..../app/default/call/amfrpc/[function]. See http://www.web2py.com/examples/default/tools#services. Does anybody have an example of...

authenticate from Flex in Django with pyAMF

Maybe somebody can show an example of such a task, or specify where to look. ...

app-engine-patch with pyamf = No module named encoding

I'm trying to use app-engine-patch with pyamf by following this: http://pyamf.org/wiki/GoogleAppEngine because I want to migrate my Django <-> pyamf application to app-engine-patch <-> pyamf. What I have now is that I created my gateway.py with only one line of code: import pyamf just to test can I use pyamf and I get blank page whe...

Flex: AMF and Enum Singletons – can they play well together?

I'm using Python+PyAMF to talk back and forth with Flex clients, but I've run into a problem with the psudo-Enum-Singletons I'm using: class Type { public static const EMPTY:Type = new Type("empty"); public static const FULL:Type = new Type("full"); ... } When I'm using locally created instances, everything is peachy: if...

PyAMF backend choices!

I've been using PyAMF to write a backend for a flex app that will request different groups of hundreds of different images depending on what the client needs. I have been using the "simple_server" WSGI server that PyAMF supplies while developing the flex code. Now I'm ready to write a robust backend that will be able to pull images from ...

Django + pyamf: Strange exception when calling the gateway from actionscript application

Hi! Could you please help. I am using the django-amf-gateway application (http://bitbucket.org/wolever/django-amf-gateway). I defined the gateway this way: from django_amf_gateway import register_amf_service from goserver.models import Game class ChangeService(object): def state(self): game = Game.objects.get(id = 1) ...

return a FaultObject on purpose from pyamf

I am currently migrating from RubyAMF to PyAMF. In RubyAMF you can return a FaultObject deliberately like so: render :amf => FaultObject.new("Thats not your pie!") Is there comparable functionality in PyAMF? I've searched the docs and can't find any mention of it. ...

kwargs sent over pyAMF channel

Hello, I'm using cherrypy server to receive requests over a pyAMF channel from a python client. I started with the mock up below and it works fine: Server: import cherrypy from pyamf.remoting.gateway.wsgi import WSGIGateway def echo(*args, **kwargs): return (args, kwargs) class Root(object): def index(self): return "...

How to set up PyAMF Django gateway so it uses AMF3?

How to set up PyAMF Django gateway so it uses AMF3 instead of the default AMF0? ...

Where (at which point in the code) does pyAMF client accept SSL certificate?

Hello, I've set up a server listening on an SSL port. I am able to connect to it and with proper credentials I am able to access the services (echo service in the example below) The code below works fine, but I don't understand at which point the client accepts the certificate Server: import os.path import logging import cherrypy fro...

GAE datastore eager loading in python api

I have two models in relation one-to-many: class Question(db.Model): questionText = db.StringProperty(multiline=False) class Answer(db.Model): answerText = db.StringProperty(multiline=False) question = db.ReferenceProperty(Question, collection_name='answers') I have front-end implemented in F...

Custom serialization in PyAMF failing

Please have a look at the following: It's on pastebin, because it doesn't wrap that well here. http://pastebin.org/84945 I'm not even trying to serialize objects, so why is it giving me that error? Regards Martin ...

Limiting pyamf flex sessions or setting a timeout

How do I limit my amf sessions to flex over pyamf? I have set up a pyamf gateway to that serves value objects that originate from a django admin panel, through sqlalchemy to my authenticated flex client. It's working great, however there is a problem. My sessions are persisting and clogging up the server, so after about 20 or so AMF ses...