Whitelisting attributes for encoding

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

Whitelisting attributes for encoding

Simon Bierbaum-2
Hi all,

is it possible to have the encoder only encode a fixed set of  
attributes for a registered class, as in an attribute whitelist? I  
have a class whose attributes on the Python side change frequently,  
however I would like the list of attributes transmitted to the Flex  
client to be fixed, no matter what I do to the class.

Thanks,

Simon

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

Re: Whitelisting attributes for encoding

Thijs Triemstra
Hi Simon,

have you checked out this document [1]?

hth,

Thijs

[1] http://docs.pyamf.org/dev/architecture/attributecontrol.html

On 5 Jan 2010, at 01:24, Simon Bierbaum wrote:

> Hi all,
>
> is it possible to have the encoder only encode a fixed set of attributes for a registered class, as in an attribute whitelist? I have a class whose attributes on the Python side change frequently, however I would like the list of attributes transmitted to the Flex client to be fixed, no matter what I do to the class.
>
> Thanks,
>
> Simon
>
> _______________________________________________
> 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: Whitelisting attributes for encoding

Simon Bierbaum-2
Hi Thijs,

yes. I know I can specify which attributes to encode unconditionally  
using 'static', but I don't see an option to tell PyAMF, "encode  
everything in 'static', but exclude everything else". I believe PyAMF  
did this by default in 0.3.1, but in 0.5.1, not so.

Cheers, Simon

Am 05.01.2010 um 01:36 schrieb Thijs Triemstra | Collab:

> Hi Simon,
>
> have you checked out this document [1]?
>
> hth,
>
> Thijs
>
> [1] http://docs.pyamf.org/dev/architecture/attributecontrol.html
>
> On 5 Jan 2010, at 01:24, Simon Bierbaum wrote:
>
>> Hi all,
>>
>> is it possible to have the encoder only encode a fixed set of  
>> attributes for a registered class, as in an attribute whitelist? I  
>> have a class whose attributes on the Python side change  
>> frequently, however I would like the list of attributes  
>> transmitted to the Flex client to be fixed, no matter what I do to  
>> the class.
>>
>> Thanks,
>>
>> Simon
>>
>> _______________________________________________
>> 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

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

Re: Whitelisting attributes for encoding

Nick Joyce
Hi Simon,

To get the behaviour that you require supply the dynamic attribute (defaults to True):

class Foo(object):
    class __amf__:
        dynamic = False
        static = ('foo', 'bar', 'baz')

Hth,

Nick

On 5 Jan 2010, at 08:38, Simon Bierbaum wrote:

> Hi Thijs,
>
> yes. I know I can specify which attributes to encode unconditionally using 'static', but I don't see an option to tell PyAMF, "encode everything in 'static', but exclude everything else". I believe PyAMF did this by default in 0.3.1, but in 0.5.1, not so.
>
> Cheers, Simon
>
> Am 05.01.2010 um 01:36 schrieb Thijs Triemstra | Collab:
>
>> Hi Simon,
>>
>> have you checked out this document [1]?
>>
>> hth,
>>
>> Thijs
>>
>> [1] http://docs.pyamf.org/dev/architecture/attributecontrol.html
>>
>> On 5 Jan 2010, at 01:24, Simon Bierbaum wrote:
>>
>>> Hi all,
>>>
>>> is it possible to have the encoder only encode a fixed set of attributes for a registered class, as in an attribute whitelist? I have a class whose attributes on the Python side change frequently, however I would like the list of attributes transmitted to the Flex client to be fixed, no matter what I do to the class.
>>>
>>> Thanks,
>>>
>>> Simon
>>>
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> 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: Whitelisting attributes for encoding

Simon Bierbaum-2
Awesome, that did it! Thanks :-)

Simon

Am 05.01.2010 um 11:06 schrieb Nick Joyce:

> Hi Simon,
>
> To get the behaviour that you require supply the dynamic attribute  
> (defaults to True):
>
> class Foo(object):
>     class __amf__:
>         dynamic = False
>         static = ('foo', 'bar', 'baz')
>
> Hth,
>
> Nick
>
> On 5 Jan 2010, at 08:38, Simon Bierbaum wrote:
>
>> Hi Thijs,
>>
>> yes. I know I can specify which attributes to encode  
>> unconditionally using 'static', but I don't see an option to tell  
>> PyAMF, "encode everything in 'static', but exclude everything  
>> else". I believe PyAMF did this by default in 0.3.1, but in 0.5.1,  
>> not so.
>>
>> Cheers, Simon
>>
>> Am 05.01.2010 um 01:36 schrieb Thijs Triemstra | Collab:
>>
>>> Hi Simon,
>>>
>>> have you checked out this document [1]?
>>>
>>> hth,
>>>
>>> Thijs
>>>
>>> [1] http://docs.pyamf.org/dev/architecture/attributecontrol.html
>>>
>>> On 5 Jan 2010, at 01:24, Simon Bierbaum wrote:
>>>
>>>> Hi all,
>>>>
>>>> is it possible to have the encoder only encode a fixed set of  
>>>> attributes for a registered class, as in an attribute whitelist?  
>>>> I have a class whose attributes on the Python side change  
>>>> frequently, however I would like the list of attributes  
>>>> transmitted to the Flex client to be fixed, no matter what I do  
>>>> to the class.
>>>>
>>>> Thanks,
>>>>
>>>> Simon
>>>>
>>>> _______________________________________________
>>>> 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
>>
>> _______________________________________________
>> 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

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