Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
groups
: user groups¶
We assume that you have read the end-user documentation page in The groups plugin.
Side note: Code snippets (lines starting with >>>
) in this document get
tested as part of our development workflow. The following
initialization snippet tells you which demo project is being used in
this document.
>>> import lino
>>> lino.startup('lino_book.projects.noi1e.settings.demo')
>>> from lino.api.doctest import *
>>> from django.db.models import Q
Usage¶
When you install this plugin, you will probably add a panel “Memberships”
(MembershipsByUser
) to the detail layout of your
lino.modlib.users.UserDetail
.
This plugin doesn’t create its own top-level menu but adds its menu commands to
the same menu as lino.modlib.system
.
>>> dd.plugins.groups.menu_group
'system'
In Lino Noi the verbose name of “Group” is changed to “Team”.
>>> print(dd.plugins.groups.verbose_name)
Teams
>>> show_menu_path(groups.Groups)
Configure --> System --> Teams
Groups¶
>>> rt.login("robin").show(groups.Groups)
==================== ========= ==================================================================
Team Private Memberships
-------------------- --------- ------------------------------------------------------------------
`Developers <…>`__ No `Marc <…>`__, `Rolf Rompen <…>`__, **New** **?**
`Managers <…>`__ Yes `Jean <…>`__, `Mathieu <…>`__, `Robin Rood <…>`__, **New** **?**
`Sales team <…>`__ No `Luc <…>`__, `Romain Raffault <…>`__, **New** **?**
==================== ========= ==================================================================
Marc does not see the private group because he’s not a member.
>>> rt.login("marc").show(groups.Groups)
==================== ========= ======================================
Team Private Memberships
-------------------- --------- --------------------------------------
`Developers <…>`__ No `Marc <…>`__, `Rolf Rompen <…>`__
`Sales team <…>`__ No `Luc <…>`__, `Romain Raffault <…>`__
==================== ========= ======================================
Anonymous doesn’t see any groups:
>>> rt.show(groups.Groups)
No data to display
- class lino_xl.lib.groups.Group¶
Django model representing a user group.
- ref¶
The reference. An optional alphanumeric identifier that, unlike the primary key, is editable.
See
lino.mixins.ref.StructuredReferrable.ref
- name¶
The designation in different languages.
- user¶
The owner of the group
- private¶
Whether this group is considered private. See Visibility of comments.
- class lino_xl.lib.groups.Groups¶
Shows all groups.
- class lino_xl.lib.groups.Membership¶
Django model representing a user membership.
- user¶
- group¶
- remark¶