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.
This page contains code snippets (lines starting with >>>), which are
being tested during our development workflow. The following
snippet initializes the demo project used throughout this page.
>>> from lino_book.projects.noi1e.startup 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 --> Site --> Teams
Plugin settings¶
Groups¶
>>> rt.login("robin").show(groups.Groups)
==================== ========= ===================================================
Team Private Memberships
-------------------- --------- ---------------------------------------------------
`Developers <…>`__ No `Jean <…>`__, `Mathieu <…>`__, `Robin Rood <…>`__
`Managers <…>`__ Yes `Luc <…>`__, `Romain Raffault <…>`__
`Sales team <…>`__ No `Marc <…>`__, `Rolf Rompen <…>`__
==================== ========= ===================================================
Marc does not see the Managers group because it’s private and he’s not a member.
>>> rt.login("marc").show(groups.MyGroups)
==================== ==========================================================================================================================================================================
Team Tickets
-------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
`Sales team <…>`__ `#11 <…>`__, `#2 <…>`__, `#110 <…>`__, `#101 <…>`__, `#92 <…>`__, `#83 <…>`__, `#74 <…>`__, `#65 <…>`__, `#56 <…>`__, `#47 <…>`__, `#38 <…>`__, `#29 <…>`__, `#20 <…>`__
==================== ==========================================================================================================================================================================
Anonymous doesn’t see any groups:
>>> rt.login("").show(groups.MyGroups)
Traceback (most recent call last):
...
django.core.exceptions.PermissionDenied: Not permitted for anonymous
Class reference¶
- 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.Membership¶
Django model representing a user membership.
- user¶
- group¶
- remark¶
- class lino_xl.lib.groups.Groups¶
Shows all groups.