Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to use dot notation for setting context in reflex #136

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jonathan-s
Copy link
Owner

@jonathan-s jonathan-s commented Jul 27, 2021

Type of PR (feature, enhancement, bug fix, etc.)

Description

In an effort to improve the api for setting the context that is
used in the final context in the reflex we introduce a dot notation
for setting the context. Ie reflex.context.my_context = 'value'.

For the old way of setting the context in instance variables you
now also prevented to set an instance variable that is already used
by the reflex.

Fixes #122, @dylanjw, you might want to have a look at this.

Checklist

  • Tests are passing
  • Documentation has been added or amended for this feature / update

@jonathan-s jonathan-s force-pushed the context-dict branch 2 times, most recently from b1778e1 to a9bff7d Compare July 27, 2021 21:45
@jonathan-s jonathan-s changed the title Make it possible to use dot notation for setting context in reflex WIP: Make it possible to use dot notation for setting context in reflex Jul 27, 2021
@jonathan-s jonathan-s changed the title WIP: Make it possible to use dot notation for setting context in reflex Make it possible to use dot notation for setting context in reflex Jul 28, 2021
@jonathan-s jonathan-s force-pushed the context-dict branch 2 times, most recently from 59b6d8d to fbee544 Compare July 28, 2021 18:51
@jonathan-s jonathan-s added the enhancement New feature or request label Jul 30, 2021
sockpuppet/consumer.py Outdated Show resolved Hide resolved
In an effort to improve the api for setting the context that is
used in the final context in the reflex we introduce a dot notation
for setting the context. Ie `reflex.context.my_context = 'value'`.

For the old way of setting the context in instance variables you
now also prevented to set an instance variable that is already used
by the reflex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting instance level attributes in Reflex as a way to set context data is a confusing API
2 participants