<commit_before>.. _welfare.specs.immersion:

===================
Immersion trainings
===================

.. How to test only this document:

    $ python setup.py test -s tests.SpecsTests.test_immersion
    
    doctest init:

    >>> from __future__ import print_function
    >>> import os
    >>> os.environ['DJANGO_SETTINGS_MODULE'] = \
    ...    'lino_welfare.projects.chatelet.settings.doctests'
    >>> from lino.api.doctest import *

This document describes the :mod:`lino_welfare.modlib.immersion`
plugin.


.. contents::
   :depth: 2



Configuration
=============

A system administrator can select :menuselection:`Configure -->
Integration --> Immersion training types`  to configure the list of
"immersion training types" (:class:`immersion.ContractType
<lino_welfare.modlib.immersion.models.ContractType>`).

The default data for this table is generated by the :mod:`std
<lino_welfare.modlib.immersion.fixtures.std>` fixture:

>>> rt.show(immersion.ContractTypes)
... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE +REPORT_UDIFF
=========================== =========================== ===================== ===================== ================
 Désignation                 Désignation (de)            Désignation (en)      Régime d'évaluation   Modèle
--------------------------- --------------------------- --------------------- --------------------- ----------------
 MISIP                       MISIP                       MISIP                                       Default.odt
 Mise en situation interne   Mise en situation interne   Internal engagement                         Default.odt
 Stage d'immersion           Stage d'immersion           Immersion training                          StageForem.odt
=========================== =========================== ===================== ===================== ================
<BLANKLINE>


Demo data
=========

:class:`lino_welfare.modlib.immersion.models.Contract`

>>> rt.show(immersion.Contracts)
... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE +REPORT_UDIFF
==== ========================= ===================== ================== ============ ================= ===========================
 ID   Bénéficiaire              Organisation          Début de contrat   Fin prévue   Titulaire (ISP)   Type de stage d'immersion
---- ------------------------- --------------------- ------------------ ------------ ----------------- ---------------------------
 1    <NAME> (128)       <NAME>   29/10/2012         21/02/2014   <NAME>   MISIP
 2    <NAME> (128)       <NAME>       22/02/2014         31/12/2014   <NAME>   Mise en situation interne
 3    <NAME> (133)   Rumma & Ko OÜ         03/12/2012         11/10/2013   <NAME>   Stage d'immersion
 4    <NAME> (144)        <NAME>      07/01/2013         06/02/2013   <NAME>   MISIP
 5    <NAME> (159)   Rumma & Ko OÜ         11/02/2013         06/06/2014   <NAME>   Mise en situation interne
 6    <NAME> (159)   <NAME>   07/06/2014         15/04/2015   <NAME>    Stage d'immersion
==== ========================= ===================== ================== ============ ================= ===========================
<BLANKLINE>


Immersion trainings with external partner
=========================================

French-speaking PCSWs use a custom template imposed by FOREM when
printing immersion trainings with some external partner.

>>> obj = immersion.Contract.objects.get(pk=3)
>>> print(str(obj.company))
Rumma & Ko OÜ
>>> bm = printing.BuildMethods.appyodt
>>> ex = obj.printed_by
>>> ex.do_print.bound_action.action.get_print_templates(bm, ex)
... #doctest: +NORMALIZE_WHITESPACE +IGNORE_EXCEPTION_DETAIL +ELLIPSIS
['StageForem.odt']<commit_msg>#2195 : Fix unicode issue.<commit_after>.. _welfare.specs.immersion:

===================
Immersion trainings
===================

.. How to test only this document:

    $ python setup.py test -s tests.SpecsTests.test_immersion
    
    doctest init:

    >>> from __future__ import print_function,unicode_literals
    >>> import os
    >>> os.environ['DJANGO_SETTINGS_MODULE'] = \
    ...    'lino_welfare.projects.chatelet.settings.doctests'
    >>> from lino.api.doctest import *

This document describes the :mod:`lino_welfare.modlib.immersion`
plugin.


.. contents::
   :depth: 2



Configuration
=============

A system administrator can select :menuselection:`Configure -->
Integration --> Immersion training types`  to configure the list of
"immersion training types" (:class:`immersion.ContractType
<lino_welfare.modlib.immersion.models.ContractType>`).

The default data for this table is generated by the :mod:`std
<lino_welfare.modlib.immersion.fixtures.std>` fixture:

>>> rt.show(immersion.ContractTypes)
... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE +REPORT_UDIFF
=========================== =========================== ===================== ===================== ================
 Désignation                 Désignation (de)            Désignation (en)      Régime d'évaluation   Modèle
--------------------------- --------------------------- --------------------- --------------------- ----------------
 MISIP                       MISIP                       MISIP                                       Default.odt
 Mise en situation interne   Mise en situation interne   Internal engagement                         Default.odt
 Stage d'immersion           Stage d'immersion           Immersion training                          StageForem.odt
=========================== =========================== ===================== ===================== ================
<BLANKLINE>


Demo data
=========

:class:`lino_welfare.modlib.immersion.models.Contract`

>>> rt.show(immersion.Contracts)
... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE +REPORT_UDIFF
==== ========================= ===================== ================== ============ ================= ===========================
 ID   Bénéficiaire              Organisation          Début de contrat   Fin prévue   Titulaire (ISP)   Type de stage d'immersion
---- ------------------------- --------------------- ------------------ ------------ ----------------- ---------------------------
 1    <NAME> (128)       <NAME>   29/10/2012         21/02/2014   <NAME>   MISIP
 2    <NAME> (128)       <NAME>       22/02/2014         31/12/2014   <NAME>   Mise en situation interne
 3    <NAME> (133)   Rumma & Ko OÜ         03/12/2012         11/10/2013   <NAME>   Stage d'immersion
 4    <NAME> (144)        <NAME>      07/01/2013         06/02/2013   <NAME>   MISIP
 5    <NAME> (159)   Rumma & Ko OÜ         11/02/2013         06/06/2014   <NAME>   Mise en situation interne
 6    <NAME> (159)   <NAME>   07/06/2014         15/04/2015   <NAME>    Stage d'immersion
==== ========================= ===================== ================== ============ ================= ===========================
<BLANKLINE>


Immersion trainings with external partner
=========================================

French-speaking PCSWs use a custom template imposed by FOREM when
printing immersion trainings with some external partner.

>>> obj = immersion.Contract.objects.get(pk=3)
>>> print(str(obj.company))
Rumma & Ko OÜ
>>> bm = printing.BuildMethods.appyodt
>>> ex = obj.printed_by
>>> print(ex.do_print.bound_action.action.get_print_templates(bm, ex))
... #doctest: +NORMALIZE_WHITESPACE +IGNORE_EXCEPTION_DETAIL +ELLIPSIS
[u'StageForem.odt']
{'fraction_non_alphanumeric': 0.2968197879858657, 'fraction_numerical': 0.0337048110899701, 'mean_word_length': 2.429170549860205, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5182762', 'n_tokens_mistral': 2248, 'n_tokens_neox': 1973, 'n_words': 460}