Re: users Digest, Vol 36, Issue 4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: users Digest, Vol 36, Issue 4

robbedoes
Hi Nick,

Maybe we can run trough the scrips I wrote to see if I am doing OK.

Below the gateway script for Django. Can you please take a look and tell me if it is right?

import pyamf
from pyamf.remoting.gateway.django import DjangoGateway
from meterstanden.models import Location

# Do I need the next line??
pyamf.register_class(Location, 'com.subscription.vos.LocationVO')

def getLocations(request):
   locationList = Location.objects.all()
   return locationList
   
services = {
   'meterstandenservice.getLocations':getLocations,
}

myGateway = DjangoGateway(services, expose_request=True, logger=logging)


Cheers,

Rob

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

Re: users Digest, Vol 36, Issue 4

Nick Joyce

On 12 Nov 2010, at 04:57, Minox Taurus wrote:

> Hi Nick,
>
> Maybe we can run trough the scrips I wrote to see if I am doing OK.
>
> Below the gateway script for Django. Can you please take a look and tell me if it is right?
>
> import pyamf
> from pyamf.remoting.gateway.django import DjangoGateway
> from meterstanden.models import Location
>
> # Do I need the next line??
> pyamf.register_class(Location, 'com.subscription.vos.LocationVO')

It depends. If you want the objects that are reassembled to be weakly typed then no, you don't need this. However if you want all Python Location instances to be built as specific classes in Flex/Flash, yes.

>
> def getLocations(request):
>   locationList = Location.objects.all()
>   return locationList
>
> services = {
>   'meterstandenservice.getLocations':getLocations,
> }
>
> myGateway = DjangoGateway(services, expose_request=True, logger=logging)

All looks good so far.

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