The LETS application specs (v1)

This document describes the lino_book.projets.lets1 demo project, an application used as example in A Local Exchange Trade System.

Master data

Show the list of members:

>>> rt.show(rt.models.lets.Members)
... 
========= ===================== ========== ============================================ ===========================================
 name      email                 place      offered_products                             wanted_products
--------- --------------------- ---------- -------------------------------------------- -------------------------------------------
 Fred      fred@example.com      Tallinn    `Bread <Detail>`__, `Buckwheat <Detail>`__
 Argo      argo@example.com      Haapsalu   `Electricity repair work <Detail>`__
 Peter     peter@example.com     Vigala
 Anne      anne@example.com      Tallinn    `Buckwheat <Detail>`__
 Jaanika   jaanika@example.com   Tallinn
 Henri     henri@example.com     Tallinn    `Electricity repair work <Detail>`__         `Buckwheat <Detail>`__, `Eggs <Detail>`__
 Mari      mari@example.com      Tartu                                                   `Eggs <Detail>`__
 Katrin    katrin@example.com    Vigala
========= ===================== ========== ============================================ ===========================================

The Products table shows all products in alphabetical order:

>>> rt.show(rt.models.lets.Products)
... 
==== ========================= ======================================= =======================================
 ID   name                      Offered by                              Wanted by
---- ------------------------- --------------------------------------- ---------------------------------------
 1    Bread                     `Fred <Detail>`__
 2    Buckwheat                 `Fred <Detail>`__, `Anne <Detail>`__    `Henri <Detail>`__
 5    Building repair work
 3    Eggs                                                              `Henri <Detail>`__, `Mari <Detail>`__
 6    Electricity repair work   `Henri <Detail>`__, `Argo <Detail>`__
 4    Sanitary repair work
==== ========================= ======================================= =======================================

Offers

The Offers table show all offers.

>>> rt.show(rt.models.lets.Offers)
... 
==== ======== ========================= =============
 ID   member   product                   valid until
---- -------- ------------------------- -------------
 1    Fred     Bread
 2    Fred     Buckwheat
 3    Anne     Buckwheat
 4    Henri    Electricity repair work
 5    Argo     Electricity repair work
==== ======== ========================= =============

The ActiveProducts table is an example of how to handle customized complex filter conditions. It is a subclass of Products, but adds filter conditions so that only "active" products are shown, i.e. for which there is at least one offer or one demand. It also specifies column_names to show the two virtual fields offered_by and wanted_by.

>>> rt.show(rt.models.lets.ActiveProducts)
... 
========================= ======================================= =======================================
 name                      Offered by                              Wanted by
------------------------- --------------------------------------- ---------------------------------------
 Bread                     `Fred <Detail>`__
 Buckwheat                 `Fred <Detail>`__, `Anne <Detail>`__    `Henri <Detail>`__
 Eggs                                                              `Henri <Detail>`__, `Mari <Detail>`__
 Electricity repair work   `Henri <Detail>`__, `Argo <Detail>`__
========================= ======================================= =======================================