event.rst 3.03 KB
Newer Older
1 2 3 4 5 6
.. include:: hyperlinks.txt

Events
=======

This applications record events. It can happen at a date or span during a
LE GAC Renaud's avatar
LE GAC Renaud committed
7
period of time.
8

LE GAC Renaud's avatar
LE GAC Renaud committed
9
An event is defined by a *starting date*, by an *ending date* and by a *type*.
10 11 12 13

An event contains *meta-data* linking the event to:

* a person
LE GAC Renaud's avatar
LE GAC Renaud committed
14
* a team
15 16 17 18
* a project
* a category (the category of people in this application)
* a funding agency

LE GAC Renaud's avatar
LE GAC Renaud committed
19
The events are stored in the ``history`` table and the meta-data in the foreign
20 21
tables ``fundings``, ``people``, ``people_categories``, ``projects`` and
``teams``. The organization of the table can not be changed. All the fields of
LE GAC Renaud's avatar
LE GAC Renaud committed
22 23
these tables are standard database field which can be used in SQL request or in
reports.
24

LE GAC Renaud's avatar
LE GAC Renaud committed
25 26
An event contains also the *user data block*. It is stored in one database
field. The user data block is a python dictionary serialized as a JSON_ string.
27 28 29
The structure of the dictionary, *the keys*, are defined by the user, once, for
each event type. The structure of the dictionary can be modified at any
time by the user. Mechanisms are in placed to guaranty the consistency across
LE GAC Renaud's avatar
LE GAC Renaud committed
30 31 32
the database. The SQL request are limited to string operations.
Individual key of the dictionary can not be used in SQL request. But, any key
can be manipulated in reports.
33

LE GAC Renaud's avatar
LE GAC Renaud committed
34 35
Define an event
----------------
36 37 38 39 40

The event definitions are stored in the ``events`` table.

In order to create a new event definition:

LE GAC Renaud's avatar
LE GAC Renaud committed
41
    1. Open the leaf ``events > definition`` in the left panel of the
42
       viewport.
LE GAC Renaud's avatar
LE GAC Renaud committed
43 44
    2. Open the contextual menu in the right panel.
    3. Select the menu item ``Add``.
45

LE GAC Renaud's avatar
LE GAC Renaud committed
46 47 48
        .. figure:: figures/event-form.png
           :align: center
           :width: 50%
49

LE GAC Renaud's avatar
LE GAC Renaud committed
50
           The form to enter an event definition in the database.
51

LE GAC Renaud's avatar
LE GAC Renaud committed
52
    4. Enter the event type in the ``event`` entry.
LE GAC Renaud's avatar
LE GAC Renaud committed
53 54
    5. Enter the python dictionary structure in the ``model`` field.
       Add the first key by right clicking on ``property`` label. Later on,
LE GAC Renaud's avatar
LE GAC Renaud committed
55
       key can be ``Add``, ``Modify`` or ``Delete`` using the
56 57 58
       contextual menu.

        .. warning::
LE GAC Renaud's avatar
LE GAC Renaud committed
59
            the data user block of the existing events are updated when the
60 61 62 63 64
            python dictionary structure is modified.

       A good practice is to enter the type of key (``boolean``,
       ``date``, ``string``, ``number``) or a default value.

LE GAC Renaud's avatar
LE GAC Renaud committed
65 66
Enter an event in the history
------------------------------
67

LE GAC Renaud's avatar
LE GAC Renaud committed
68
Events of any kind are stored in the ``history`` table.
69 70
In order to create a new one:

LE GAC Renaud's avatar
LE GAC Renaud committed
71
    1. Open the leaf ``events > history`` in the left panel of the
72
       viewport.
LE GAC Renaud's avatar
LE GAC Renaud committed
73 74
    2. Open the contextual menu in the right panel.
    3. Select the menu item ``Add``.
75

LE GAC Renaud's avatar
LE GAC Renaud committed
76 77 78
        .. figure:: figures/history-form.png
           :align: center
           :width: 50%
79

LE GAC Renaud's avatar
LE GAC Renaud committed
80
           The form to enter an event in the database.
81 82

    4. Scan the different tabs and fill the appropriate entries.
LE GAC Renaud's avatar
LE GAC Renaud committed
83 84 85 86 87 88 89

Make report on events
----------------------

The application provides a rich set of tools to configure and to
produce reports. They are covered in the Chapters :ref:`Configure the lists`,
:ref:`Configure the 1-dim metrics` and :ref:`Configure the 2-dim metrics`