How to get values from model to wizard

I want to send a flag from the button code to the transition method in a wizard. so for example:-

Class A(ModelSQL, ModelView):
__name__ = 'model_a'

    <some fields and other code>

    def my_button(cls, records):
        flag = "foo"
    def my_button_bar(cls, records):
         flag = "bar"


Class MyWizard(Wizard):

    start_state = 'this'

    this = StateTransition()

    def do_this():
        if flag == 'foo':
              <do foo thing>
        elif flag == 'bar':
              <do bar thing>
               <do whatever you want>

I remember using “context” previously. I am not sure how to do the same here in version 5.0.

In the context when running a wizard, there is the keys active_id, active_ids and active_model which contains the value based on the selected records when the wizard was launched by the client.

@ced Thanks for the answer. However, I was already able to get the active_model, active_id and active_ids and use them to fetch the record’s values based on the fields defined in the model. However, I was trying to pass some flags from model to wizard. One idea is to create a field as “flag” on the model and save the flag values on this field when the button is clicked. I was thinking of something where I am able to pass the values without the help of any database based field, something that can be used dynamically to pass the values. Is there any possible way to pass the flag value in the context ??

Just put a StateView on the wizard that asks for the information.