# Setting context with Proteus with a remote connection

**URL:** <https://discuss.tryton.org/t/setting-context-with-proteus-with-a-remote-connection/7166>\
**Category:** Developer\
**Tags:** proteus\
**Created:** [April 9, 2024, 9:54am UTC](https://discuss.tryton.org/t/setting-context-with-proteus-with-a-remote-connection/7166 "2024-04-09T09:54:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![McFloss](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/m/aeb1de/32.png) [@McFloss](https://discuss.tryton.org/u/McFloss)\
**Post date:** [April 9, 2024, 9:54am UTC](https://discuss.tryton.org/t/setting-context-with-proteus-with-a-remote-connection/7166/1 "2024-04-09T09:54:27Z")

</div>

Hi,

I am trying to import some Categories according the [Proteus example documentation](https://docs.tryton.org/latest/client-library/index.html#example-of-usage)

I am connecting to a remote Tryton instance so I am using confit.set\_xmlrpc

> config.set\_xmlrpc(remote\_url)  
> …  
> Category = Model.get(‘party.category’)  
> with config.set\_context(language=‘en’):  
> category = Category(name=“Category”)  
> category.save()

When I execute the script I received the following error:

> with config.set\_context(language=‘en’):  
> AttributeError: module ‘proteus.config’ has no attribute ‘set\_context’

What am I doing wrong? can you aim me to the any examples to check how to do it?

Regards,

Mc

---

<div class="post-metadata">

**Author:** ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)\
**Post date:** [April 9, 2024, 10:51am UTC](https://discuss.tryton.org/t/setting-context-with-proteus-with-a-remote-connection/7166/2 "2024-04-09T10:51:23Z")

</div>

Try this:

```auto
my_config = config.set_xmlrpc(remote_url)
Category = Model.get(‘party.category’)
with my_config.set_context(language=‘en’):
    category = Category(name=“Category”)
    category.save()

```

---

<div class="post-metadata">

**Author:** ![McFloss](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/m/aeb1de/32.png) [@McFloss](https://discuss.tryton.org/u/McFloss)\
**Post date:** [April 9, 2024, 11:29am UTC](https://discuss.tryton.org/t/setting-context-with-proteus-with-a-remote-connection/7166/3 "2024-04-09T11:29:11Z")

</div>

it Works!! Thank you very much.

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [April 9, 2024, 11:29pm UTC](https://discuss.tryton.org/t/setting-context-with-proteus-with-a-remote-connection/7166/4 "2024-04-09T23:29:44Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
