event.rst 3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
.. include:: hyperlinks.txt

Events
=======

This applications record events. It can happen at a date or span during a
period of time. An event is the relation between a person and a team /
project. When he/she arrive, left. How many time does he/she spent. It can also
be an entry in a changelog. Why and when the content of the database has been
modified. In fact, there are no limitation on the events which can be tracked.

An event is defined by a *starting date*, by an *ending date* and by a *name*.

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

* a person
* a teams
* a project
* a category (the category of people in this application)
* a funding agency

The event are stored in the ``history`` table and the meta-data in the foreign
tables ``fundings``, ``people``, ``people_categories``, ``projects`` and
``teams``. The organization of the table can not be changed. All the fields of
these tables are standard database field. They can be used in standard SQL
request or in reports.

An event contains also a *user data block*. It is stored in one database field.
The user data block is a python dictionary serialized as a JSON_ string.
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
the database. The SQL Request are limited to string operations.
Individual key of the dictionary can not be used. But, any key can be used in
reports.

How to define an event
----------------------

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

In order to create a new event definition:

    1. open the leaf ``events > definition`` in the left panel of the
       viewport.
    2. right click anywhere in the right panel
    3. select the menu item ``Add``

    .. figure:: figures/event-form.png
       :align: center
       :width: 50%

53
       The form to enter an event definition in the database.
54

LE GAC Renaud's avatar
LE GAC Renaud committed
55 56 57 58
    4. Enter the event name in the ``event`` entry.
    5. Enter the python dictionary structure in the ``model`` field.
       Add the first key by right clicking on ``property`` label. Later on,
       Key can be ``Add``, ``Modify`` or ``Delete`` using the
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
       contextual menu.

        .. warning::
            the data user block of all the existing events are modified when the
            python dictionary structure is modified.

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

How to enter an event
----------------------

The events of any kind are stored in the ``history`` table.
In order to create a new one:

    1. open the leaf ``events > history`` in the left panel of the
       viewport.
    2. right click anywhere in the right panel
    3. select the menu item ``Add``

    .. figure:: figures/history-form.png
       :align: center
       :width: 50%

83
       The form to enter an event in the database.
84 85

    4. Scan the different tabs and fill the appropriate entries.