Using RemoteObject component i.c.w. PyAmf - Django

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using RemoteObject component i.c.w. PyAmf - Django

robbedoes
Hi all,

Has any of you successfully used a mx or s RemoteObject component i.c.w. PyAmf & Django?

Working with Flash Builder 4 I can’t use this object because the event:ResultEvent gives errors.
The solution I found is using a netconnection.call to the gateway and using the data:Object in the on_result_handler_function.
I am wondering if my server side scripts are wrong or if PyAmf isn’t working correctly when combined with Django.

Any feedback on this?

Cheers, Rob

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Using RemoteObject component i.c.w. PyAmf - Django

Nick Joyce
RemoteObject *should* work just fine, what kind of errors are you seeing and if possible attach the http response (from Charles/fiddler)

Thanks!

On 01/11/2010, at 21:35, Minox Taurus <[hidden email]> wrote:

Hi all,

Has any of you successfully used a mx or s RemoteObject component i.c.w. PyAmf & Django?

Working with Flash Builder 4 I can’t use this object because the event:ResultEvent gives errors.
The solution I found is using a netconnection.call to the gateway and using the data:Object in the on_result_handler_function.
I am wondering if my server side scripts are wrong or if PyAmf isn’t working correctly when combined with Django.

Any feedback on this?

Cheers, Rob
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Using RemoteObject component i.c.w. PyAmf - Django

robbedoes
In reply to this post by robbedoes
Hi Nick,

result="getpolls_resultHandler(event)" is causing tis error:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@12dacc59 to mx.messaging.messages.IMessage.

This is part of my mxml script:

protected function getpolls_resultHandler(event:ResultEvent):void{
pollCollection = event.result as ArrayCollection;
}

<s:RemoteObject id="test2"
destination="PollService"
fault="getpolls_faultHandler(event)">
<mx:method name="getPolls" result="getpolls_resultHandler(event)"/> 
</s:RemoteObject>

And this is my gateway.py

from pyamf.remoting.gateway.django import DjangoGateway
import pyamf
from pyamf import amf3
from django.core.exceptions import ObjectDoesNotExist

from polls.models import Poll
amf3.use_proxies_default = True
pyamf.register_class(Poll, 'valueObjects.Poll')

def getPolls(request):
    return Poll.objects.all()

gw = DjangoGateway({
     "PollService.getPolls": getPolls,
})


The strange thing is that I get results when I use a NetConnection.

connection = new NetConnection;
connection.connect("http://127.0.0.1:8000/gateway/");
connection.call("PollService.getPolls", new Responder(onResult_polls, onFault_polls));

But then 

private function onResult_polls(data:Object):void

is using a data:Object


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users