Thanks Leonel,
Yes, as you comment the assignation was correct.
I managed to fix it but I do not know why yet. It must be something else,
somewhere else in the controller code (that's my guess).
I went for the following quick and dirty test and it started to work:
1) duplicate the variables stored in the session, see below:
if session.training_id is None:
session.training_id = 0
session.user_training_probs = []
session.configuration_training = 0 #REMOVE: for debuggin only
session.configuration_list = []#REMOVE: for debuggin only
session.training_id = training_id
session.user_training_probs = list(set([r.problem for r in rows]))#remove
duplicates
session.configuration_training = training_id#REMOVE: for debuggin only
session.configuration_list = list(set([r.problem for r in
rows]))#REMOVE: for debuggin only
2) check that the new ones were correctly updated
3) replace the session variables used in views and controllers ( from
training_id and user_training_probs to configuration_training and
configuration_list)
I'll keep on seeking for the problem.
Regards, Jon.
On Wed, Feb 27, 2019 at 10:10 AM Leonel Câmara <[email protected]>
wrote:
> I don't see anything wrong with your code, you're even creating new lists
> each time you change the value so they're surely being updated. If the view
> is showing correctly, maybe the problem is with your debug code which is
> printing session values before they're changed.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.