> >thank you for the advice, Hi Évrard how might I alter a specific party 
> >address without resulting to sql statements 
>
> Due to the switch to the active record pattern it is now quite easy to 
> change the value of field: 
>
>      
> http://hg.tryton.org/modules/sale_supply/file/5c867861be6e/sale.py#l29 
>
> -- 
> Nicolas Évrard 
>
> B2CK SPRL 
> 4, rue de Rotterdam 
> 4000 Liège 
> Belgium 
> Tel: +32 472 54 46 59 
> E-mail/Jabber: [email protected] <javascript:> 
> Website: http://www.b2ck.com/ 


I am unable to obtain the specific instance of the class whose fields I 
wish to alter, examples offered utilized 'self' as the class instance but I 
need to find the instance(s) with a specified party .

below I tried using the garbage collector to obtain the specific class 
instance, without success.

        cls=pool.get('party.address')
        import gc
        for obj in gc.get_objects():
            if isinstance(obj, cls):
                if obj.party==78:
                    obj.street='Mystreet name'
                    obj.save() 

should this have been posted as a new question?

Reply via email to