Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Oct 31, 2022
1 parent ca0c2c7 commit f08b551
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion source/_templates/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p>
These are the docs for people using the new no-self format.
Docs for the models.py format are

<a href="https://github.com/oTree-org/otree-docs/tree/self/source">here</a>.
<a href="https://www.otree.org/newformat.html">What changed?</a> |
<a href="https://otree.readthedocs.io/en/master/misc/noself.html">How to upgrade</a>
Expand Down
1 change: 1 addition & 0 deletions source/misc/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version 5.9

- Improved dropout detection
- Renamed ``formInputs`` (JavaScript variable) to ``forminputs``
- 5.9.5: fix bug that points inputs allow decimal numbers when they should be whole numbers.

Version 5.8
===========
Expand Down
13 changes: 0 additions & 13 deletions source/rounds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,6 @@ They also work the same way for groups, but it does not make sense to use them i
Participant fields
~~~~~~~~~~~~~~~~~~

.. note::

As of March 2021, this is a new **optional** syntax for ``participant.vars``.
Instead of setting ``participant.vars['my_field'] = 1``,
you can now set ``participant.my_field = 1`` directly.
Just make sure to define ``PARTICIPANT_FIELDS`` first.
See `here <https://groups.google.com/g/otree/c/lbJg_ND5QkY>`__ for more info.

If you want to access a participant's data from a previous app,
you should store this data on the participant object,
which persists across apps (see :ref:`participants_and_players`).
Expand All @@ -116,11 +108,6 @@ Then in your code, you can get and set any type of data on these fields:
(Internally, all participant fields are stored in a dict called ``participant.vars``.
``participant.xyz`` is equivalent to ``participant.vars['xyz']``.)

Participant fields are not included in the Excel/CSV data export,
or in the "Data" tab in the session admin. If you want that, you should either
use :ref:`custom-export` or save ``str(participant.vars)`` into a ``LongStringField``.
(The same concept applies for session fields.)

.. _session_vars:

Session fields
Expand Down
6 changes: 5 additions & 1 deletion source/timeouts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ You can check if the page was submitted by timeout:
.. code-block:: python
class Page1(Page):
form_model = 'player'
form_fields = ['xyz']
timeout_seconds = 60
@staticmethod
def before_next_page(player, timeout_happened):
if timeout_happened:
player.xyz = True
# you may want to fill a default value for any form fields,
# because otherwise they may be left null.
player.xyz = False
.. _get_timeout_seconds:
Expand Down

0 comments on commit f08b551

Please sign in to comment.