Skip to content
Camille Masset edited this page May 4, 2016 · 1 revision

Memberships

General facts

The model GroupMember represents the membership of a user to a group.
A user has a perm_rank which gives him/her some powers in the group (see page Groups).

Membership creation

There are two possibilities for a user to become a group member, depending on the group's parameter default_member_rank:

  • if default_member_rank = -1, then the user cannot become a member on his own: he has to be invited by a member;
  • if default_member_rank > -1, then then user can request a membership; there are then two sub-cases:
    • default_member_rank = 0, then the request must be validated by a member of the group;
    • default_member_rank > 0, then the request is automatically validated and the user gets the rank default_member_rank.

So, to sum up, a user is really a member of a group, when the membership's attribute perm_rank equals at least 1.

Proper fields

  • created (datetime, auto_now_add: True): creation date of the GroupMember instance
  • join_date (datetime): real date of membership
  • leave_date (datetime): date of leaving
  • perm_rank (integer): defines the permission level of user in group

Relation fields

  • user (model User, related_name: 'memberships')
  • group (model Group, related_name='memberships')
  • values (list of models GroupMemberValue): specific values of CustomFields for the user